annotate src/elhash.h @ 388:aabb7f5b1c81 r21-2-9

Import from CVS: tag r21-2-9
author cvs
date Mon, 13 Aug 2007 11:09:42 +0200
parents 8626e4521993
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Lisp interface to hash tables -- include file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1995, 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 #ifndef _XEMACS_ELHASH_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 #define _XEMACS_ELHASH_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
26 DECLARE_LRECORD (hash_table, struct Lisp_Hash_Table);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
28 #define XHASH_TABLE(x) XRECORD (x, hash_table, struct Lisp_Hash_Table)
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
29 #define XSETHASH_TABLE(x, p) XSETRECORD (x, p, hash_table)
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
30 #define HASH_TABLEP(x) RECORDP (x, hash_table)
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
31 #define GC_HASH_TABLEP(x) GC_RECORDP (x, hash_table)
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
32 #define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table)
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
33 #define CONCHECK_HASH_TABLE(x) CONCHECK_RECORD (x, hash_table)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
35 enum hash_table_type
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 {
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
37 HASH_TABLE_NON_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
38 HASH_TABLE_KEY_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
39 HASH_TABLE_VALUE_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
40 HASH_TABLE_KEY_CAR_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
41 HASH_TABLE_VALUE_CAR_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
42 HASH_TABLE_WEAK
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
45 enum hash_table_test
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 {
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
47 HASH_TABLE_EQ,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
48 HASH_TABLE_EQL,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
49 HASH_TABLE_EQUAL
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
52 EXFUN (Fcopy_hash_table, 1);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
53 EXFUN (Fhash_table_count, 1);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
54 EXFUN (Fgethash, 3);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
55 EXFUN (Fputhash, 3);
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 243
diff changeset
56 EXFUN (Fremhash, 2);
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
57 EXFUN (Fclrhash, 1);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
59 typedef unsigned long hashcode_t;
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
60 typedef int (*hash_table_test_function_t) (Lisp_Object obj1, Lisp_Object obj2);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
61 typedef unsigned long (*hash_table_hash_function_t) (Lisp_Object obj);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
62 typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
63 void* extra_arg);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
66 Lisp_Object make_general_lisp_hash_table (size_t size,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
67 enum hash_table_type type,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
68 enum hash_table_test test,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
69 double rehash_threshold,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
70 double rehash_size);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
71
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
72 Lisp_Object make_lisp_hash_table (size_t size,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
73 enum hash_table_type type,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
74 enum hash_table_test test);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
76 void elisp_maphash (maphash_function_t function,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
77 Lisp_Object hash_table, void *extra_arg);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
79 void elisp_map_remhash (maphash_function_t predicate,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
80 Lisp_Object hash_table, void *extra_arg);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
81
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
82 int finish_marking_weak_hash_tables (int (*obj_marked_p) (Lisp_Object),
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
83 void (*markobj) (Lisp_Object));
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
84 void prune_weak_hash_tables (int (*obj_marked_p) (Lisp_Object));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 #endif /* _XEMACS_ELHASH_H_ */