428
|
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
|
440
|
23 #ifndef INCLUDED_elhash_h_
|
|
24 #define INCLUDED_elhash_h_
|
428
|
25
|
440
|
26 typedef struct Lisp_Hash_Table Lisp_Hash_Table;
|
428
|
27
|
440
|
28 DECLARE_LRECORD (hash_table, Lisp_Hash_Table);
|
|
29
|
|
30 #define XHASH_TABLE(x) XRECORD (x, hash_table, Lisp_Hash_Table)
|
617
|
31 #define wrap_hash_table(p) wrap_record (p, hash_table)
|
428
|
32 #define HASH_TABLEP(x) RECORDP (x, hash_table)
|
|
33 #define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table)
|
|
34 #define CONCHECK_HASH_TABLE(x) CONCHECK_RECORD (x, hash_table)
|
|
35
|
|
36 enum hash_table_weakness
|
|
37 {
|
|
38 HASH_TABLE_NON_WEAK,
|
|
39 HASH_TABLE_KEY_WEAK,
|
|
40 HASH_TABLE_VALUE_WEAK,
|
442
|
41 HASH_TABLE_KEY_VALUE_WEAK,
|
428
|
42 HASH_TABLE_KEY_CAR_WEAK,
|
|
43 HASH_TABLE_VALUE_CAR_WEAK,
|
450
|
44 HASH_TABLE_KEY_CAR_VALUE_WEAK,
|
428
|
45 HASH_TABLE_WEAK
|
|
46 };
|
|
47
|
|
48 enum hash_table_test
|
|
49 {
|
|
50 HASH_TABLE_EQ,
|
|
51 HASH_TABLE_EQL,
|
|
52 HASH_TABLE_EQUAL
|
|
53 };
|
|
54
|
1204
|
55 extern const struct memory_description hash_table_description[];
|
428
|
56
|
|
57 EXFUN (Fcopy_hash_table, 1);
|
|
58 EXFUN (Fhash_table_count, 1);
|
|
59 EXFUN (Fgethash, 3);
|
|
60 EXFUN (Fputhash, 3);
|
|
61 EXFUN (Fremhash, 2);
|
|
62 EXFUN (Fclrhash, 1);
|
|
63
|
|
64 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);
|
|
66 typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value,
|
|
67 void* extra_arg);
|
|
68
|
450
|
69 Lisp_Object make_standard_lisp_hash_table (enum hash_table_test test,
|
665
|
70 Elemcount size,
|
450
|
71 double rehash_size,
|
|
72 double rehash_threshold,
|
|
73 enum hash_table_weakness weakness);
|
|
74
|
|
75 Lisp_Object make_general_lisp_hash_table (hash_table_hash_function_t hash_function,
|
|
76 hash_table_test_function_t test_function,
|
665
|
77 Elemcount size,
|
428
|
78 double rehash_size,
|
|
79 double rehash_threshold,
|
|
80 enum hash_table_weakness weakness);
|
|
81
|
665
|
82 Lisp_Object make_lisp_hash_table (Elemcount size,
|
428
|
83 enum hash_table_weakness weakness,
|
|
84 enum hash_table_test test);
|
|
85
|
|
86 void elisp_maphash (maphash_function_t function,
|
|
87 Lisp_Object hash_table, void *extra_arg);
|
|
88
|
489
|
89 void elisp_maphash_unsafe (maphash_function_t function,
|
|
90 Lisp_Object hash_table, void *extra_arg);
|
|
91
|
428
|
92 void elisp_map_remhash (maphash_function_t predicate,
|
|
93 Lisp_Object hash_table, void *extra_arg);
|
|
94
|
|
95 int finish_marking_weak_hash_tables (void);
|
|
96 void prune_weak_hash_tables (void);
|
|
97
|
440
|
98 void pdump_reorganize_hash_table (Lisp_Object);
|
428
|
99
|
440
|
100 #endif /* INCLUDED_elhash_h_ */
|