annotate src/elhash.h @ 223:2c611d1463a6 r20-4b10

Import from CVS: tag r20-4b10
author cvs
date Mon, 13 Aug 2007 10:10:54 +0200
parents 3d6bfa290dbd
children f220cc83d72e
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
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 173
diff changeset
26 DECLARE_LRECORD (hashtable, struct hashtable);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 173
diff changeset
28 #define XHASHTABLE(x) XRECORD (x, hashtable, struct hashtable)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #define XSETHASHTABLE(x, p) XSETRECORD (x, p, hashtable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #define HASHTABLEP(x) RECORDP (x, hashtable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #define GC_HASHTABLEP(x) GC_RECORDP (x, hashtable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #define CHECK_HASHTABLE(x) CHECK_RECORD (x, hashtable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #define CONCHECK_HASHTABLE(x) CONCHECK_RECORD (x, hashtable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 enum hashtable_type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 HASHTABLE_NONWEAK,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 HASHTABLE_KEY_WEAK,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 HASHTABLE_VALUE_WEAK,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 HASHTABLE_KEY_CAR_WEAK,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 HASHTABLE_VALUE_CAR_WEAK,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 HASHTABLE_WEAK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 enum hashtable_test_fun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 HASHTABLE_EQ,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 HASHTABLE_EQL,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 HASHTABLE_EQUAL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 Lisp_Object Fmake_hashtable (Lisp_Object size, Lisp_Object test_fun);
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 185
diff changeset
53 Lisp_Object Fmake_weak_hashtable(Lisp_Object size, Lisp_Object test);
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 185
diff changeset
54 Lisp_Object Fmake_key_weak_hashtable(Lisp_Object size, Lisp_Object test);
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 185
diff changeset
55 Lisp_Object Fmake_value_weak_hashtable(Lisp_Object size, Lisp_Object test);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 Lisp_Object Fcopy_hashtable (Lisp_Object old_table);
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 0
diff changeset
57 Lisp_Object Fgethash (Lisp_Object obj, Lisp_Object table, Lisp_Object default_);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 0
diff changeset
58 Lisp_Object Fputhash (Lisp_Object obj, Lisp_Object val, Lisp_Object table);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 Lisp_Object Fremhash (Lisp_Object obj, Lisp_Object table);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 Lisp_Object Fhashtable_fullness (Lisp_Object table);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 Lisp_Object make_lisp_hashtable (int size,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 enum hashtable_type type,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 enum hashtable_test_fun test_fun);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 void elisp_maphash (void (*fn) (CONST void *key, void *contents,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 void *extra_arg),
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 0
diff changeset
68 Lisp_Object table,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 void *extra_arg);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 void elisp_map_remhash (int (*fn) (CONST void *key,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 CONST void *contents,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 void *extra_arg),
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 0
diff changeset
74 Lisp_Object table,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 void *extra_arg);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 int finish_marking_weak_hashtables (int (*obj_marked_p) (Lisp_Object),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 void (*markobj) (Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 void prune_weak_hashtables (int (*obj_marked_p) (Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 0
diff changeset
81 void *elisp_hvector_malloc (unsigned int, Lisp_Object);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 void elisp_hvector_free (void *ptr, Lisp_Object table);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 #endif /* _XEMACS_ELHASH_H_ */