Mercurial > hg > xemacs-beta
comparison src/elhash.c @ 5128:7be849cb8828 ben-lisp-object
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sun, 07 Mar 2010 02:09:59 -0600 |
parents | a9c41067dd88 6afe991b8135 |
children | f965e31a35f0 |
comparison
equal
deleted
inserted
replaced
5127:a9c41067dd88 | 5128:7be849cb8828 |
---|---|
82 #include "bytecode.h" | 82 #include "bytecode.h" |
83 #include "elhash.h" | 83 #include "elhash.h" |
84 #include "opaque.h" | 84 #include "opaque.h" |
85 | 85 |
86 Lisp_Object Qhash_tablep; | 86 Lisp_Object Qhash_tablep; |
87 static Lisp_Object Qhashtable, Qhash_table; | 87 static Lisp_Object Qhashtable, Qhash_table, Qmake_hash_table; |
88 static Lisp_Object Qweakness, Qvalue, Qkey_or_value, Qkey_and_value; | 88 static Lisp_Object Qweakness, Qvalue, Qkey_or_value, Qkey_and_value; |
89 static Lisp_Object Vall_weak_hash_tables; | 89 static Lisp_Object Vall_weak_hash_tables; |
90 static Lisp_Object Qrehash_size, Qrehash_threshold; | 90 static Lisp_Object Qrehash_size, Qrehash_threshold; |
91 static Lisp_Object Q_size, Q_test, Q_weakness, Q_rehash_size, Q_rehash_threshold; | 91 static Lisp_Object Q_size, Q_test, Q_weakness, Q_rehash_size, Q_rehash_threshold; |
92 | 92 |
987 | 987 |
988 arguments: (&key TEST SIZE REHASH-SIZE REHASH-THRESHOLD WEAKNESS) | 988 arguments: (&key TEST SIZE REHASH-SIZE REHASH-THRESHOLD WEAKNESS) |
989 */ | 989 */ |
990 (int nargs, Lisp_Object *args)) | 990 (int nargs, Lisp_Object *args)) |
991 { | 991 { |
992 int i = 0; | 992 #ifdef NO_NEED_TO_HANDLE_21_4_CODE |
993 Lisp_Object test = Qnil; | 993 PARSE_KEYWORDS (Qmake_hash_table, nargs, args, 0, 5, |
994 Lisp_Object size = Qnil; | 994 (test, size, rehash_size, rehash_threshold, weakness), |
995 Lisp_Object rehash_size = Qnil; | 995 NULL, weakness = Qunbound), 0); |
996 Lisp_Object rehash_threshold = Qnil; | 996 #else |
997 Lisp_Object weakness = Qnil; | 997 PARSE_KEYWORDS (Qmake_hash_table, nargs, args, 0, 6, |
998 | 998 (test, size, rehash_size, rehash_threshold, weakness, |
999 while (i + 1 < nargs) | 999 type), (type = Qunbound, weakness = Qunbound), 0); |
1000 { | 1000 |
1001 Lisp_Object keyword = args[i++]; | 1001 if (EQ (weakness, Qunbound)) |
1002 Lisp_Object value = args[i++]; | 1002 { |
1003 | 1003 if (EQ (weakness, Qunbound) && !EQ (type, Qunbound)) |
1004 if (EQ (keyword, Q_test)) test = value; | 1004 { |
1005 else if (EQ (keyword, Q_size)) size = value; | 1005 weakness = type; |
1006 else if (EQ (keyword, Q_rehash_size)) rehash_size = value; | 1006 } |
1007 else if (EQ (keyword, Q_rehash_threshold)) rehash_threshold = value; | 1007 else |
1008 else if (EQ (keyword, Q_weakness)) weakness = value; | 1008 { |
1009 else if (EQ (keyword, Q_type))/*obsolete*/ weakness = value; | 1009 weakness = Qnil; |
1010 else invalid_constant ("Invalid hash table property keyword", keyword); | 1010 } |
1011 } | 1011 } |
1012 | 1012 #endif |
1013 if (i < nargs) | |
1014 sferror ("Hash table property requires a value", args[i]); | |
1015 | 1013 |
1016 #define VALIDATE_VAR(var) \ | 1014 #define VALIDATE_VAR(var) \ |
1017 if (!NILP (var)) hash_table_##var##_validate (Q##var, var, ERROR_ME); | 1015 if (!NILP (var)) hash_table_##var##_validate (Q##var, var, ERROR_ME); |
1018 | 1016 |
1019 VALIDATE_VAR (test); | 1017 VALIDATE_VAR (test); |
1832 #endif | 1830 #endif |
1833 | 1831 |
1834 DEFSYMBOL_MULTIWORD_PREDICATE (Qhash_tablep); | 1832 DEFSYMBOL_MULTIWORD_PREDICATE (Qhash_tablep); |
1835 DEFSYMBOL (Qhash_table); | 1833 DEFSYMBOL (Qhash_table); |
1836 DEFSYMBOL (Qhashtable); | 1834 DEFSYMBOL (Qhashtable); |
1835 DEFSYMBOL (Qmake_hash_table); | |
1837 DEFSYMBOL (Qweakness); | 1836 DEFSYMBOL (Qweakness); |
1838 DEFSYMBOL (Qvalue); | 1837 DEFSYMBOL (Qvalue); |
1839 DEFSYMBOL (Qkey_or_value); | 1838 DEFSYMBOL (Qkey_or_value); |
1840 DEFSYMBOL (Qkey_and_value); | 1839 DEFSYMBOL (Qkey_and_value); |
1841 DEFSYMBOL (Qrehash_size); | 1840 DEFSYMBOL (Qrehash_size); |