diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-08-13 21:25:09 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-08-13 21:25:09 +0000 |
commit | 4f0a5e7572a4257894b4bfede42c26d65152609e (patch) | |
tree | 21e3d5ee20716739590e5931859a4c2052161395 /avahi-core/cache.h | |
parent | d6d7d3769441b73ffb5b7af34fef823b41e66312 (diff) |
* strip glib from avahi-core
* implement glib memory allocator
* add new documentation file MALLOC
* initialize pseudo-RNG from /dev/urandom in avahi-daemon
* remove some gcc 4.0 warnings
* beef up watch system with real timeouts
* move GCC __attribute__ macros into its own header avahi-common/gccmacro.h
* make use of GCC's sentinel attribute where it make sense
* add malloc() implementations that abort on OOM and enable them by default
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@308 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/cache.h')
-rw-r--r-- | avahi-core/cache.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/avahi-core/cache.h b/avahi-core/cache.h index 2f4caa6..fa723e9 100644 --- a/avahi-core/cache.h +++ b/avahi-core/cache.h @@ -22,14 +22,13 @@ USA. ***/ -#include <glib.h> - typedef struct AvahiCache AvahiCache; #include <avahi-common/llist.h> #include "prioq.h" #include "server.h" #include "timeeventq.h" +#include "hashmap.h" typedef enum { AVAHI_CACHE_VALID, @@ -46,7 +45,7 @@ struct AvahiCacheEntry { AvahiRecord *record; struct timeval timestamp; struct timeval expiry; - gboolean cache_flush; + int cache_flush; AvahiAddress origin; @@ -62,11 +61,11 @@ struct AvahiCache { AvahiInterface *interface; - GHashTable *hash_table; + AvahiHashmap *hashmap; AVAHI_LLIST_HEAD(AvahiCacheEntry, entries); - guint n_entries; + unsigned n_entries; }; AvahiCache *avahi_cache_new(AvahiServer *server, AvahiInterface *interface); @@ -75,14 +74,14 @@ void avahi_cache_free(AvahiCache *c); AvahiCacheEntry *avahi_cache_lookup_key(AvahiCache *c, AvahiKey *k); AvahiCacheEntry *avahi_cache_lookup_record(AvahiCache *c, AvahiRecord *r); -void avahi_cache_update(AvahiCache *c, AvahiRecord *r, gboolean cache_flush, const AvahiAddress *a); +void avahi_cache_update(AvahiCache *c, AvahiRecord *r, int cache_flush, const AvahiAddress *a); -void avahi_cache_dump(AvahiCache *c, AvahiDumpCallback callback, gpointer userdata); +int avahi_cache_dump(AvahiCache *c, AvahiDumpCallback callback, void* userdata); -typedef gpointer AvahiCacheWalkCallback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, gpointer userdata); -gpointer avahi_cache_walk(AvahiCache *c, AvahiKey *pattern, AvahiCacheWalkCallback cb, gpointer userdata); +typedef void* AvahiCacheWalkCallback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, void* userdata); +void* avahi_cache_walk(AvahiCache *c, AvahiKey *pattern, AvahiCacheWalkCallback cb, void* userdata); -gboolean avahi_cache_entry_half_ttl(AvahiCache *c, AvahiCacheEntry *e); +int avahi_cache_entry_half_ttl(AvahiCache *c, AvahiCacheEntry *e); void avahi_cache_flush(AvahiCache *c); |