Mercurial > hg > xemacs-beta
comparison src/elhash.h @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | de805c49cfc1 |
children | 11054d720c21 |
comparison
equal
deleted
inserted
replaced
411:12e008d41344 | 412:697ef44129c6 |
---|---|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 Boston, MA 02111-1307, USA. */ | 19 Boston, MA 02111-1307, USA. */ |
20 | 20 |
21 /* Synched up with: Not in FSF. */ | 21 /* Synched up with: Not in FSF. */ |
22 | 22 |
23 #ifndef INCLUDED_elhash_h_ | 23 #ifndef _XEMACS_ELHASH_H_ |
24 #define INCLUDED_elhash_h_ | 24 #define _XEMACS_ELHASH_H_ |
25 | 25 |
26 typedef struct Lisp_Hash_Table Lisp_Hash_Table; | 26 DECLARE_LRECORD (hash_table, struct Lisp_Hash_Table); |
27 | 27 |
28 DECLARE_LRECORD (hash_table, Lisp_Hash_Table); | 28 #define XHASH_TABLE(x) XRECORD (x, hash_table, struct Lisp_Hash_Table) |
29 | |
30 #define XHASH_TABLE(x) XRECORD (x, hash_table, Lisp_Hash_Table) | |
31 #define XSETHASH_TABLE(x, p) XSETRECORD (x, p, hash_table) | 29 #define XSETHASH_TABLE(x, p) XSETRECORD (x, p, hash_table) |
32 #define HASH_TABLEP(x) RECORDP (x, hash_table) | 30 #define HASH_TABLEP(x) RECORDP (x, hash_table) |
31 #define GC_HASH_TABLEP(x) GC_RECORDP (x, hash_table) | |
33 #define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table) | 32 #define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table) |
34 #define CONCHECK_HASH_TABLE(x) CONCHECK_RECORD (x, hash_table) | 33 #define CONCHECK_HASH_TABLE(x) CONCHECK_RECORD (x, hash_table) |
35 | 34 |
36 enum hash_table_weakness | 35 enum hash_table_type |
37 { | 36 { |
38 HASH_TABLE_NON_WEAK, | 37 HASH_TABLE_NON_WEAK, |
39 HASH_TABLE_KEY_WEAK, | 38 HASH_TABLE_KEY_WEAK, |
40 HASH_TABLE_VALUE_WEAK, | 39 HASH_TABLE_VALUE_WEAK, |
41 HASH_TABLE_KEY_VALUE_WEAK, | |
42 HASH_TABLE_KEY_CAR_WEAK, | 40 HASH_TABLE_KEY_CAR_WEAK, |
43 HASH_TABLE_VALUE_CAR_WEAK, | 41 HASH_TABLE_VALUE_CAR_WEAK, |
44 HASH_TABLE_WEAK | 42 HASH_TABLE_WEAK |
45 }; | 43 }; |
46 | 44 |
48 { | 46 { |
49 HASH_TABLE_EQ, | 47 HASH_TABLE_EQ, |
50 HASH_TABLE_EQL, | 48 HASH_TABLE_EQL, |
51 HASH_TABLE_EQUAL | 49 HASH_TABLE_EQUAL |
52 }; | 50 }; |
53 | |
54 extern const struct lrecord_description hash_table_description[]; | |
55 | 51 |
56 EXFUN (Fcopy_hash_table, 1); | 52 EXFUN (Fcopy_hash_table, 1); |
57 EXFUN (Fhash_table_count, 1); | 53 EXFUN (Fhash_table_count, 1); |
58 EXFUN (Fgethash, 3); | 54 EXFUN (Fgethash, 3); |
59 EXFUN (Fputhash, 3); | 55 EXFUN (Fputhash, 3); |
64 typedef int (*hash_table_test_function_t) (Lisp_Object obj1, Lisp_Object obj2); | 60 typedef int (*hash_table_test_function_t) (Lisp_Object obj1, Lisp_Object obj2); |
65 typedef unsigned long (*hash_table_hash_function_t) (Lisp_Object obj); | 61 typedef unsigned long (*hash_table_hash_function_t) (Lisp_Object obj); |
66 typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value, | 62 typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value, |
67 void* extra_arg); | 63 void* extra_arg); |
68 | 64 |
69 Lisp_Object make_general_lisp_hash_table (enum hash_table_test test, | 65 |
70 size_t size, | 66 Lisp_Object make_general_lisp_hash_table (size_t size, |
71 double rehash_size, | 67 enum hash_table_type type, |
68 enum hash_table_test test, | |
72 double rehash_threshold, | 69 double rehash_threshold, |
73 enum hash_table_weakness weakness); | 70 double rehash_size); |
74 | 71 |
75 Lisp_Object make_lisp_hash_table (size_t size, | 72 Lisp_Object make_lisp_hash_table (size_t size, |
76 enum hash_table_weakness weakness, | 73 enum hash_table_type type, |
77 enum hash_table_test test); | 74 enum hash_table_test test); |
78 | 75 |
79 void elisp_maphash (maphash_function_t function, | 76 void elisp_maphash (maphash_function_t function, |
80 Lisp_Object hash_table, void *extra_arg); | 77 Lisp_Object hash_table, void *extra_arg); |
81 | 78 |
82 void elisp_map_remhash (maphash_function_t predicate, | 79 void elisp_map_remhash (maphash_function_t predicate, |
83 Lisp_Object hash_table, void *extra_arg); | 80 Lisp_Object hash_table, void *extra_arg); |
84 | 81 |
85 int finish_marking_weak_hash_tables (void); | 82 int finish_marking_weak_hash_tables (int (*obj_marked_p) (Lisp_Object), |
86 void prune_weak_hash_tables (void); | 83 void (*markobj) (Lisp_Object)); |
84 void prune_weak_hash_tables (int (*obj_marked_p) (Lisp_Object)); | |
87 | 85 |
88 void pdump_reorganize_hash_table (Lisp_Object); | 86 #endif /* _XEMACS_ELHASH_H_ */ |
89 | |
90 #endif /* INCLUDED_elhash_h_ */ |