From 55d80202924d9f9ecee183c83d2327c5124be253 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 24 Jun 1991 16:35:08 +0000 Subject: [PATCH] some more statistics --- modules/src/idf/idf_pkg.body | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/modules/src/idf/idf_pkg.body b/modules/src/idf/idf_pkg.body index 4daa4ff91..05294ea8c 100644 --- a/modules/src/idf/idf_pkg.body +++ b/modules/src/idf/idf_pkg.body @@ -63,20 +63,41 @@ IDF_new(tg, size, cpy) hash_stat() { register int i; + int total_count = 0; print("Hash table tally:\n"); for (i = 0; i < IDF_HASHSIZE; i++) { register struct idf *notch = IDF_hashtable[i]; register int cnt = 0; + print ("%d ", i); while (notch) { cnt++; + print("'%s' ", notch->id_text); notch = notch->id_next; } - print("%d %d\n", i, cnt); + print("%d\n", cnt); + total_count += cnt; } + print("total = %d\n", total_count); print("End hash table tally\n"); } + +idfappfun(fun, opt) + int (*fun)(); + int opt; +{ + register int i; + + for (i = 0; i < IDF_HASHSIZE; i++) { + register struct idf *notch = IDF_hashtable[i]; + + while (notch) { + (*fun)(notch, opt); + notch = notch->id_next; + } + } +} #endif IDF_DEBUG struct idf * -- 2.34.1