From: ceriel Date: Mon, 24 Jun 1991 16:35:08 +0000 (+0000) Subject: some more statistics X-Git-Tag: release-5-5~1100 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=55d80202924d9f9ecee183c83d2327c5124be253;p=ack.git some more statistics --- 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 *