#include "category.h"
#include "seq.h"
#include "dict.h"
+#include "ent/ent.h"
Lisp_Object Qhash_tablep;
static Lisp_Object Qhashtable, Qhash_table;
static Lisp_Object Qweakness, Qvalue, Qkey_or_value, Qkey_and_value;
static Lisp_Object Vall_weak_hash_tables;
static Lisp_Object Qrehash_size, Qrehash_threshold;
-static Lisp_Object Q_size, Q_test, Q_weakness;
+static Lisp_Object Q_size, Q_weakness;
+Lisp_Object Q_test;
static Lisp_Object Q_rehash_size, Q_rehash_threshold;
/* obsolete as of 19990901 in xemacs-21.2 */
print_hash_table(Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
hash_table_t ht = XHASH_TABLE(obj);
- char buf[128];
write_c_string(print_readably ? "#s(hash-table" : "#<hash-table",
printcharfun);
if (ht->count || !print_readably) {
if (print_readably)
- sprintf(buf, " size %lu", (unsigned long)ht->count);
+ write_fmt_str(printcharfun, " size %lu", (unsigned long)ht->count);
else
- sprintf(buf, " size %lu/%lu",
- (unsigned long)ht->count,
- (unsigned long)ht->size);
- write_c_string(buf, printcharfun);
+ write_fmt_str(printcharfun, " size %lu/%lu",
+ (unsigned long)ht->count,
+ (unsigned long)ht->size);
}
if (ht->weakness != HASH_TABLE_NON_WEAK) {
- sprintf(buf, " weakness %s",
- (ht->weakness == HASH_TABLE_WEAK ? "key-and-value" :
- ht->weakness == HASH_TABLE_KEY_WEAK ? "key" :
- ht->weakness == HASH_TABLE_VALUE_WEAK ? "value" :
- ht->weakness ==
- HASH_TABLE_KEY_VALUE_WEAK ? "key-or-value" :
- "you-d-better-not-see-this"));
- write_c_string(buf, printcharfun);
+ write_fmt_str(printcharfun, " weakness %s",
+ (ht->weakness == HASH_TABLE_WEAK ? "key-and-value" :
+ ht->weakness == HASH_TABLE_KEY_WEAK ? "key" :
+ ht->weakness == HASH_TABLE_VALUE_WEAK ? "value" :
+ ht->weakness ==
+ HASH_TABLE_KEY_VALUE_WEAK ? "key-or-value" :
+ "you-d-better-not-see-this"));
}
if (ht->count)
if (print_readably)
write_c_string(")", printcharfun);
- else {
- sprintf(buf, " 0x%x>", ht->header.uid);
- write_c_string(buf, printcharfun);
- }
+ else
+ write_fmt_str(printcharfun, " 0x%x>", ht->header.uid);
}
static void finalize_hash_table(void *header, int for_disksave)
remhash_1(ht, entries, e);
if (!HENTRY_CLEAR_P(e)) {
goto again;
-
+
}
}
}