0
|
1 /* Lisp interface to hash tables -- include file.
|
|
2 Copyright (C) 1995, 1996 Ben Wing.
|
|
3
|
|
4 This file is part of XEmacs.
|
|
5
|
|
6 XEmacs is free software; you can redistribute it and/or modify it
|
|
7 under the terms of the GNU General Public License as published by the
|
|
8 Free Software Foundation; either version 2, or (at your option) any
|
|
9 later version.
|
|
10
|
|
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with XEmacs; see the file COPYING. If not, write to
|
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
|
20
|
|
21 /* Synched up with: Not in FSF. */
|
|
22
|
|
23 #ifndef _XEMACS_ELHASH_H_
|
|
24 #define _XEMACS_ELHASH_H_
|
|
25
|
|
26 DECLARE_LRECORD (hashtable, struct hashtable_struct);
|
|
27
|
|
28 #define XHASHTABLE(x) XRECORD (x, hashtable, struct hashtable_struct)
|
|
29 #define XSETHASHTABLE(x, p) XSETRECORD (x, p, hashtable)
|
|
30 #define HASHTABLEP(x) RECORDP (x, hashtable)
|
|
31 #define GC_HASHTABLEP(x) GC_RECORDP (x, hashtable)
|
|
32 #define CHECK_HASHTABLE(x) CHECK_RECORD (x, hashtable)
|
|
33 #define CONCHECK_HASHTABLE(x) CONCHECK_RECORD (x, hashtable)
|
|
34
|
|
35 enum hashtable_type
|
|
36 {
|
|
37 HASHTABLE_NONWEAK,
|
|
38 HASHTABLE_KEY_WEAK,
|
|
39 HASHTABLE_VALUE_WEAK,
|
|
40 HASHTABLE_KEY_CAR_WEAK,
|
|
41 HASHTABLE_VALUE_CAR_WEAK,
|
|
42 HASHTABLE_WEAK
|
|
43 };
|
|
44
|
|
45 enum hashtable_test_fun
|
|
46 {
|
|
47 HASHTABLE_EQ,
|
|
48 HASHTABLE_EQL,
|
|
49 HASHTABLE_EQUAL
|
|
50 };
|
|
51
|
|
52 Lisp_Object Fmake_hashtable (Lisp_Object size, Lisp_Object test_fun);
|
|
53 Lisp_Object Fcopy_hashtable (Lisp_Object old_table);
|
173
|
54 Lisp_Object Fgethash (Lisp_Object obj, Lisp_Object table, Lisp_Object default_);
|
|
55 Lisp_Object Fputhash (Lisp_Object obj, Lisp_Object val, Lisp_Object table);
|
0
|
56 Lisp_Object Fremhash (Lisp_Object obj, Lisp_Object table);
|
|
57 Lisp_Object Fhashtable_fullness (Lisp_Object table);
|
|
58
|
|
59 Lisp_Object make_lisp_hashtable (int size,
|
|
60 enum hashtable_type type,
|
|
61 enum hashtable_test_fun test_fun);
|
|
62
|
|
63 void elisp_maphash (void (*fn) (CONST void *key, void *contents,
|
|
64 void *extra_arg),
|
173
|
65 Lisp_Object table,
|
0
|
66 void *extra_arg);
|
|
67
|
|
68 void elisp_map_remhash (int (*fn) (CONST void *key,
|
|
69 CONST void *contents,
|
|
70 void *extra_arg),
|
173
|
71 Lisp_Object table,
|
0
|
72 void *extra_arg);
|
|
73
|
|
74 int finish_marking_weak_hashtables (int (*obj_marked_p) (Lisp_Object),
|
|
75 void (*markobj) (Lisp_Object));
|
|
76 void prune_weak_hashtables (int (*obj_marked_p) (Lisp_Object));
|
|
77
|
173
|
78 void *elisp_hvector_malloc (unsigned int, Lisp_Object);
|
0
|
79 void elisp_hvector_free (void *ptr, Lisp_Object table);
|
|
80
|
|
81 #endif /* _XEMACS_ELHASH_H_ */
|