5 #include <openssl/sha.h>
9 typedef void (*configfn
)(const char *name
, const char *value
);
19 struct commit
*commit
;
22 unsigned long author_date
;
24 char *committer_email
;
25 unsigned long committer_date
;
30 extern const char cgit_version
[];
32 extern char *cgit_root
;
33 extern char *cgit_root_title
;
34 extern char *cgit_css
;
35 extern char *cgit_logo
;
36 extern char *cgit_logo_link
;
37 extern char *cgit_virtual_root
;
38 extern char *cgit_cache_root
;
40 extern int cgit_nocache
;
41 extern int cgit_max_lock_attempts
;
42 extern int cgit_cache_root_ttl
;
43 extern int cgit_cache_repo_ttl
;
44 extern int cgit_cache_dynamic_ttl
;
45 extern int cgit_cache_static_ttl
;
46 extern int cgit_cache_max_create_time
;
48 extern char *cgit_repo_name
;
49 extern char *cgit_repo_desc
;
50 extern char *cgit_repo_owner
;
52 extern int cgit_query_has_symref
;
53 extern int cgit_query_has_sha1
;
55 extern char *cgit_querystring
;
56 extern char *cgit_query_repo
;
57 extern char *cgit_query_page
;
58 extern char *cgit_query_head
;
59 extern char *cgit_query_sha1
;
60 extern int cgit_query_ofs
;
64 extern void cgit_global_config_cb(const char *name
, const char *value
);
65 extern void cgit_repo_config_cb(const char *name
, const char *value
);
66 extern void cgit_querystring_cb(const char *name
, const char *value
);
68 extern void *cgit_free_commitinfo(struct commitinfo
*info
);
70 extern char *fmt(const char *format
,...);
72 extern void html(const char *txt
);
73 extern void htmlf(const char *format
,...);
74 extern void html_txt(char *txt
);
75 extern void html_attr(char *txt
);
76 extern void html_link_open(char *url
, char *title
, char *class);
77 extern void html_link_close(void);
79 extern int cgit_read_config(const char *filename
, configfn fn
);
80 extern int cgit_parse_query(char *txt
, configfn fn
);
81 extern struct commitinfo
*cgit_parse_commit(struct commit
*commit
);
83 extern void cache_prepare(struct cacheitem
*item
);
84 extern int cache_lock(struct cacheitem
*item
);
85 extern int cache_unlock(struct cacheitem
*item
);
86 extern int cache_cancel_lock(struct cacheitem
*item
);
87 extern int cache_exist(struct cacheitem
*item
);
88 extern int cache_expired(struct cacheitem
*item
);
90 extern char *cgit_repourl(const char *reponame
);
91 extern char *cgit_pageurl(const char *reponame
, const char *pagename
,
94 extern void cgit_print_error(char *msg
);
95 extern void cgit_print_date(unsigned long secs
);
96 extern void cgit_print_docstart(char *title
, struct cacheitem
*item
);
97 extern void cgit_print_docend();
98 extern void cgit_print_pageheader(char *title
);
100 extern void cgit_print_repolist(struct cacheitem
*item
);
101 extern void cgit_print_summary();
102 extern void cgit_print_log(const char *tip
, int ofs
, int cnt
);
103 extern void cgit_print_view(const char *hex
);
104 extern void cgit_print_tree(const char *hex
);
105 extern void cgit_print_commit(const char *hex
);