summaryrefslogtreecommitdiffabout
path: root/cgit.h
authorLars Hjemli <hjemli@gmail.com>2006-12-15 17:17:36 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2006-12-15 17:17:36 (UTC)
commit2101e26fd68f816e77de62b93df4c32fd1110d0c (patch) (unidiff)
treed70d28734c4fbfd0a4e4a40bcfd445eb50dc1666 /cgit.h
parent420712ac2531f65a2b94d5ec6d8e03de6942331e (diff)
downloadcgit-2101e26fd68f816e77de62b93df4c32fd1110d0c.zip
cgit-2101e26fd68f816e77de62b93df4c32fd1110d0c.tar.gz
cgit-2101e26fd68f816e77de62b93df4c32fd1110d0c.tar.bz2
Add a common commit parser
Make a better commit parser, replacing the ugly one in ui-log.c Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index 82e8681..268db53 100644
--- a/cgit.h
+++ b/cgit.h
@@ -6,24 +6,32 @@
6#include <ctype.h> 6#include <ctype.h>
7#include <sched.h> 7#include <sched.h>
8 8
9typedef void (*configfn)(const char *name, const char *value); 9typedef void (*configfn)(const char *name, const char *value);
10 10
11struct cacheitem { 11struct cacheitem {
12 char *name; 12 char *name;
13 struct stat st; 13 struct stat st;
14 int ttl; 14 int ttl;
15 int fd; 15 int fd;
16}; 16};
17 17
18struct commitinfo {
19 struct commit *commit;
20 char *author;
21 char *committer;
22 char *subject;
23 char *msg;
24};
25
18extern const char cgit_version[]; 26extern const char cgit_version[];
19 27
20extern char *cgit_root; 28extern char *cgit_root;
21extern char *cgit_root_title; 29extern char *cgit_root_title;
22extern char *cgit_css; 30extern char *cgit_css;
23extern char *cgit_logo; 31extern char *cgit_logo;
24extern char *cgit_logo_link; 32extern char *cgit_logo_link;
25extern char *cgit_virtual_root; 33extern char *cgit_virtual_root;
26extern char *cgit_cache_root; 34extern char *cgit_cache_root;
27 35
28extern int cgit_max_lock_attempts; 36extern int cgit_max_lock_attempts;
29extern int cgit_cache_root_ttl; 37extern int cgit_cache_root_ttl;
@@ -54,24 +62,25 @@ extern void cgit_querystring_cb(const char *name, const char *value);
54 62
55extern char *fmt(const char *format,...); 63extern char *fmt(const char *format,...);
56 64
57extern void html(const char *txt); 65extern void html(const char *txt);
58extern void htmlf(const char *format,...); 66extern void htmlf(const char *format,...);
59extern void html_txt(char *txt); 67extern void html_txt(char *txt);
60extern void html_attr(char *txt); 68extern void html_attr(char *txt);
61extern void html_link_open(char *url, char *title, char *class); 69extern void html_link_open(char *url, char *title, char *class);
62extern void html_link_close(void); 70extern void html_link_close(void);
63 71
64extern int cgit_read_config(const char *filename, configfn fn); 72extern int cgit_read_config(const char *filename, configfn fn);
65extern int cgit_parse_query(char *txt, configfn fn); 73extern int cgit_parse_query(char *txt, configfn fn);
74extern struct commitinfo *cgit_parse_commit(struct commit *commit);
66 75
67extern void cache_prepare(struct cacheitem *item); 76extern void cache_prepare(struct cacheitem *item);
68extern int cache_lock(struct cacheitem *item); 77extern int cache_lock(struct cacheitem *item);
69extern int cache_unlock(struct cacheitem *item); 78extern int cache_unlock(struct cacheitem *item);
70extern int cache_cancel_lock(struct cacheitem *item); 79extern int cache_cancel_lock(struct cacheitem *item);
71extern int cache_exist(struct cacheitem *item); 80extern int cache_exist(struct cacheitem *item);
72extern int cache_expired(struct cacheitem *item); 81extern int cache_expired(struct cacheitem *item);
73 82
74extern char *cgit_repourl(const char *reponame); 83extern char *cgit_repourl(const char *reponame);
75extern char *cgit_pageurl(const char *reponame, const char *pagename, 84extern char *cgit_pageurl(const char *reponame, const char *pagename,
76 const char *query); 85 const char *query);
77 86