annotate src/elhash.h @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 8626e4521993
children de805c49cfc1
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
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
23 #ifndef INCLUDED_elhash_h_
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
24 #define INCLUDED_elhash_h_
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
26 typedef struct Lisp_Hash_Table Lisp_Hash_Table;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
28 DECLARE_LRECORD (hash_table, Lisp_Hash_Table);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
29
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
30 #define XHASH_TABLE(x) XRECORD (x, hash_table, Lisp_Hash_Table)
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
31 #define XSETHASH_TABLE(x, p) XSETRECORD (x, p, hash_table)
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
32 #define HASH_TABLEP(x) RECORDP (x, hash_table)
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
33 #define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table)
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
34 #define CONCHECK_HASH_TABLE(x) CONCHECK_RECORD (x, hash_table)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
36 enum hash_table_weakness
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 {
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
38 HASH_TABLE_NON_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
39 HASH_TABLE_KEY_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
40 HASH_TABLE_VALUE_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
41 HASH_TABLE_KEY_CAR_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
42 HASH_TABLE_VALUE_CAR_WEAK,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
43 HASH_TABLE_WEAK
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
46 enum hash_table_test
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 {
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
48 HASH_TABLE_EQ,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
49 HASH_TABLE_EQL,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
50 HASH_TABLE_EQUAL
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
53 extern const struct lrecord_description hash_table_description[];
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
54
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
55 EXFUN (Fcopy_hash_table, 1);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
56 EXFUN (Fhash_table_count, 1);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
57 EXFUN (Fgethash, 3);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
58 EXFUN (Fputhash, 3);
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 243
diff changeset
59 EXFUN (Fremhash, 2);
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
60 EXFUN (Fclrhash, 1);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
62 typedef unsigned long hashcode_t;
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
63 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
64 typedef unsigned long (*hash_table_hash_function_t) (Lisp_Object obj);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
65 typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
66 void* extra_arg);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
68 Lisp_Object make_general_lisp_hash_table (enum hash_table_test test,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
69 size_t size,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
70 double rehash_size,
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
71 double rehash_threshold,
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
72 enum hash_table_weakness weakness);
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
73
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
74 Lisp_Object make_lisp_hash_table (size_t size,
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
75 enum hash_table_weakness weakness,
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
76 enum hash_table_test test);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
78 void elisp_maphash (maphash_function_t function,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
79 Lisp_Object hash_table, void *extra_arg);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
81 void elisp_map_remhash (maphash_function_t predicate,
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
82 Lisp_Object hash_table, void *extra_arg);
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 272
diff changeset
83
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
84 int finish_marking_weak_hash_tables (void);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
85 void prune_weak_hash_tables (void);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
87 void pdump_reorganize_hash_table (Lisp_Object);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
88
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
89 #endif /* INCLUDED_elhash_h_ */