_CACHE_H
typedefvoid(*cache_fill_fn)(void*cbdata);/* Print cached content to stdout, generate the content if necessary. * * Parameters * size max number of cache files * path directory used to store cache files * key the key used to lookup cache files * ttl max cache time in seconds for this key * fn content generator function for this key * cbdata user-supplied data to the content generator function * * Return value * 0 indicates success, everyting else is an error */externintcache_process(intsize,constchar*path,constchar*key,intttl,cache_fill_fnfn,void*cbdata);/* List info about all cache entries on stdout */externintcache_ls(constchar*path);/* Print a message to stdout */__attribute__((format(printf,1,2)))externvoidcache_log(constchar*format,...);externunsignedlonghash_str(constchar*str);#endif /* CGIT_CACHE_H */