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
@@ -1,89 +1,98 @@
1#ifndef CGIT_H 1#ifndef CGIT_H
2#define CGIT_H 2#define CGIT_H
3 3
4#include "git.h" 4#include "git.h"
5#include <openssl/sha.h> 5#include <openssl/sha.h>
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;
30extern int cgit_cache_repo_ttl; 38extern int cgit_cache_repo_ttl;
31extern int cgit_cache_dynamic_ttl; 39extern int cgit_cache_dynamic_ttl;
32extern int cgit_cache_static_ttl; 40extern int cgit_cache_static_ttl;
33extern int cgit_cache_max_create_time; 41extern int cgit_cache_max_create_time;
34 42
35extern char *cgit_repo_name; 43extern char *cgit_repo_name;
36extern char *cgit_repo_desc; 44extern char *cgit_repo_desc;
37extern char *cgit_repo_owner; 45extern char *cgit_repo_owner;
38 46
39extern int cgit_query_has_symref; 47extern int cgit_query_has_symref;
40extern int cgit_query_has_sha1; 48extern int cgit_query_has_sha1;
41 49
42extern char *cgit_querystring; 50extern char *cgit_querystring;
43extern char *cgit_query_repo; 51extern char *cgit_query_repo;
44extern char *cgit_query_page; 52extern char *cgit_query_page;
45extern char *cgit_query_head; 53extern char *cgit_query_head;
46extern char *cgit_query_sha1; 54extern char *cgit_query_sha1;
47extern int cgit_query_ofs; 55extern int cgit_query_ofs;
48 56
49extern int htmlfd; 57extern int htmlfd;
50 58
51extern void cgit_global_config_cb(const char *name, const char *value); 59extern void cgit_global_config_cb(const char *name, const char *value);
52extern void cgit_repo_config_cb(const char *name, const char *value); 60extern void cgit_repo_config_cb(const char *name, const char *value);
53extern void cgit_querystring_cb(const char *name, const char *value); 61extern 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
78extern void cgit_print_error(char *msg); 87extern void cgit_print_error(char *msg);
79extern void cgit_print_docstart(char *title, struct cacheitem *item); 88extern void cgit_print_docstart(char *title, struct cacheitem *item);
80extern void cgit_print_docend(); 89extern void cgit_print_docend();
81extern void cgit_print_pageheader(char *title); 90extern void cgit_print_pageheader(char *title);
82 91
83extern void cgit_print_repolist(struct cacheitem *item); 92extern void cgit_print_repolist(struct cacheitem *item);
84extern void cgit_print_summary(); 93extern void cgit_print_summary();
85extern void cgit_print_log(const char *tip, int ofs, int cnt); 94extern void cgit_print_log(const char *tip, int ofs, int cnt);
86extern void cgit_print_view(char *hex); 95extern void cgit_print_view(char *hex);
87extern void cgit_print_tree(const char *sha1); 96extern void cgit_print_tree(const char *sha1);
88 97
89#endif /* CGIT_H */ 98#endif /* CGIT_H */