summaryrefslogtreecommitdiffabout
path: root/cgit.h
authorLars Hjemli <hjemli@gmail.com>2008-02-23 21:45:33 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-03-18 07:13:10 (UTC)
commitb1f9b9c1459cb9a30ebf80721aff6ef788d1f891 (patch) (unidiff)
tree05796a741faef90c12aadd3a5c92b702ec870c48 /cgit.h
parentb88fb016d0209f7041ac7d3b4d2c077318407a4d (diff)
downloadcgit-b1f9b9c1459cb9a30ebf80721aff6ef788d1f891.zip
cgit-b1f9b9c1459cb9a30ebf80721aff6ef788d1f891.tar.gz
cgit-b1f9b9c1459cb9a30ebf80721aff6ef788d1f891.tar.bz2
Introduce html.h
All html-functions can be quite easily separated from the rest of cgit, so lets do it; the only issue was html_filemode which uses some git-defined macros so the function is moved into ui-shared.c::cgit_print_filemode(). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/cgit.h b/cgit.h
index 598d8c3..5b7ee1c 100644
--- a/cgit.h
+++ b/cgit.h
@@ -173,34 +173,32 @@ struct cgit_config {
173 int summary_log; 173 int summary_log;
174 int summary_tags; 174 int summary_tags;
175}; 175};
176 176
177struct cgit_context { 177struct cgit_context {
178 struct cgit_query qry; 178 struct cgit_query qry;
179 struct cgit_config cfg; 179 struct cgit_config cfg;
180 struct cgit_repo *repo; 180 struct cgit_repo *repo;
181}; 181};
182 182
183extern const char *cgit_version; 183extern const char *cgit_version;
184 184
185extern struct cgit_repolist cgit_repolist; 185extern struct cgit_repolist cgit_repolist;
186extern struct cgit_context ctx; 186extern struct cgit_context ctx;
187extern int cgit_cmd; 187extern int cgit_cmd;
188 188
189extern int htmlfd;
190
191extern void cgit_prepare_context(struct cgit_context *ctx); 189extern void cgit_prepare_context(struct cgit_context *ctx);
192extern int cgit_get_cmd_index(const char *cmd); 190extern int cgit_get_cmd_index(const char *cmd);
193extern struct cgit_repo *cgit_get_repoinfo(const char *url); 191extern struct cgit_repo *cgit_get_repoinfo(const char *url);
194extern void cgit_global_config_cb(const char *name, const char *value); 192extern void cgit_global_config_cb(const char *name, const char *value);
195extern void cgit_repo_config_cb(const char *name, const char *value); 193extern void cgit_repo_config_cb(const char *name, const char *value);
196extern void cgit_querystring_cb(const char *name, const char *value); 194extern void cgit_querystring_cb(const char *name, const char *value);
197 195
198extern int chk_zero(int result, char *msg); 196extern int chk_zero(int result, char *msg);
199extern int chk_positive(int result, char *msg); 197extern int chk_positive(int result, char *msg);
200extern int chk_non_negative(int result, char *msg); 198extern int chk_non_negative(int result, char *msg);
201 199
202extern int hextoint(char c); 200extern int hextoint(char c);
203extern char *trim_end(const char *str, char c); 201extern char *trim_end(const char *str, char c);
204extern char *strlpart(char *txt, int maxlen); 202extern char *strlpart(char *txt, int maxlen);
205extern char *strrpart(char *txt, int maxlen); 203extern char *strrpart(char *txt, int maxlen);
206 204
@@ -209,44 +207,32 @@ extern int cgit_refs_cb(const char *refname, const unsigned char *sha1,
209 int flags, void *cb_data); 207 int flags, void *cb_data);
210 208
211extern void *cgit_free_commitinfo(struct commitinfo *info); 209extern void *cgit_free_commitinfo(struct commitinfo *info);
212 210
213extern int cgit_diff_files(const unsigned char *old_sha1, 211extern int cgit_diff_files(const unsigned char *old_sha1,
214 const unsigned char *new_sha1, 212 const unsigned char *new_sha1,
215 linediff_fn fn); 213 linediff_fn fn);
216 214
217extern void cgit_diff_tree(const unsigned char *old_sha1, 215extern void cgit_diff_tree(const unsigned char *old_sha1,
218 const unsigned char *new_sha1, 216 const unsigned char *new_sha1,
219 filepair_fn fn, const char *prefix); 217 filepair_fn fn, const char *prefix);
220 218
221extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); 219extern void cgit_diff_commit(struct commit *commit, filepair_fn fn);
222 220
223extern char *fmt(const char *format,...); 221extern char *fmt(const char *format,...);
224 222
225extern void html(const char *txt);
226extern void htmlf(const char *format,...);
227extern void html_txt(char *txt);
228extern void html_ntxt(int len, char *txt);
229extern void html_attr(char *txt);
230extern void html_hidden(char *name, char *value);
231extern void html_option(char *value, char *text, char *selected_value);
232extern void html_link_open(char *url, char *title, char *class);
233extern void html_link_close(void);
234extern void html_filemode(unsigned short mode);
235extern int html_include(const char *filename);
236
237extern int cgit_read_config(const char *filename, configfn fn); 223extern int cgit_read_config(const char *filename, configfn fn);
238extern int cgit_parse_query(char *txt, configfn fn); 224extern int cgit_parse_query(char *txt, configfn fn);
239extern struct commitinfo *cgit_parse_commit(struct commit *commit); 225extern struct commitinfo *cgit_parse_commit(struct commit *commit);
240extern struct taginfo *cgit_parse_tag(struct tag *tag); 226extern struct taginfo *cgit_parse_tag(struct tag *tag);
241extern void cgit_parse_url(const char *url); 227extern void cgit_parse_url(const char *url);
242 228
243extern char *cache_safe_filename(const char *unsafe); 229extern char *cache_safe_filename(const char *unsafe);
244extern int cache_lock(struct cacheitem *item); 230extern int cache_lock(struct cacheitem *item);
245extern int cache_unlock(struct cacheitem *item); 231extern int cache_unlock(struct cacheitem *item);
246extern int cache_cancel_lock(struct cacheitem *item); 232extern int cache_cancel_lock(struct cacheitem *item);
247extern int cache_exist(struct cacheitem *item); 233extern int cache_exist(struct cacheitem *item);
248extern int cache_expired(struct cacheitem *item); 234extern int cache_expired(struct cacheitem *item);
249 235
250extern char *cgit_repourl(const char *reponame); 236extern char *cgit_repourl(const char *reponame);
251extern char *cgit_fileurl(const char *reponame, const char *pagename, 237extern char *cgit_fileurl(const char *reponame, const char *pagename,
252 const char *filename, const char *query); 238 const char *filename, const char *query);
@@ -267,32 +253,33 @@ extern void cgit_refs_link(char *name, char *title, char *class, char *head,
267extern void cgit_snapshot_link(char *name, char *title, char *class, 253extern void cgit_snapshot_link(char *name, char *title, char *class,
268 char *head, char *rev, char *archivename); 254 char *head, char *rev, char *archivename);
269extern void cgit_diff_link(char *name, char *title, char *class, char *head, 255extern void cgit_diff_link(char *name, char *title, char *class, char *head,
270 char *new_rev, char *old_rev, char *path); 256 char *new_rev, char *old_rev, char *path);
271 257
272extern void cgit_object_link(struct object *obj); 258extern void cgit_object_link(struct object *obj);
273 259
274extern void cgit_print_error(char *msg); 260extern void cgit_print_error(char *msg);
275extern void cgit_print_date(time_t secs, char *format); 261extern void cgit_print_date(time_t secs, char *format);
276extern void cgit_print_age(time_t t, time_t max_relative, char *format); 262extern void cgit_print_age(time_t t, time_t max_relative, char *format);
277extern void cgit_print_docstart(char *title, struct cacheitem *item); 263extern void cgit_print_docstart(char *title, struct cacheitem *item);
278extern void cgit_print_docend(); 264extern void cgit_print_docend();
279extern void cgit_print_pageheader(char *title, int show_search); 265extern void cgit_print_pageheader(char *title, int show_search);
280extern void cgit_print_snapshot_start(const char *mimetype, 266extern void cgit_print_snapshot_start(const char *mimetype,
281 const char *filename, 267 const char *filename,
282 struct cacheitem *item); 268 struct cacheitem *item);
269extern void cgit_print_filemode(unsigned short mode);
283extern void cgit_print_branches(int maxcount); 270extern void cgit_print_branches(int maxcount);
284extern void cgit_print_tags(int maxcount); 271extern void cgit_print_tags(int maxcount);
285 272
286extern void cgit_print_repolist(struct cacheitem *item); 273extern void cgit_print_repolist(struct cacheitem *item);
287extern void cgit_print_summary(); 274extern void cgit_print_summary();
288extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, 275extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep,
289 char *pattern, char *path, int pager); 276 char *pattern, char *path, int pager);
290extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); 277extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path);
291extern void cgit_print_tree(const char *rev, char *path); 278extern void cgit_print_tree(const char *rev, char *path);
292extern void cgit_print_commit(char *hex); 279extern void cgit_print_commit(char *hex);
293extern void cgit_print_refs(); 280extern void cgit_print_refs();
294extern void cgit_print_tag(char *revname); 281extern void cgit_print_tag(char *revname);
295extern void cgit_print_diff(const char *new_hex, const char *old_hex, const char *prefix); 282extern void cgit_print_diff(const char *new_hex, const char *old_hex, const char *prefix);
296extern void cgit_print_patch(char *hex, struct cacheitem *item); 283extern void cgit_print_patch(char *hex, struct cacheitem *item);
297extern void cgit_print_snapshot(struct cacheitem *item, const char *head, 284extern void cgit_print_snapshot(struct cacheitem *item, const char *head,
298 const char *hex, const char *prefix, 285 const char *hex, const char *prefix,