X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fqache.h;h=48a9e31c10bc8808860ce4d0a76acfbe46a6d8dd;hb=5e52d50a1ae65de7545213b433e06e993e2d24bf;hp=4a253d1532f9085afd01532359ca45b8ab24cd80;hpb=ff935b2de2eee5512798b44f0cb52e3e72398d68;p=libucw.git diff --git a/lib/qache.h b/lib/qache.h index 4a253d15..48a9e31c 100644 --- a/lib/qache.h +++ b/lib/qache.h @@ -26,7 +26,7 @@ void qache_close(struct qache *q, uns retain_data); /* Insert new item to the cache with a given key and data. If pos_hint is non-zero, it serves * as a hint about the position of the entry (if it's known that an entry with the particular key - * was located there a moment ago. Returns position of the new entry. + * was located there a moment ago). Returns position of the new entry. */ uns qache_insert(struct qache *q, qache_key_t *key, uns pos_hint, void *data, uns size); @@ -39,6 +39,12 @@ uns qache_insert(struct qache *q, qache_key_t *key, uns pos_hint, void *data, un */ uns qache_lookup(struct qache *q, qache_key_t *key, uns pos_hint, byte **datap, uns *sizep, uns start); +/* Inspect data in the cache (but don't modify LRU nor anything else), given a position. + * If key is non-NULL, it's filled with the cache key. The rest works as in qache_lookup. + * Returns 0 if the entry is empty, ~0 for position out of range, entry number otherwise. + */ +uns qache_probe(struct qache *q, qache_key_t *key, uns pos, byte **datap, uns *sizep, uns start); + /* Delete data from the cache, given a key and a position hint. */ uns qache_delete(struct qache *q, qache_key_t *key, uns pos_hint);