summaryrefslogtreecommitdiffabout
path: root/cgit.h
Unidiff
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/cgit.h b/cgit.h
index 5b7ee1c..8ab8e07 100644
--- a/cgit.h
+++ b/cgit.h
@@ -153,52 +153,62 @@ struct cgit_config {
153 char *robots; 153 char *robots;
154 char *root_title; 154 char *root_title;
155 char *script_name; 155 char *script_name;
156 char *virtual_root; 156 char *virtual_root;
157 int cache_dynamic_ttl; 157 int cache_dynamic_ttl;
158 int cache_max_create_time; 158 int cache_max_create_time;
159 int cache_repo_ttl; 159 int cache_repo_ttl;
160 int cache_root_ttl; 160 int cache_root_ttl;
161 int cache_static_ttl; 161 int cache_static_ttl;
162 int enable_index_links; 162 int enable_index_links;
163 int enable_log_filecount; 163 int enable_log_filecount;
164 int enable_log_linecount; 164 int enable_log_linecount;
165 int max_commit_count; 165 int max_commit_count;
166 int max_lock_attempts; 166 int max_lock_attempts;
167 int max_msg_len; 167 int max_msg_len;
168 int max_repodesc_len; 168 int max_repodesc_len;
169 int nocache; 169 int nocache;
170 int renamelimit; 170 int renamelimit;
171 int snapshots; 171 int snapshots;
172 int summary_branches; 172 int summary_branches;
173 int summary_log; 173 int summary_log;
174 int summary_tags; 174 int summary_tags;
175}; 175};
176 176
177struct cgit_page {
178 time_t modified;
179 time_t expires;
180 char *mimetype;
181 char *charset;
182 char *filename;
183 char *title;
184};
185
177struct cgit_context { 186struct cgit_context {
178 struct cgit_query qry; 187 struct cgit_query qry;
179 struct cgit_config cfg; 188 struct cgit_config cfg;
180 struct cgit_repo *repo; 189 struct cgit_repo *repo;
190 struct cgit_page page;
181}; 191};
182 192
183extern const char *cgit_version; 193extern const char *cgit_version;
184 194
185extern struct cgit_repolist cgit_repolist; 195extern struct cgit_repolist cgit_repolist;
186extern struct cgit_context ctx; 196extern struct cgit_context ctx;
187extern int cgit_cmd; 197extern int cgit_cmd;
188 198
189extern void cgit_prepare_context(struct cgit_context *ctx); 199extern void cgit_prepare_context(struct cgit_context *ctx);
190extern int cgit_get_cmd_index(const char *cmd); 200extern int cgit_get_cmd_index(const char *cmd);
191extern struct cgit_repo *cgit_get_repoinfo(const char *url); 201extern struct cgit_repo *cgit_get_repoinfo(const char *url);
192extern void cgit_global_config_cb(const char *name, const char *value); 202extern void cgit_global_config_cb(const char *name, const char *value);
193extern void cgit_repo_config_cb(const char *name, const char *value); 203extern void cgit_repo_config_cb(const char *name, const char *value);
194extern void cgit_querystring_cb(const char *name, const char *value); 204extern void cgit_querystring_cb(const char *name, const char *value);
195 205
196extern int chk_zero(int result, char *msg); 206extern int chk_zero(int result, char *msg);
197extern int chk_positive(int result, char *msg); 207extern int chk_positive(int result, char *msg);
198extern int chk_non_negative(int result, char *msg); 208extern int chk_non_negative(int result, char *msg);
199 209
200extern int hextoint(char c); 210extern int hextoint(char c);
201extern char *trim_end(const char *str, char c); 211extern char *trim_end(const char *str, char c);
202extern char *strlpart(char *txt, int maxlen); 212extern char *strlpart(char *txt, int maxlen);
203extern char *strrpart(char *txt, int maxlen); 213extern char *strrpart(char *txt, int maxlen);
204 214
@@ -239,53 +249,51 @@ extern char *cgit_fileurl(const char *reponame, const char *pagename,
239extern char *cgit_pageurl(const char *reponame, const char *pagename, 249extern char *cgit_pageurl(const char *reponame, const char *pagename,
240 const char *query); 250 const char *query);
241 251
242extern const char *cgit_repobasename(const char *reponame); 252extern const char *cgit_repobasename(const char *reponame);
243 253
244extern void cgit_tree_link(char *name, char *title, char *class, char *head, 254extern void cgit_tree_link(char *name, char *title, char *class, char *head,
245 char *rev, char *path); 255 char *rev, char *path);
246extern void cgit_log_link(char *name, char *title, char *class, char *head, 256extern void cgit_log_link(char *name, char *title, char *class, char *head,
247 char *rev, char *path, int ofs, char *grep, 257 char *rev, char *path, int ofs, char *grep,
248 char *pattern); 258 char *pattern);
249extern void cgit_commit_link(char *name, char *title, char *class, char *head, 259extern void cgit_commit_link(char *name, char *title, char *class, char *head,
250 char *rev); 260 char *rev);
251extern void cgit_refs_link(char *name, char *title, char *class, char *head, 261extern void cgit_refs_link(char *name, char *title, char *class, char *head,
252 char *rev, char *path); 262 char *rev, char *path);
253extern void cgit_snapshot_link(char *name, char *title, char *class, 263extern void cgit_snapshot_link(char *name, char *title, char *class,
254 char *head, char *rev, char *archivename); 264 char *head, char *rev, char *archivename);
255extern void cgit_diff_link(char *name, char *title, char *class, char *head, 265extern void cgit_diff_link(char *name, char *title, char *class, char *head,
256 char *new_rev, char *old_rev, char *path); 266 char *new_rev, char *old_rev, char *path);
257 267
258extern void cgit_object_link(struct object *obj); 268extern void cgit_object_link(struct object *obj);
259 269
260extern void cgit_print_error(char *msg); 270extern void cgit_print_error(char *msg);
261extern void cgit_print_date(time_t secs, char *format); 271extern void cgit_print_date(time_t secs, char *format);
262extern void cgit_print_age(time_t t, time_t max_relative, char *format); 272extern void cgit_print_age(time_t t, time_t max_relative, char *format);
263extern void cgit_print_docstart(char *title, struct cacheitem *item); 273extern void cgit_print_http_headers(struct cgit_context *ctx);
274extern void cgit_print_docstart(struct cgit_context *ctx);
264extern void cgit_print_docend(); 275extern void cgit_print_docend();
265extern void cgit_print_pageheader(char *title, int show_search); 276extern void cgit_print_pageheader(struct cgit_context *ctx);
266extern void cgit_print_snapshot_start(const char *mimetype,
267 const char *filename,
268 struct cacheitem *item);
269extern void cgit_print_filemode(unsigned short mode); 277extern void cgit_print_filemode(unsigned short mode);
270extern void cgit_print_branches(int maxcount); 278extern void cgit_print_branches(int maxcount);
271extern void cgit_print_tags(int maxcount); 279extern void cgit_print_tags(int maxcount);
272 280
273extern void cgit_print_repolist(struct cacheitem *item); 281extern void cgit_print_repolist(struct cacheitem *item);
274extern void cgit_print_summary(); 282extern void cgit_print_summary();
275extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, 283extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep,
276 char *pattern, char *path, int pager); 284 char *pattern, char *path, int pager);
277extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); 285extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path);
278extern void cgit_print_tree(const char *rev, char *path); 286extern void cgit_print_tree(const char *rev, char *path);
279extern void cgit_print_commit(char *hex); 287extern void cgit_print_commit(char *hex);
280extern void cgit_print_refs(); 288extern void cgit_print_refs();
281extern void cgit_print_tag(char *revname); 289extern void cgit_print_tag(char *revname);
282extern void cgit_print_diff(const char *new_hex, const char *old_hex, const char *prefix); 290extern void cgit_print_diff(const char *new_hex, const char *old_hex, const char *prefix);
283extern void cgit_print_patch(char *hex, struct cacheitem *item); 291extern void cgit_print_patch(char *hex, struct cacheitem *item);
284extern void cgit_print_snapshot(struct cacheitem *item, const char *head, 292extern void cgit_print_snapshot(struct cacheitem *item, const char *head,
285 const char *hex, const char *prefix, 293 const char *hex, const char *prefix,
286 const char *filename, int snapshot); 294 const char *filename, int snapshot);
287extern void cgit_print_snapshot_links(const char *repo, const char *head, 295extern void cgit_print_snapshot_links(const char *repo, const char *head,
288 const char *hex, int snapshots); 296 const char *hex, int snapshots);
289extern int cgit_parse_snapshots_mask(const char *str); 297extern int cgit_parse_snapshots_mask(const char *str);
290 298
291#endif /* CGIT_H */ 299#endif /* CGIT_H */