/*++ /* NAME /* ctable 3 /* SUMMARY /* cache manager /* SYNOPSIS /* #include <ctable.h> /* /* CTABLE *ctable_create(limit, create, delete, context) /* ssize_t limit; /* void *(*create)(const char *key, void *context); /* void (*delete)(void *value, void *context); /* void *context; /* /* const void *ctable_locate(cache, key) /* CTABLE *cache; /* const char *key; /* /* const void *ctable_refresh(cache, key) /* CTABLE *cache; /* const char *key; /* /* const void *ctable_newcontext(cache, context) /* CTABLE *cache; /* void *context; /* /* void ctable_free(cache) /* CTABLE *cache; /* /* void ctable_walk(cache, action) /* CTABLE *cache; /* void (*action)(const char *key, const void *value); /* DESCRIPTION /* This module maintains multiple caches. Cache items are purged /* automatically when the number of items exceeds a configurable /* limit. Caches never shrink. Each cache entry consists of a /* string-valued lookup key and a generic data pointer value. /* /* ctable_create() creates a cache with the specified size limit, and /* returns a pointer to the result. The create and delete arguments /* specify pointers to call-back functions that create a value, given /* a key, and delete a given value, respectively. The context argument /* is passed on to the call-back routines. /* The create() and delete() functions must not modify the cache. /* /* ctable_locate() looks up or generates the value that corresponds to /* the specified key, and returns that value. /* /* ctable_refresh() flushes the value (if any) associated with /* the specified key, and returns the same result as ctable_locate(). /* /* ctable_newcontext() updates the context that is passed on /* to call-back routines. /* /* ctable_free() destroys the specified cache, including its contents. /* /* ctable_walk() iterates over all elements in the cache, and invokes /* the action function for each cache element with the corresponding /* key and value as arguments. This function is useful mainly for /* cache performance debugging. /* Note: the action() function must not modify the cache. /* DIAGNOSTICS /* Fatal errors: out of memory. Panic: interface violation. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.