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
;
37 extern const char cgit_version
[];
39 extern char *cgit_root
;
40 extern char *cgit_root_title
;
41 extern char *cgit_css
;
42 extern char *cgit_logo
;
43 extern char *cgit_logo_link
;
44 extern char *cgit_virtual_root
;
45 extern char *cgit_cache_root
;
47 extern int cgit_nocache
;
48 extern int cgit_max_lock_attempts
;
49 extern int cgit_cache_root_ttl
;
50 extern int cgit_cache_repo_ttl
;
51 extern int cgit_cache_dynamic_ttl
;
52 extern int cgit_cache_static_ttl
;
53 extern int cgit_cache_max_create_time
;
55 extern char *cgit_repo_name
;
56 extern char *cgit_repo_desc
;
57 extern char *cgit_repo_owner
;
59 extern int cgit_query_has_symref
;
60 extern int cgit_query_has_sha1
;
62 extern char *cgit_querystring
;
63 extern char *cgit_query_repo
;
64 extern char *cgit_query_page
;
65 extern char *cgit_query_search
;
66 extern char *cgit_query_head
;
67 extern char *cgit_query_sha1
;
68 extern char *cgit_query_sha2
;
69 extern char *cgit_query_path
;
70 extern int cgit_query_ofs
;
74 extern void cgit_global_config_cb(const char *name
, const char *value
);
75 extern void cgit_repo_config_cb(const char *name
, const char *value
);
76 extern void cgit_querystring_cb(const char *name
, const char *value
);
78 extern int hextoint(char c
);
80 extern void *cgit_free_commitinfo(struct commitinfo
*info
);
82 extern char *fmt(const char *format
,...);
84 extern void html(const char *txt
);
85 extern void htmlf(const char *format
,...);
86 extern void html_txt(char *txt
);
87 extern void html_ntxt(int len
, char *txt
);
88 extern void html_attr(char *txt
);
89 extern void html_hidden(char *name
, char *value
);
90 extern void html_link_open(char *url
, char *title
, char *class);
91 extern void html_link_close(void);
92 extern void html_filemode(unsigned short mode
);
94 extern int cgit_read_config(const char *filename
, configfn fn
);
95 extern int cgit_parse_query(char *txt
, configfn fn
);
96 extern struct commitinfo
*cgit_parse_commit(struct commit
*commit
);
97 extern struct taginfo
*cgit_parse_tag(struct tag
*tag
);
99 extern char *cache_safe_filename(const char *unsafe
);
100 extern int cache_lock(struct cacheitem
*item
);
101 extern int cache_unlock(struct cacheitem
*item
);
102 extern int cache_cancel_lock(struct cacheitem
*item
);
103 extern int cache_exist(struct cacheitem
*item
);
104 extern int cache_expired(struct cacheitem
*item
);
106 extern char *cgit_repourl(const char *reponame
);
107 extern char *cgit_pageurl(const char *reponame
, const char *pagename
,
110 extern void cgit_print_error(char *msg
);
111 extern void cgit_print_date(unsigned long secs
);
112 extern void cgit_print_docstart(char *title
, struct cacheitem
*item
);
113 extern void cgit_print_docend();
114 extern void cgit_print_pageheader(char *title
, int show_search
);
116 extern void cgit_print_repolist(struct cacheitem
*item
);
117 extern void cgit_print_summary();
118 extern void cgit_print_log(const char *tip
, int ofs
, int cnt
, char *grep
);
119 extern void cgit_print_view(const char *hex
);
120 extern void cgit_print_tree(const char *hex
, char *path
);
121 extern void cgit_print_commit(const char *hex
);
122 extern void cgit_print_diff(const char *old_hex
, const char *new_hex
);