diff options
Diffstat (limited to 'source/cache.h')
| -rw-r--r-- | source/cache.h | 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 6 insertions, 2 deletions
diff --git a/source/cache.h b/source/cache.h index bae283c..d3a7ec4 100644 --- a/source/cache.h +++ b/source/cache.h @@ -7,6 +7,8 @@ #ifndef CGIT_CACHE_H #define CGIT_CACHE_H +#include <stddef.h> + typedef void (*cache_fill_fn)(void); /* @@ -14,10 +16,12 @@ typedef void (*cache_fill_fn)(void); * slot for that key is there and rendering it through fn when it is not. size * is how many slots the cache may use and path is the directory holding them. * ttl is how many minutes a slot for this key stays fresh, where a negative - * ttl never expires and a ttl of zero skips the cache for this request. + * ttl never expires and a ttl of zero skips the cache for this request. A + * page larger than max_bytes is served but not kept, and zero sets no bound. * Returns 0 when the page was written, and an errno value when it was not. */ -extern int cache_process(int size, const char *path, const char *key, int ttl, cache_fill_fn fn); +extern int cache_process(int size, const char *path, const char *key, int ttl, + size_t max_bytes, cache_fill_fn fn); /* * Write one line per cache slot to stdout, giving its path, modification time, |
