#ifndef FileCache_Header
#define FileCache_Header

struct fcache;
typedef struct fcache FCache;

/* initializes the structure */
FCache *fcache_init(int hashsize, int max_items);

/* free's the structure and all entries via the cb (optional) */
void fcache_free(FCache **f);

/* Adds an entry 'filename' to the cache, storing 'data' for retrieval later */
int fcache_add(FCache *f, char *filename, void *data, void (*freefn)(void **));

/* Removes an entry 'filename', returns the 'data' stored for that entry 
(so it may be free'd if required) */
int fcache_rmv(FCache *f, char *filename);

/* Retrieves an entry 'filename', returns the 'data' stored for that entry */
void *fcache_get(FCache *f, char *filename);

#endif
