Mercurial > hg > xemacs-beta
comparison src/elhash.h @ 424:11054d720c21 r21-2-20
Import from CVS: tag r21-2-20
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:26:11 +0200 |
parents | 697ef44129c6 |
children |
comparison
equal
deleted
inserted
replaced
423:28d9c139be4c | 424:11054d720c21 |
---|---|
26 DECLARE_LRECORD (hash_table, struct Lisp_Hash_Table); | 26 DECLARE_LRECORD (hash_table, struct Lisp_Hash_Table); |
27 | 27 |
28 #define XHASH_TABLE(x) XRECORD (x, hash_table, struct Lisp_Hash_Table) | 28 #define XHASH_TABLE(x) XRECORD (x, hash_table, struct Lisp_Hash_Table) |
29 #define XSETHASH_TABLE(x, p) XSETRECORD (x, p, hash_table) | 29 #define XSETHASH_TABLE(x, p) XSETRECORD (x, p, hash_table) |
30 #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) | |
32 #define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table) | 31 #define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table) |
33 #define CONCHECK_HASH_TABLE(x) CONCHECK_RECORD (x, hash_table) | 32 #define CONCHECK_HASH_TABLE(x) CONCHECK_RECORD (x, hash_table) |
34 | 33 |
35 enum hash_table_type | 34 enum hash_table_weakness |
36 { | 35 { |
37 HASH_TABLE_NON_WEAK, | 36 HASH_TABLE_NON_WEAK, |
38 HASH_TABLE_KEY_WEAK, | 37 HASH_TABLE_KEY_WEAK, |
39 HASH_TABLE_VALUE_WEAK, | 38 HASH_TABLE_VALUE_WEAK, |
40 HASH_TABLE_KEY_CAR_WEAK, | 39 HASH_TABLE_KEY_CAR_WEAK, |
47 HASH_TABLE_EQ, | 46 HASH_TABLE_EQ, |
48 HASH_TABLE_EQL, | 47 HASH_TABLE_EQL, |
49 HASH_TABLE_EQUAL | 48 HASH_TABLE_EQUAL |
50 }; | 49 }; |
51 | 50 |
51 extern const struct lrecord_description hash_table_description[]; | |
52 | |
52 EXFUN (Fcopy_hash_table, 1); | 53 EXFUN (Fcopy_hash_table, 1); |
53 EXFUN (Fhash_table_count, 1); | 54 EXFUN (Fhash_table_count, 1); |
54 EXFUN (Fgethash, 3); | 55 EXFUN (Fgethash, 3); |
55 EXFUN (Fputhash, 3); | 56 EXFUN (Fputhash, 3); |
56 EXFUN (Fremhash, 2); | 57 EXFUN (Fremhash, 2); |
60 typedef int (*hash_table_test_function_t) (Lisp_Object obj1, Lisp_Object obj2); | 61 typedef int (*hash_table_test_function_t) (Lisp_Object obj1, Lisp_Object obj2); |
61 typedef unsigned long (*hash_table_hash_function_t) (Lisp_Object obj); | 62 typedef unsigned long (*hash_table_hash_function_t) (Lisp_Object obj); |
62 typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value, | 63 typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value, |
63 void* extra_arg); | 64 void* extra_arg); |
64 | 65 |
66 struct Lisp_Hash_Table; | |
65 | 67 |
66 Lisp_Object make_general_lisp_hash_table (size_t size, | 68 Lisp_Object make_general_lisp_hash_table (enum hash_table_test test, |
67 enum hash_table_type type, | 69 size_t size, |
68 enum hash_table_test test, | 70 double rehash_size, |
69 double rehash_threshold, | 71 double rehash_threshold, |
70 double rehash_size); | 72 enum hash_table_weakness weakness); |
71 | 73 |
72 Lisp_Object make_lisp_hash_table (size_t size, | 74 Lisp_Object make_lisp_hash_table (size_t size, |
73 enum hash_table_type type, | 75 enum hash_table_weakness weakness, |
74 enum hash_table_test test); | 76 enum hash_table_test test); |
75 | 77 |
76 void elisp_maphash (maphash_function_t function, | 78 void elisp_maphash (maphash_function_t function, |
77 Lisp_Object hash_table, void *extra_arg); | 79 Lisp_Object hash_table, void *extra_arg); |
78 | 80 |
79 void elisp_map_remhash (maphash_function_t predicate, | 81 void elisp_map_remhash (maphash_function_t predicate, |
80 Lisp_Object hash_table, void *extra_arg); | 82 Lisp_Object hash_table, void *extra_arg); |
81 | 83 |
82 int finish_marking_weak_hash_tables (int (*obj_marked_p) (Lisp_Object), | 84 int finish_marking_weak_hash_tables (void); |
83 void (*markobj) (Lisp_Object)); | 85 void prune_weak_hash_tables (void); |
84 void prune_weak_hash_tables (int (*obj_marked_p) (Lisp_Object)); | 86 |
87 void reorganize_hash_table (struct Lisp_Hash_Table *ht); | |
85 | 88 |
86 #endif /* _XEMACS_ELHASH_H_ */ | 89 #endif /* _XEMACS_ELHASH_H_ */ |