summaryrefslogtreecommitdiffstatshomepage
path: root/shared.c
/*
 * Since git has it's own cache.h which we include,
 * lets test on CGIT_CACHE_H to avoid confusion
 */

#ifndef CGIT_CACHE_H
#define CGIT_CACHE_H

typedef void (*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
 */
extern int cache_process(int size, const char *path, const char *key, int ttl,
			 cache_fill_fn fn, void *cbdata);


/* List info about all cache entries on stdout */
extern int cache_ls(const char *path);

/* Print a message to stdout */
__attribute__((format (printf,1,2)))
extern void cache_log(const char *format, ...);

extern unsigned long hash_str(const char *str);

#endif /* CGIT_CACHE_H */
Commit message (Expand)AuthorAge
* Move cgit_parse_query() from parsing.c to html.c as http_parse_querystring()Lars Hjemli2008-04-08
* Move cgit_version from shared.c to cgit.cLars Hjemli2008-03-24
* Move non-generic functions from shared.c to cgit.cLars Hjemli2008-03-24
* Refactor snapshot supportLars Hjemli2008-03-24
mli2007-07-22 |/ * Merge branch 'lh/menu'Lars Hjemli2007-06-29 |\ | * Add trim_end() and use it to remove trailing slashes from repo pathsLars Hjemli2007-06-26 | * Add setting to enable/disable extra links on index pageLars Hjemli2007-06-19 * | Add version info from git-describeLars Hjemli2007-06-18 |/ * Add cgit_diff_link()Lars Hjemli2007-06-17 * ui-tree: unify with ui-view, use path to select tree/blobLars Hjemli2007-06-16 * Implemented configurable HEAD shortlog on summary page.Ondrej Jirman2007-05-31 * Add repo.readme parameterLars Hjemli2007-05-23 * Show time since last change on index pageLars Hjemli2007-05-22 * Merge branch 'repogroups'Lars Hjemli2007-05-20 |\ | * Teach cgit how to group repositories by categoryLars Hjemli2007-05-18 * | Merge branch 'virtual-url'Lars Hjemli2007-05-20 |\ \ | * | Enable url=value querystring parameterLars Hjemli2007-05-18 | * | Add lookup-function for valid repo commandsLars Hjemli2007-05-18