5 #include <openssl/sha.h>
9 typedef void (*configfn
)(const char *name
, const char *value
);
18 extern const char cgit_version
[];
20 extern char *cgit_root
;
21 extern char *cgit_root_title
;
22 extern char *cgit_css
;
23 extern char *cgit_logo
;
24 extern char *cgit_logo_link
;
25 extern char *cgit_virtual_root
;
26 extern char *cgit_cache_root
;
28 extern int cgit_max_lock_attempts
;
29 extern int cgit_cache_root_ttl
;
30 extern int cgit_cache_repo_ttl
;
31 extern int cgit_cache_dynamic_ttl
;
32 extern int cgit_cache_static_ttl
;
33 extern int cgit_cache_max_create_time
;
35 extern char *cgit_repo_name
;
36 extern char *cgit_repo_desc
;
37 extern char *cgit_repo_owner
;
39 extern int cgit_query_has_symref
;
40 extern int cgit_query_has_sha1
;
42 extern char *cgit_querystring
;
43 extern char *cgit_query_repo
;
44 extern char *cgit_query_page
;
45 extern char *cgit_query_head
;
46 extern char *cgit_query_sha1
;
50 extern void cgit_global_config_cb(const char *name
, const char *value
);
51 extern void cgit_repo_config_cb(const char *name
, const char *value
);
52 extern void cgit_querystring_cb(const char *name
, const char *value
);
54 extern char *fmt(const char *format
,...);
56 extern void html(const char *txt
);
57 extern void htmlf(const char *format
,...);
58 extern void html_txt(char *txt
);
59 extern void html_attr(char *txt
);
60 extern void html_link_open(char *url
, char *title
, char *class);
61 extern void html_link_close(void);
63 extern int cgit_read_config(const char *filename
, configfn fn
);
64 extern int cgit_parse_query(char *txt
, configfn fn
);
66 extern void cache_prepare(struct cacheitem
*item
);
67 extern int cache_lock(struct cacheitem
*item
);
68 extern int cache_unlock(struct cacheitem
*item
);
69 extern int cache_cancel_lock(struct cacheitem
*item
);
70 extern int cache_exist(struct cacheitem
*item
);
71 extern int cache_expired(struct cacheitem
*item
);
73 extern char *cgit_repourl(const char *reponame
);
74 extern char *cgit_pageurl(const char *reponame
, const char *pagename
,
77 extern void cgit_print_error(char *msg
);
78 extern void cgit_print_docstart(char *title
, struct cacheitem
*item
);
79 extern void cgit_print_docend();
80 extern void cgit_print_pageheader(char *title
);
82 extern void cgit_print_repolist(struct cacheitem
*item
);
83 extern void cgit_print_summary();
84 extern void cgit_print_log(const char *tip
, int ofs
, int cnt
);
85 extern void cgit_print_view(char *hex
);