|
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 | |
32 | typedef void (*configfn)(const char *name, const char *value); |
51 | typedef void (*configfn)(const char *name, const char *value); |
33 | typedef void (*filepair_fn)(struct diff_filepair *pair); |
52 | typedef void (*filepair_fn)(struct diff_filepair *pair); |
34 | typedef void (*linediff_fn)(char *line, int len); |
53 | typedef void (*linediff_fn)(char *line, int len); |
35 | |
54 | |
36 | struct cacheitem { |
55 | struct 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); |
176 | extern int cache_exist(struct cacheitem *item); |
195 | extern int cache_exist(struct cacheitem *item); |
177 | extern int cache_expired(struct cacheitem *item); |
196 | extern int cache_expired(struct cacheitem *item); |
178 | |
197 | |
179 | extern char *cgit_repourl(const char *reponame); |
198 | extern char *cgit_repourl(const char *reponame); |
180 | extern char *cgit_pageurl(const char *reponame, const char *pagename, |
199 | extern char *cgit_pageurl(const char *reponame, const char *pagename, |
181 | const char *query); |
200 | const char *query); |
182 | |
201 | |
183 | extern void cgit_print_error(char *msg); |
202 | extern void cgit_print_error(char *msg); |
184 | extern void cgit_print_date(unsigned long secs); |
203 | extern void cgit_print_date(time_t secs, char *format); |
| |
204 | extern void cgit_print_age(time_t t, time_t max_relative, char *format); |
185 | extern void cgit_print_docstart(char *title, struct cacheitem *item); |
205 | extern void cgit_print_docstart(char *title, struct cacheitem *item); |
186 | extern void cgit_print_docend(); |
206 | extern void cgit_print_docend(); |
187 | extern void cgit_print_pageheader(char *title, int show_search); |
207 | extern void cgit_print_pageheader(char *title, int show_search); |
188 | extern void cgit_print_snapshot_start(const char *mimetype, |
208 | extern 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 | |
192 | extern void cgit_print_repolist(struct cacheitem *item); |
212 | extern void cgit_print_repolist(struct cacheitem *item); |
|