diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-03-18 16:48:19 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-03-18 16:48:19 +0000 |
commit | f0f4bb0c37eeed71934e3191cffa5afb1cfdca0d (patch) | |
tree | 154a6321b51c1af31f8633d61dde98968263f280 /cache.c | |
parent | 7bb43bd370e70385a4ccde06f3f4554f488aa6b3 (diff) |
some more inomcplete work
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@12 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'cache.c')
-rw-r--r-- | cache.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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); +} |