summaryrefslogtreecommitdiffabout
path: root/cgit.h
Unidiff
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/cgit.h b/cgit.h
index 8927236..4da2d3d 100644
--- a/cgit.h
+++ b/cgit.h
@@ -24,16 +24,35 @@
24#define CMD_LOG 1 24#define CMD_LOG 1
25#define CMD_COMMIT 2 25#define CMD_COMMIT 2
26#define CMD_DIFF 3 26#define CMD_DIFF 3
27#define CMD_TREE 4 27#define CMD_TREE 4
28#define CMD_VIEW 5 28#define CMD_VIEW 5
29#define CMD_BLOB 6 29#define CMD_BLOB 6
30#define CMD_SNAPSHOT 7 30#define CMD_SNAPSHOT 7
31 31
32
33/*
34 * Dateformats used on misc. pages
35 */
36#define FMT_LONGDATE "%Y-%m-%d %H:%M:%S"
37#define FMT_SHORTDATE "%Y-%m-%d"
38
39
40/*
41 * Limits used for relative dates
42 */
43#define TM_MIN 60
44#define TM_HOUR (TM_MIN * 60)
45#define TM_DAY (TM_HOUR * 24)
46#define TM_WEEK (TM_DAY * 7)
47#define TM_YEAR (TM_DAY * 365)
48#define TM_MONTH (TM_YEAR / 12.0)
49
50
32typedef void (*configfn)(const char *name, const char *value); 51typedef void (*configfn)(const char *name, const char *value);
33typedef void (*filepair_fn)(struct diff_filepair *pair); 52typedef void (*filepair_fn)(struct diff_filepair *pair);
34typedef void (*linediff_fn)(char *line, int len); 53typedef void (*linediff_fn)(char *line, int len);
35 54
36struct cacheitem { 55struct cacheitem {
37 char *name; 56 char *name;
38 struct stat st; 57 struct stat st;
39 int ttl; 58 int ttl;
@@ -176,17 +195,18 @@ extern int cache_cancel_lock(struct cacheitem *item);
176extern int cache_exist(struct cacheitem *item); 195extern int cache_exist(struct cacheitem *item);
177extern int cache_expired(struct cacheitem *item); 196extern int cache_expired(struct cacheitem *item);
178 197
179extern char *cgit_repourl(const char *reponame); 198extern char *cgit_repourl(const char *reponame);
180extern char *cgit_pageurl(const char *reponame, const char *pagename, 199extern char *cgit_pageurl(const char *reponame, const char *pagename,
181 const char *query); 200 const char *query);
182 201
183extern void cgit_print_error(char *msg); 202extern void cgit_print_error(char *msg);
184extern void cgit_print_date(unsigned long secs); 203extern void cgit_print_date(time_t secs, char *format);
204extern void cgit_print_age(time_t t, time_t max_relative, char *format);
185extern void cgit_print_docstart(char *title, struct cacheitem *item); 205extern void cgit_print_docstart(char *title, struct cacheitem *item);
186extern void cgit_print_docend(); 206extern void cgit_print_docend();
187extern void cgit_print_pageheader(char *title, int show_search); 207extern void cgit_print_pageheader(char *title, int show_search);
188extern void cgit_print_snapshot_start(const char *mimetype, 208extern void cgit_print_snapshot_start(const char *mimetype,
189 const char *filename, 209 const char *filename,
190 struct cacheitem *item); 210 struct cacheitem *item);
191 211
192extern void cgit_print_repolist(struct cacheitem *item); 212extern void cgit_print_repolist(struct cacheitem *item);