summaryrefslogtreecommitdiffabout
authorJohan Herland <johan@herland.net>2010-06-09 23:09:24 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2010-06-19 08:40:21 (UTC)
commitc3f23d4571c06c979eddbd4c973163ba76c7e50f (patch) (unidiff)
treeef73940ab3ac1ccc3d3a8dcb0ba0279c6a2a6fa0
parent026980c270354c59b8a192f5e6db7efe9c66dd62 (diff)
downloadcgit-c3f23d4571c06c979eddbd4c973163ba76c7e50f.zip
cgit-c3f23d4571c06c979eddbd4c973163ba76c7e50f.tar.gz
cgit-c3f23d4571c06c979eddbd4c973163ba76c7e50f.tar.bz2
ui-shared: Improve const-ness in API
This is needed to prevent const-related warnings in later patches. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c76
-rw-r--r--ui-shared.h69
2 files changed, 80 insertions, 65 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 8827fff..7d7fff0 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -18,25 +18,25 @@ static char *http_date(time_t t)
18{ 18{
19 static char day[][4] = 19 static char day[][4] =
20 {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; 20 {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
21 static char month[][4] = 21 static char month[][4] =
22 {"Jan", "Feb", "Mar", "Apr", "May", "Jun", 22 {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
23 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; 23 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
24 struct tm *tm = gmtime(&t); 24 struct tm *tm = gmtime(&t);
25 return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday], 25 return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday],
26 tm->tm_mday, month[tm->tm_mon], 1900+tm->tm_year, 26 tm->tm_mday, month[tm->tm_mon], 1900+tm->tm_year,
27 tm->tm_hour, tm->tm_min, tm->tm_sec); 27 tm->tm_hour, tm->tm_min, tm->tm_sec);
28} 28}
29 29
30void cgit_print_error(char *msg) 30void cgit_print_error(const char *msg)
31{ 31{
32 html("<div class='error'>"); 32 html("<div class='error'>");
33 html_txt(msg); 33 html_txt(msg);
34 html("</div>\n"); 34 html("</div>\n");
35} 35}
36 36
37char *cgit_httpscheme() 37char *cgit_httpscheme()
38{ 38{
39 if (ctx.env.https && !strcmp(ctx.env.https, "on")) 39 if (ctx.env.https && !strcmp(ctx.env.https, "on"))
40 return "https://"; 40 return "https://";
41 else 41 else
42 return "http://"; 42 return "http://";
@@ -124,25 +124,25 @@ const char *cgit_repobasename(const char *reponame)
124char *cgit_currurl() 124char *cgit_currurl()
125{ 125{
126 if (!ctx.cfg.virtual_root) 126 if (!ctx.cfg.virtual_root)
127 return ctx.cfg.script_name; 127 return ctx.cfg.script_name;
128 else if (ctx.qry.page) 128 else if (ctx.qry.page)
129 return fmt("%s/%s/%s/", ctx.cfg.virtual_root, ctx.qry.repo, ctx.qry.page); 129 return fmt("%s/%s/%s/", ctx.cfg.virtual_root, ctx.qry.repo, ctx.qry.page);
130 else if (ctx.qry.repo) 130 else if (ctx.qry.repo)
131 return fmt("%s/%s/", ctx.cfg.virtual_root, ctx.qry.repo); 131 return fmt("%s/%s/", ctx.cfg.virtual_root, ctx.qry.repo);
132 else 132 else
133 return fmt("%s/", ctx.cfg.virtual_root); 133 return fmt("%s/", ctx.cfg.virtual_root);
134} 134}
135 135
136static void site_url(char *page, char *search, int ofs) 136static void site_url(const char *page, const char *search, int ofs)
137{ 137{
138 char *delim = "?"; 138 char *delim = "?";
139 139
140 if (ctx.cfg.virtual_root) { 140 if (ctx.cfg.virtual_root) {
141 html_attr(ctx.cfg.virtual_root); 141 html_attr(ctx.cfg.virtual_root);
142 if (ctx.cfg.virtual_root[strlen(ctx.cfg.virtual_root) - 1] != '/') 142 if (ctx.cfg.virtual_root[strlen(ctx.cfg.virtual_root) - 1] != '/')
143 html("/"); 143 html("/");
144 } else 144 } else
145 html(ctx.cfg.script_name); 145 html(ctx.cfg.script_name);
146 146
147 if (page) { 147 if (page) {
148 htmlf("?p=%s", page); 148 htmlf("?p=%s", page);
@@ -151,53 +151,53 @@ static void site_url(char *page, char *search, int ofs)
151 if (search) { 151 if (search) {
152 html(delim); 152 html(delim);
153 html("q="); 153 html("q=");
154 html_attr(search); 154 html_attr(search);
155 delim = "&"; 155 delim = "&";
156 } 156 }
157 if (ofs) { 157 if (ofs) {
158 html(delim); 158 html(delim);
159 htmlf("ofs=%d", ofs); 159 htmlf("ofs=%d", ofs);
160 } 160 }
161} 161}
162 162
163static void site_link(char *page, char *name, char *title, char *class, 163static void site_link(const char *page, const char *name, const char *title,
164 char *search, int ofs) 164 const char *class, const char *search, int ofs)
165{ 165{
166 html("<a"); 166 html("<a");
167 if (title) { 167 if (title) {
168 html(" title='"); 168 html(" title='");
169 html_attr(title); 169 html_attr(title);
170 html("'"); 170 html("'");
171 } 171 }
172 if (class) { 172 if (class) {
173 html(" class='"); 173 html(" class='");
174 html_attr(class); 174 html_attr(class);
175 html("'"); 175 html("'");
176 } 176 }
177 html(" href='"); 177 html(" href='");
178 site_url(page, search, ofs); 178 site_url(page, search, ofs);
179 html("'>"); 179 html("'>");
180 html_txt(name); 180 html_txt(name);
181 html("</a>"); 181 html("</a>");
182} 182}
183 183
184void cgit_index_link(char *name, char *title, char *class, char *pattern, 184void cgit_index_link(const char *name, const char *title, const char *class,
185 int ofs) 185 const char *pattern, int ofs)
186{ 186{
187 site_link(NULL, name, title, class, pattern, ofs); 187 site_link(NULL, name, title, class, pattern, ofs);
188} 188}
189 189
190static char *repolink(char *title, char *class, char *page, char *head, 190static char *repolink(const char *title, const char *class, const char *page,
191 char *path) 191 const char *head, const char *path)
192{ 192{
193 char *delim = "?"; 193 char *delim = "?";
194 194
195 html("<a"); 195 html("<a");
196 if (title) { 196 if (title) {
197 html(" title='"); 197 html(" title='");
198 html_attr(title); 198 html_attr(title);
199 html("'"); 199 html("'");
200 } 200 }
201 if (class) { 201 if (class) {
202 html(" class='"); 202 html(" class='");
203 html_attr(class); 203 html_attr(class);
@@ -231,66 +231,68 @@ static char *repolink(char *title, char *class, char *page, char *head,
231 } 231 }
232 delim = "&amp;"; 232 delim = "&amp;";
233 } 233 }
234 if (head && strcmp(head, ctx.repo->defbranch)) { 234 if (head && strcmp(head, ctx.repo->defbranch)) {
235 html(delim); 235 html(delim);
236 html("h="); 236 html("h=");
237 html_url_arg(head); 237 html_url_arg(head);
238 delim = "&amp;"; 238 delim = "&amp;";
239 } 239 }
240 return fmt("%s", delim); 240 return fmt("%s", delim);
241} 241}
242 242
243static void reporevlink(char *page, char *name, char *title, char *class, 243static void reporevlink(const char *page, const char *name, const char *title,
244 char *head, char *rev, char *path) 244 const char *class, const char *head, const char *rev,
245 const char *path)
245{ 246{
246 char *delim; 247 char *delim;
247 248
248 delim = repolink(title, class, page, head, path); 249 delim = repolink(title, class, page, head, path);
249 if (rev && ctx.qry.head != NULL && strcmp(rev, ctx.qry.head)) { 250 if (rev && ctx.qry.head != NULL && strcmp(rev, ctx.qry.head)) {
250 html(delim); 251 html(delim);
251 html("id="); 252 html("id=");
252 html_url_arg(rev); 253 html_url_arg(rev);
253 } 254 }
254 html("'>"); 255 html("'>");
255 html_txt(name); 256 html_txt(name);
256 html("</a>"); 257 html("</a>");
257} 258}
258 259
259void cgit_summary_link(char *name, char *title, char *class, char *head) 260void cgit_summary_link(const char *name, const char *title, const char *class,
261 const char *head)
260{ 262{
261 reporevlink(NULL, name, title, class, head, NULL, NULL); 263 reporevlink(NULL, name, title, class, head, NULL, NULL);
262} 264}
263 265
264void cgit_tag_link(char *name, char *title, char *class, char *head, 266void cgit_tag_link(const char *name, const char *title, const char *class,
265 char *rev) 267 const char *head, const char *rev)
266{ 268{
267 reporevlink("tag", name, title, class, head, rev, NULL); 269 reporevlink("tag", name, title, class, head, rev, NULL);
268} 270}
269 271
270void cgit_tree_link(char *name, char *title, char *class, char *head, 272void cgit_tree_link(const char *name, const char *title, const char *class,
271 char *rev, char *path) 273 const char *head, const char *rev, const char *path)
272{ 274{
273 reporevlink("tree", name, title, class, head, rev, path); 275 reporevlink("tree", name, title, class, head, rev, path);
274} 276}
275 277
276void cgit_plain_link(char *name, char *title, char *class, char *head, 278void cgit_plain_link(const char *name, const char *title, const char *class,
277 char *rev, char *path) 279 const char *head, const char *rev, const char *path)
278{ 280{
279 reporevlink("plain", name, title, class, head, rev, path); 281 reporevlink("plain", name, title, class, head, rev, path);
280} 282}
281 283
282void cgit_log_link(char *name, char *title, char *class, char *head, 284void cgit_log_link(const char *name, const char *title, const char *class,
283 char *rev, char *path, int ofs, char *grep, char *pattern, 285 const char *head, const char *rev, const char *path,
284 int showmsg) 286 int ofs, const char *grep, const char *pattern, int showmsg)
285{ 287{
286 char *delim; 288 char *delim;
287 289
288 delim = repolink(title, class, "log", head, path); 290 delim = repolink(title, class, "log", head, path);
289 if (rev && strcmp(rev, ctx.qry.head)) { 291 if (rev && strcmp(rev, ctx.qry.head)) {
290 html(delim); 292 html(delim);
291 html("id="); 293 html("id=");
292 html_url_arg(rev); 294 html_url_arg(rev);
293 delim = "&"; 295 delim = "&";
294 } 296 }
295 if (grep && pattern) { 297 if (grep && pattern) {
296 html(delim); 298 html(delim);
@@ -307,26 +309,26 @@ void cgit_log_link(char *name, char *title, char *class, char *head,
307 htmlf("%d", ofs); 309 htmlf("%d", ofs);
308 delim = "&"; 310 delim = "&";
309 } 311 }
310 if (showmsg) { 312 if (showmsg) {
311 html(delim); 313 html(delim);
312 html("showmsg=1"); 314 html("showmsg=1");
313 } 315 }
314 html("'>"); 316 html("'>");
315 html_txt(name); 317 html_txt(name);
316 html("</a>"); 318 html("</a>");
317} 319}
318 320
319void cgit_commit_link(char *name, char *title, char *class, char *head, 321void cgit_commit_link(char *name, const char *title, const char *class,
320 char *rev, int toggle_ssdiff) 322 const char *head, const char *rev, int toggle_ssdiff)
321{ 323{
322 if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) { 324 if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) {
323 name[ctx.cfg.max_msg_len] = '\0'; 325 name[ctx.cfg.max_msg_len] = '\0';
324 name[ctx.cfg.max_msg_len - 1] = '.'; 326 name[ctx.cfg.max_msg_len - 1] = '.';
325 name[ctx.cfg.max_msg_len - 2] = '.'; 327 name[ctx.cfg.max_msg_len - 2] = '.';
326 name[ctx.cfg.max_msg_len - 3] = '.'; 328 name[ctx.cfg.max_msg_len - 3] = '.';
327 } 329 }
328 330
329 char *delim; 331 char *delim;
330 332
331 delim = repolink(title, class, "commit", head, NULL); 333 delim = repolink(title, class, "commit", head, NULL);
332 if (rev && strcmp(rev, ctx.qry.head)) { 334 if (rev && strcmp(rev, ctx.qry.head)) {
@@ -335,39 +337,40 @@ void cgit_commit_link(char *name, char *title, char *class, char *head,
335 html_url_arg(rev); 337 html_url_arg(rev);
336 delim = "&amp;"; 338 delim = "&amp;";
337 } 339 }
338 if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) { 340 if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) {
339 html(delim); 341 html(delim);
340 html("ss=1"); 342 html("ss=1");
341 } 343 }
342 html("'>"); 344 html("'>");
343 html_txt(name); 345 html_txt(name);
344 html("</a>"); 346 html("</a>");
345} 347}
346 348
347void cgit_refs_link(char *name, char *title, char *class, char *head, 349void cgit_refs_link(const char *name, const char *title, const char *class,
348 char *rev, char *path) 350 const char *head, const char *rev, const char *path)
349{ 351{
350 reporevlink("refs", name, title, class, head, rev, path); 352 reporevlink("refs", name, title, class, head, rev, path);
351} 353}
352 354
353void cgit_snapshot_link(char *name, char *title, char *class, char *head, 355void cgit_snapshot_link(const char *name, const char *title, const char *class,
354 char *rev, char *archivename) 356 const char *head, const char *rev,
357 const char *archivename)
355{ 358{
356 reporevlink("snapshot", name, title, class, head, rev, archivename); 359 reporevlink("snapshot", name, title, class, head, rev, archivename);
357} 360}
358 361
359void cgit_diff_link(char *name, char *title, char *class, char *head, 362void cgit_diff_link(const char *name, const char *title, const char *class,
360 char *new_rev, char *old_rev, char *path, 363 const char *head, const char *new_rev, const char *old_rev,
361 int toggle_ssdiff) 364 const char *path, int toggle_ssdiff)
362{ 365{
363 char *delim; 366 char *delim;
364 367
365 delim = repolink(title, class, "diff", head, path); 368 delim = repolink(title, class, "diff", head, path);
366 if (new_rev && ctx.qry.head != NULL && strcmp(new_rev, ctx.qry.head)) { 369 if (new_rev && ctx.qry.head != NULL && strcmp(new_rev, ctx.qry.head)) {
367 html(delim); 370 html(delim);
368 html("id="); 371 html("id=");
369 html_url_arg(new_rev); 372 html_url_arg(new_rev);
370 delim = "&amp;"; 373 delim = "&amp;";
371 } 374 }
372 if (old_rev) { 375 if (old_rev) {
373 html(delim); 376 html(delim);
@@ -375,32 +378,32 @@ void cgit_diff_link(char *name, char *title, char *class, char *head,
375 html_url_arg(old_rev); 378 html_url_arg(old_rev);
376 delim = "&amp;"; 379 delim = "&amp;";
377 } 380 }
378 if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) { 381 if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) {
379 html(delim); 382 html(delim);
380 html("ss=1"); 383 html("ss=1");
381 } 384 }
382 html("'>"); 385 html("'>");
383 html_txt(name); 386 html_txt(name);
384 html("</a>"); 387 html("</a>");
385} 388}
386 389
387void cgit_patch_link(char *name, char *title, char *class, char *head, 390void cgit_patch_link(const char *name, const char *title, const char *class,
388 char *rev) 391 const char *head, const char *rev)
389{ 392{
390 reporevlink("patch", name, title, class, head, rev, NULL); 393 reporevlink("patch", name, title, class, head, rev, NULL);
391} 394}
392 395
393void cgit_stats_link(char *name, char *title, char *class, char *head, 396void cgit_stats_link(const char *name, const char *title, const char *class,
394 char *path) 397 const char *head, const char *path)
395{ 398{
396 reporevlink("stats", name, title, class, head, NULL, path); 399 reporevlink("stats", name, title, class, head, NULL, path);
397} 400}
398 401
399void cgit_object_link(struct object *obj) 402void cgit_object_link(struct object *obj)
400{ 403{
401 char *page, *shortrev, *fullrev, *name; 404 char *page, *shortrev, *fullrev, *name;
402 405
403 fullrev = sha1_to_hex(obj->sha1); 406 fullrev = sha1_to_hex(obj->sha1);
404 shortrev = xstrdup(fullrev); 407 shortrev = xstrdup(fullrev);
405 shortrev[10] = '\0'; 408 shortrev[10] = '\0';
406 if (obj->type == OBJ_COMMIT) { 409 if (obj->type == OBJ_COMMIT) {
@@ -408,40 +411,40 @@ void cgit_object_link(struct object *obj)
408 ctx.qry.head, fullrev, 0); 411 ctx.qry.head, fullrev, 0);
409 return; 412 return;
410 } else if (obj->type == OBJ_TREE) 413 } else if (obj->type == OBJ_TREE)
411 page = "tree"; 414 page = "tree";
412 else if (obj->type == OBJ_TAG) 415 else if (obj->type == OBJ_TAG)
413 page = "tag"; 416 page = "tag";
414 else 417 else
415 page = "blob"; 418 page = "blob";
416 name = fmt("%s %s...", typename(obj->type), shortrev); 419 name = fmt("%s %s...", typename(obj->type), shortrev);
417 reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL); 420 reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL);
418} 421}
419 422
420void cgit_print_date(time_t secs, char *format, int local_time) 423void cgit_print_date(time_t secs, const char *format, int local_time)
421{ 424{
422 char buf[64]; 425 char buf[64];
423 struct tm *time; 426 struct tm *time;
424 427
425 if (!secs) 428 if (!secs)
426 return; 429 return;
427 if(local_time) 430 if(local_time)
428 time = localtime(&secs); 431 time = localtime(&secs);
429 else 432 else
430 time = gmtime(&secs); 433 time = gmtime(&secs);
431 strftime(buf, sizeof(buf)-1, format, time); 434 strftime(buf, sizeof(buf)-1, format, time);
432 html_txt(buf); 435 html_txt(buf);
433} 436}
434 437
435void cgit_print_age(time_t t, time_t max_relative, char *format) 438void cgit_print_age(time_t t, time_t max_relative, const char *format)
436{ 439{
437 time_t now, secs; 440 time_t now, secs;
438 441
439 if (!t) 442 if (!t)
440 return; 443 return;
441 time(&now); 444 time(&now);
442 secs = now - t; 445 secs = now - t;
443 446
444 if (secs > max_relative && max_relative >= 0) { 447 if (secs > max_relative && max_relative >= 0) {
445 cgit_print_date(t, format, ctx.cfg.local_time); 448 cgit_print_date(t, format, ctx.cfg.local_time);
446 return; 449 return;
447 } 450 }
@@ -602,25 +605,26 @@ int print_archive_ref(const char *refname, const unsigned char *sha1,
602 html("<h1>download</h1>\n"); 605 html("<h1>download</h1>\n");
603 *header = 1; 606 *header = 1;
604 } 607 }
605 url = cgit_pageurl(ctx.qry.repo, "blob", 608 url = cgit_pageurl(ctx.qry.repo, "blob",
606 fmt("id=%s&amp;path=%s", sha1_to_hex(fileid), 609 fmt("id=%s&amp;path=%s", sha1_to_hex(fileid),
607 buf)); 610 buf));
608 html_link_open(url, NULL, "menu"); 611 html_link_open(url, NULL, "menu");
609 html_txt(strlpart(buf, 20)); 612 html_txt(strlpart(buf, 20));
610 html_link_close(); 613 html_link_close();
611 return 0; 614 return 0;
612} 615}
613 616
614void cgit_add_hidden_formfields(int incl_head, int incl_search, char *page) 617void cgit_add_hidden_formfields(int incl_head, int incl_search,
618 const char *page)
615{ 619{
616 char *url; 620 char *url;
617 621
618 if (!ctx.cfg.virtual_root) { 622 if (!ctx.cfg.virtual_root) {
619 url = fmt("%s/%s", ctx.qry.repo, page); 623 url = fmt("%s/%s", ctx.qry.repo, page);
620 if (ctx.qry.path) 624 if (ctx.qry.path)
621 url = fmt("%s/%s", url, ctx.qry.path); 625 url = fmt("%s/%s", url, ctx.qry.path);
622 html_hidden("url", url); 626 html_hidden("url", url);
623 } 627 }
624 628
625 if (incl_head && ctx.qry.head && ctx.repo->defbranch && 629 if (incl_head && ctx.qry.head && ctx.repo->defbranch &&
626 strcmp(ctx.qry.head, ctx.repo->defbranch)) 630 strcmp(ctx.qry.head, ctx.repo->defbranch))
diff --git a/ui-shared.h b/ui-shared.h
index 9ebc1f9..308c982 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -1,52 +1,63 @@
1#ifndef UI_SHARED_H 1#ifndef UI_SHARED_H
2#define UI_SHARED_H 2#define UI_SHARED_H
3 3
4extern char *cgit_httpscheme(); 4extern char *cgit_httpscheme();
5extern char *cgit_hosturl(); 5extern char *cgit_hosturl();
6extern char *cgit_rooturl(); 6extern char *cgit_rooturl();
7extern char *cgit_repourl(const char *reponame); 7extern char *cgit_repourl(const char *reponame);
8extern char *cgit_fileurl(const char *reponame, const char *pagename, 8extern char *cgit_fileurl(const char *reponame, const char *pagename,
9 const char *filename, const char *query); 9 const char *filename, const char *query);
10extern char *cgit_pageurl(const char *reponame, const char *pagename, 10extern char *cgit_pageurl(const char *reponame, const char *pagename,
11 const char *query); 11 const char *query);
12 12
13extern void cgit_index_link(char *name, char *title, char *class, 13extern void cgit_index_link(const char *name, const char *title,
14 char *pattern, int ofs); 14 const char *class, const char *pattern, int ofs);
15extern void cgit_summary_link(char *name, char *title, char *class, char *head); 15extern void cgit_summary_link(const char *name, const char *title,
16extern void cgit_tag_link(char *name, char *title, char *class, char *head, 16 const char *class, const char *head);
17 char *rev); 17extern void cgit_tag_link(const char *name, const char *title,
18extern void cgit_tree_link(char *name, char *title, char *class, char *head, 18 const char *class, const char *head,
19 char *rev, char *path); 19 const char *rev);
20extern void cgit_plain_link(char *name, char *title, char *class, char *head, 20extern void cgit_tree_link(const char *name, const char *title,
21 char *rev, char *path); 21 const char *class, const char *head,
22extern void cgit_log_link(char *name, char *title, char *class, char *head, 22 const char *rev, const char *path);
23 char *rev, char *path, int ofs, char *grep, 23extern void cgit_plain_link(const char *name, const char *title,
24 char *pattern, int showmsg); 24 const char *class, const char *head,
25extern void cgit_commit_link(char *name, char *title, char *class, char *head, 25 const char *rev, const char *path);
26 char *rev, int toggle_ssdiff); 26extern void cgit_log_link(const char *name, const char *title,
27extern void cgit_patch_link(char *name, char *title, char *class, char *head, 27 const char *class, const char *head, const char *rev,
28 char *rev); 28 const char *path, int ofs, const char *grep,
29extern void cgit_refs_link(char *name, char *title, char *class, char *head, 29 const char *pattern, int showmsg);
30 char *rev, char *path); 30extern void cgit_commit_link(char *name, const char *title,
31extern void cgit_snapshot_link(char *name, char *title, char *class, 31 const char *class, const char *head,
32 char *head, char *rev, char *archivename); 32 const char *rev, int toggle_ssdiff);
33extern void cgit_diff_link(char *name, char *title, char *class, char *head, 33extern void cgit_patch_link(const char *name, const char *title,
34 char *new_rev, char *old_rev, char *path, 34 const char *class, const char *head,
35 int toggle_ssdiff); 35 const char *rev);
36extern void cgit_stats_link(char *name, char *title, char *class, char *head, 36extern void cgit_refs_link(const char *name, const char *title,
37 char *path); 37 const char *class, const char *head,
38 const char *rev, const char *path);
39extern void cgit_snapshot_link(const char *name, const char *title,
40 const char *class, const char *head,
41 const char *rev, const char *archivename);
42extern void cgit_diff_link(const char *name, const char *title,
43 const char *class, const char *head,
44 const char *new_rev, const char *old_rev,
45 const char *path, int toggle_ssdiff);
46extern void cgit_stats_link(const char *name, const char *title,
47 const char *class, const char *head,
48 const char *path);
38extern void cgit_object_link(struct object *obj); 49extern void cgit_object_link(struct object *obj);
39 50
40extern void cgit_print_error(char *msg); 51extern void cgit_print_error(const char *msg);
41extern void cgit_print_date(time_t secs, char *format, int local_time); 52extern void cgit_print_date(time_t secs, const char *format, int local_time);
42extern void cgit_print_age(time_t t, time_t max_relative, char *format); 53extern void cgit_print_age(time_t t, time_t max_relative, const char *format);
43extern void cgit_print_http_headers(struct cgit_context *ctx); 54extern void cgit_print_http_headers(struct cgit_context *ctx);
44extern void cgit_print_docstart(struct cgit_context *ctx); 55extern void cgit_print_docstart(struct cgit_context *ctx);
45extern void cgit_print_docend(); 56extern void cgit_print_docend();
46extern void cgit_print_pageheader(struct cgit_context *ctx); 57extern void cgit_print_pageheader(struct cgit_context *ctx);
47extern void cgit_print_filemode(unsigned short mode); 58extern void cgit_print_filemode(unsigned short mode);
48extern void cgit_print_snapshot_links(const char *repo, const char *head, 59extern void cgit_print_snapshot_links(const char *repo, const char *head,
49 const char *hex, int snapshots); 60 const char *hex, int snapshots);
50extern void cgit_add_hidden_formfields(int incl_head, int incl_search, 61extern void cgit_add_hidden_formfields(int incl_head, int incl_search,
51 char *page); 62 const char *page);
52#endif /* UI_SHARED_H */ 63#endif /* UI_SHARED_H */