From f0f4bb0c37eeed71934e3191cffa5afb1cfdca0d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 18 Mar 2005 16:48:19 +0000 Subject: some more inomcplete work git-svn-id: file:///home/lennart/svn/public/avahi/trunk@12 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- cache.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'cache.c') diff --git a/cache.c b/cache.c index 6a0a874..9180570 100644 --- a/cache.c +++ b/cache.c @@ -147,3 +147,26 @@ void flx_cache_drop_record(flxCache *c, flxRecord *r) { if ((e = flx_cache_lookup_record(c, r))) remove_entry(c, e, TRUE); } + +static void func(gpointer key, gpointer data, gpointer userdata) { + flxCacheEntry *e = data; + flxKey *k = key; + + gchar *s, *t; + + s = flx_key_to_string(k); + t = flx_record_to_string(e->record); + + fprintf((FILE*) userdata, "%s %s\n", s, t); + + g_free(s); + g_free(t); +} + +void flx_cache_dump(flxCache *c, FILE *f) { + g_assert(c); + g_assert(f); + + fprintf(f, ";;; CACHE DUMP FOLLOWS ;;;\n"); + g_hash_table_foreach(c->hash_table, func, f); +} -- cgit