comparison src/fns.c @ 25455:8c2f3438bb2c

(QCweakness): Replaces QCweak. (Fmake_hash_table): Ditto. (Fmakehash): Ditto. (syms_of_fns): Ditto.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 30 Aug 1999 21:05:30 +0000
parents f32071216123
children 5051c1d824fa
comparison
equal deleted inserted replaced
25454:80ac191b6d2b 25455:8c2f3438bb2c
3292 Lisp_Object Vweak_hash_tables; 3292 Lisp_Object Vweak_hash_tables;
3293 3293
3294 /* Various symbols. */ 3294 /* Various symbols. */
3295 3295
3296 Lisp_Object Qhash_table_p, Qeq, Qeql, Qequal, Qkey, Qvalue; 3296 Lisp_Object Qhash_table_p, Qeq, Qeql, Qequal, Qkey, Qvalue;
3297 Lisp_Object QCtest, QCsize, QCrehash_size, QCrehash_threshold, QCweak; 3297 Lisp_Object QCtest, QCsize, QCrehash_size, QCrehash_threshold, QCweakness;
3298 Lisp_Object Qhash_table_test; 3298 Lisp_Object Qhash_table_test;
3299 3299
3300 /* Function prototypes. */ 3300 /* Function prototypes. */
3301 3301
3302 static struct Lisp_Hash_Table *check_hash_table P_ ((Lisp_Object)); 3302 static struct Lisp_Hash_Table *check_hash_table P_ ((Lisp_Object));
4202 \n\ 4202 \n\
4203 :REHASH-THRESHOLD THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0.\n\ 4203 :REHASH-THRESHOLD THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0.\n\
4204 Resize the hash table when ratio of the number of entries in the table.\n\ 4204 Resize the hash table when ratio of the number of entries in the table.\n\
4205 Default is 0.8.\n\ 4205 Default is 0.8.\n\
4206 \n\ 4206 \n\
4207 :WEAK WEAK -- WEAK must be one of nil, t, `key', or `value'.\n\ 4207 :WEAKNESS WEAK -- WEAK must be one of nil, t, `key', or `value'.\n\
4208 If WEAK is not nil, the table returned is a weak table. Key/value\n\ 4208 If WEAK is not nil, the table returned is a weak table. Key/value\n\
4209 pairs are removed from a weak hash table when their key, value or both\n\ 4209 pairs are removed from a weak hash table when their key, value or both\n\
4210 (WEAK t) are otherwise unreferenced. Default is nil.") 4210 (WEAK t) are otherwise unreferenced. Default is nil.")
4211 (nargs, args) 4211 (nargs, args)
4212 int nargs; 4212 int nargs;
4266 || XFLOATINT (rehash_threshold) > 1.0) 4266 || XFLOATINT (rehash_threshold) > 1.0)
4267 Fsignal (Qerror, 4267 Fsignal (Qerror,
4268 list2 (build_string ("Illegal hash table rehash threshold"), 4268 list2 (build_string ("Illegal hash table rehash threshold"),
4269 rehash_threshold)); 4269 rehash_threshold));
4270 4270
4271 /* Look for `:weak WEAK'. */ 4271 /* Look for `:weakness WEAK'. */
4272 i = get_key_arg (QCweak, nargs, args, used); 4272 i = get_key_arg (QCweakness, nargs, args, used);
4273 weak = i < 0 ? Qnil : args[i]; 4273 weak = i < 0 ? Qnil : args[i];
4274 if (!NILP (weak) 4274 if (!NILP (weak)
4275 && !EQ (weak, Qt) 4275 && !EQ (weak, Qt)
4276 && !EQ (weak, Qkey) 4276 && !EQ (weak, Qkey)
4277 && !EQ (weak, Qvalue)) 4277 && !EQ (weak, Qvalue))
4339 4339
4340 /* Recognize test argument. */ 4340 /* Recognize test argument. */
4341 if (SYMBOLP (args[i]) 4341 if (SYMBOLP (args[i])
4342 && !EQ (args[i], QCrehash_size) 4342 && !EQ (args[i], QCrehash_size)
4343 && !EQ (args[i], QCrehash_threshold) 4343 && !EQ (args[i], QCrehash_threshold)
4344 && !EQ (args[i], QCweak)) 4344 && !EQ (args[i], QCweakness))
4345 { 4345 {
4346 args2[j++] = QCtest; 4346 args2[j++] = QCtest;
4347 args2[j++] = args[i++]; 4347 args2[j++] = args[i++];
4348 } 4348 }
4349 4349
4351 if (EQ (args[i], Qt) 4351 if (EQ (args[i], Qt)
4352 || NILP (args[i]) 4352 || NILP (args[i])
4353 || EQ (args[i], Qkey) 4353 || EQ (args[i], Qkey)
4354 || EQ (args[i], Qvalue)) 4354 || EQ (args[i], Qvalue))
4355 { 4355 {
4356 args2[j++] = QCweak; 4356 args2[j++] = QCweakness;
4357 args2[j++] = args[i++]; 4357 args2[j++] = args[i++];
4358 } 4358 }
4359 4359
4360 /* Copy remaining arguments. */ 4360 /* Copy remaining arguments. */
4361 while (i < nargs) 4361 while (i < nargs)
4549 staticpro (&QCsize); 4549 staticpro (&QCsize);
4550 QCrehash_size = intern (":rehash-size"); 4550 QCrehash_size = intern (":rehash-size");
4551 staticpro (&QCrehash_size); 4551 staticpro (&QCrehash_size);
4552 QCrehash_threshold = intern (":rehash-threshold"); 4552 QCrehash_threshold = intern (":rehash-threshold");
4553 staticpro (&QCrehash_threshold); 4553 staticpro (&QCrehash_threshold);
4554 QCweak = intern (":weak"); 4554 QCweakness = intern (":weakness");
4555 staticpro (&QCweak); 4555 staticpro (&QCweakness);
4556 Qkey = intern ("key"); 4556 Qkey = intern ("key");
4557 staticpro (&Qkey); 4557 staticpro (&Qkey);
4558 Qvalue = intern ("value"); 4558 Qvalue = intern ("value");
4559 staticpro (&Qvalue); 4559 staticpro (&Qvalue);
4560 Qhash_table_test = intern ("hash-table-test"); 4560 Qhash_table_test = intern ("hash-table-test");