247 |
*p = '\0'; |
*p = '\0'; |
248 |
limit = p; |
limit = p; |
249 |
|
|
250 |
strbuf_puts(sb, "<A HREF="); |
strbuf_sprintf(sb, "<a href='%s'>root</a>/", root); |
|
strbuf_puts(sb, root); |
|
|
strbuf_puts(sb, ">root</A>/"); |
|
251 |
{ |
{ |
252 |
char *next; |
char *next; |
253 |
|
|
262 |
} |
} |
263 |
if (p > buf) |
if (p > buf) |
264 |
*(p - 1) = sep; |
*(p - 1) = sep; |
265 |
strbuf_sprintf(sb, "<A HREF=../files/%s>%s</A>/", |
strbuf_sprintf(sb, "<a href='../files/%s'>%s</a>/", |
266 |
path2url(path), unit); |
path2url(path), unit); |
267 |
} |
} |
268 |
} |
} |
290 |
sb = strbuf_open(0); |
sb = strbuf_open(0); |
291 |
for (i = 0; i < A_LIMIT; i++) { |
for (i = 0; i < A_LIMIT; i++) { |
292 |
if (i == A_INDEX) { |
if (i == A_INDEX) { |
293 |
strbuf_puts(sb, "<A HREF=../mains."); |
strbuf_sprintf(sb, "<a href='../mains.%s'>", normal_suffix); |
|
strbuf_puts(sb, normal_suffix); |
|
|
strbuf_putc(sb, '>'); |
|
294 |
} else if (i == A_HELP) { |
} else if (i == A_HELP) { |
295 |
strbuf_puts(sb, "<A HREF=../help."); |
strbuf_sprintf(sb, "<a href='../help.%s'>", normal_suffix); |
|
strbuf_puts(sb, normal_suffix); |
|
|
strbuf_putc(sb, '>'); |
|
296 |
} else if (ref[i]) { |
} else if (ref[i]) { |
297 |
strbuf_puts(sb, "<A HREF=#"); |
strbuf_puts(sb, "<a href='#"); |
298 |
if (ref[i] == -1) |
if (ref[i] == -1) |
299 |
strbuf_puts(sb, "TOP"); |
strbuf_puts(sb, "TOP"); |
300 |
else if (ref[i] == -2) |
else if (ref[i] == -2) |
301 |
strbuf_puts(sb, "BOTTOM"); |
strbuf_puts(sb, "BOTTOM"); |
302 |
else |
else |
303 |
strbuf_putn(sb, ref[i]); |
strbuf_putn(sb, ref[i]); |
304 |
strbuf_putc(sb, '>'); |
strbuf_puts(sb, "'>"); |
305 |
} |
} |
306 |
if (icon_list) { |
if (icon_list) { |
307 |
strbuf_puts(sb, "<IMG SRC=../icons/"); |
strbuf_puts(sb, "<img src='../icons/"); |
308 |
if (i != A_INDEX && i != A_HELP && ref[i] == 0) |
if (i != A_INDEX && i != A_HELP && ref[i] == 0) |
309 |
strbuf_puts(sb, "n_"); |
strbuf_puts(sb, "n_"); |
310 |
strbuf_puts(sb, icons[i]); |
strbuf_puts(sb, icons[i]); |
311 |
strbuf_putc(sb, '.'); |
strbuf_putc(sb, '.'); |
312 |
strbuf_puts(sb, icon_suffix); |
strbuf_puts(sb, icon_suffix); |
313 |
strbuf_sprintf(sb, " ALT=[%s] %s>", label[i], icon_spec); |
strbuf_sprintf(sb, "' alt='[%s]' %s>", label[i], icon_spec); |
314 |
} else { |
} else { |
315 |
strbuf_sprintf(sb, "[%s]", label[i]); |
strbuf_sprintf(sb, "[%s]", label[i]); |
316 |
} |
} |
317 |
if (i == A_INDEX || i == A_HELP || ref[i] != 0) |
if (i == A_INDEX || i == A_HELP || ref[i] != 0) |
318 |
strbuf_puts(sb, "</A>"); |
strbuf_puts(sb, "</a>"); |
319 |
} |
} |
320 |
return strbuf_value(sb); |
return strbuf_value(sb); |
321 |
} |
} |
441 |
int id = atoi(++line); |
int id = atoi(++line); |
442 |
char *count = locatestring(line, " ", MATCH_FIRST) + 1; |
char *count = locatestring(line, " ", MATCH_FIRST) + 1; |
443 |
|
|
444 |
strbuf_puts(outbuf, "<A HREF="); |
strbuf_puts(outbuf, "<a href='"); |
445 |
if (dynamic) { |
if (dynamic) { |
446 |
char *dir = (*action == '/') ? "" : "../"; |
char *dir = (*action == '/') ? "" : "../"; |
447 |
char *s; |
char *s; |
465 |
dir = REFS; |
dir = REFS; |
466 |
strbuf_sprintf(outbuf, "../%s/%d.%s", dir, id, HTML); |
strbuf_sprintf(outbuf, "../%s/%d.%s", dir, id, HTML); |
467 |
} |
} |
468 |
strbuf_sprintf(outbuf, " TITLE=\"%s\">%s</A>", tooltip(type, -1, count), name); |
strbuf_sprintf(outbuf, "' title='%s'>%s</a>", tooltip(type, -1, count), name); |
469 |
} else { |
} else { |
470 |
int lno = atoi(line); |
int lno = atoi(line); |
471 |
char *filename = strmake(locatestring(line, " ", MATCH_FIRST) + 1, " ") |
char *filename = strmake(locatestring(line, " ", MATCH_FIRST) + 1, " ") |
472 |
+ 2; /* remove './' */ |
+ 2; /* remove './' */ |
473 |
char *url = path2url(filename); |
char *url = path2url(filename); |
474 |
strbuf_sprintf(outbuf, "<A HREF=../%s/%s#%d TITLE=\"%s\">%s</A>", |
strbuf_sprintf(outbuf, "<a href='../%s/%s#%d' title='%s'>%s</a>", |
475 |
SRCS, url, lno, tooltip(type, lno, filename), name); |
SRCS, url, lno, tooltip(type, lno, filename), name); |
476 |
} |
} |
477 |
} |
} |
487 |
struct data *inc; |
struct data *inc; |
488 |
char *path; |
char *path; |
489 |
{ |
{ |
490 |
strbuf_puts(outbuf, "<A HREF="); |
strbuf_puts(outbuf, "<a href='"); |
491 |
if (inc->count == 1) |
if (inc->count == 1) |
492 |
strbuf_puts(outbuf, path2url(strbuf_value(inc->contents))); |
strbuf_puts(outbuf, path2url(strbuf_value(inc->contents))); |
493 |
else |
else |
494 |
strbuf_sprintf(outbuf, "../%s/%d.%s", INCS, inc->id, HTML); |
strbuf_sprintf(outbuf, "../%s/%d.%s", INCS, inc->id, HTML); |
495 |
strbuf_putc(outbuf, '>'); |
strbuf_puts(outbuf, "'>"); |
496 |
strbuf_puts(outbuf, path); |
strbuf_puts(outbuf, path); |
497 |
strbuf_puts(outbuf, "</A>"); |
strbuf_puts(outbuf, "</a>"); |
498 |
} |
} |
499 |
/* |
/* |
500 |
* Put a reserved word. (if, while, ...) |
* Put a reserved word. (if, while, ...) |
646 |
put_end_of_line(lineno) |
put_end_of_line(lineno) |
647 |
int lineno; |
int lineno; |
648 |
{ |
{ |
649 |
fprintf(out, "<A NAME=%d>", lineno); |
fprintf(out, "<a name='%d'>", lineno); |
650 |
if (nflag) |
if (nflag) |
651 |
fprintf(out, lineno_format, lineno); |
fprintf(out, lineno_format, lineno); |
652 |
if (warned) |
if (warned) |
715 |
/* |
/* |
716 |
* print the header |
* print the header |
717 |
*/ |
*/ |
718 |
fputs("<A NAME=TOP><H2>", out); |
fputs("<a name='TOP'><h2>", out); |
719 |
fputs(fill_anchor(indexlink, src), out); |
fputs(fill_anchor(indexlink, src), out); |
720 |
if (cvsweb_url) { |
if (cvsweb_url) { |
721 |
static STRBUF *sb = NULL; |
static STRBUF *sb = NULL; |
733 |
else |
else |
734 |
strbuf_sprintf(sb, "%%%02x", c); |
strbuf_sprintf(sb, "%%%02x", c); |
735 |
} |
} |
736 |
fprintf(out, "%s<A HREF=%s%s", quote_space, cvsweb_url, strbuf_value(sb)); |
fprintf(out, "%s<a href='%s%s", quote_space, cvsweb_url, strbuf_value(sb)); |
737 |
if (cvsweb_cvsroot) |
if (cvsweb_cvsroot) |
738 |
fprintf(out, "?cvsroot=%s", cvsweb_cvsroot); |
fprintf(out, "?cvsroot=%s", cvsweb_cvsroot); |
739 |
fprintf(out, "><FONT SIZE=-1>[CVS]</FONT></A>\n"); |
fprintf(out, "'><font size='-1'>[CVS]</font></a>\n"); |
740 |
/* doesn't close string buffer */ |
/* doesn't close string buffer */ |
741 |
} |
} |
742 |
fprintf(out, "</H2>\n"); |
fprintf(out, "</h2>\n"); |
743 |
fprintf(out, "%s/* ", comment_begin); |
fprintf(out, "%s/* ", comment_begin); |
744 |
|
|
745 |
fputs(link_format(anchor_getlinks(0)), out); |
fputs(link_format(anchor_getlinks(0)), out); |
757 |
fprintf(out, "%s\n", verbatim_begin); |
fprintf(out, "%s\n", verbatim_begin); |
758 |
last_lineno = 0; |
last_lineno = 0; |
759 |
while ((_ = strbuf_fgets(sb, in, STRBUF_NOCRLF)) != NULL) { |
while ((_ = strbuf_fgets(sb, in, STRBUF_NOCRLF)) != NULL) { |
760 |
fprintf(out, "<A NAME=%d>", ++last_lineno); |
fprintf(out, "<a name='%d'>", ++last_lineno); |
761 |
for (; *_; _++) { |
for (; *_; _++) { |
762 |
int c = *_; |
int c = *_; |
763 |
|
|
794 |
basename = src; |
basename = src; |
795 |
incref = get_included(basename); |
incref = get_included(basename); |
796 |
if (incref) { |
if (incref) { |
797 |
fputs("<H2><A HREF=", out); |
fputs("<h2><a href='", out); |
798 |
if (incref->count > 1) { |
if (incref->count > 1) { |
799 |
char s_count[32]; |
char s_count[32]; |
800 |
|
|
801 |
snprintf(s_count, sizeof(s_count), "%d", incref->count); |
snprintf(s_count, sizeof(s_count), "%d", incref->count); |
802 |
fprintf(out, "../%s/%d.%s", INCREFS, incref->id, HTML); |
fprintf(out, "../%s/%d.%s", INCREFS, incref->id, HTML); |
803 |
fprintf(out, " TITLE='%s'>", tooltip('I', -1, s_count)); |
fprintf(out, "' title='%s'>", tooltip('I', -1, s_count)); |
804 |
} else { |
} else { |
805 |
char *lno, *filename, *save; |
char *lno, *filename, *save; |
806 |
char *p = strbuf_value(incref->contents); |
char *p = strbuf_value(incref->contents); |
814 |
if (filename[0] == '.' && filename[1] == '/') |
if (filename[0] == '.' && filename[1] == '/') |
815 |
filename += 2; |
filename += 2; |
816 |
fprintf(out, "%s#%s", path2url(filename), lno); |
fprintf(out, "%s#%s", path2url(filename), lno); |
817 |
fprintf(out, " TITLE='%s'>", tooltip('I', atoi(lno), filename)); |
fprintf(out, "' title='%s'>", tooltip('I', atoi(lno), filename)); |
818 |
*save = ' '; |
*save = ' '; |
819 |
} |
} |
820 |
fprintf(out, "%s</A></H2>\n", title_included_from); |
fprintf(out, "%s</a></h2>\n", title_included_from); |
821 |
fprintf(out, "%s\n", hr); |
fprintf(out, "%s\n", hr); |
822 |
} |
} |
823 |
/* |
/* |
829 |
define_index = strbuf_open(0); |
define_index = strbuf_open(0); |
830 |
for (ancref = anchor_first(); ancref; ancref = anchor_next()) { |
for (ancref = anchor_first(); ancref; ancref = anchor_next()) { |
831 |
if (ancref->type == 'D') { |
if (ancref->type == 'D') { |
832 |
strbuf_sprintf(define_index, "<LI><A HREF=#%d TITLE=\"%s\">%s</A>\n", |
strbuf_sprintf(define_index, "<li><a href='#%d' title='%s'>%s</a>\n", |
833 |
ancref->lineno, |
ancref->lineno, |
834 |
tooltip('R', ancref->lineno, NULL), |
tooltip('R', ancref->lineno, NULL), |
835 |
gettag(ancref)); |
gettag(ancref)); |
836 |
} |
} |
837 |
} |
} |
838 |
if (strbuf_getlen(define_index) > 0) { |
if (strbuf_getlen(define_index) > 0) { |
839 |
fprintf(out, "<H2>%s</H2>\n", title_define_index); |
fprintf(out, "<h2>%s</h2>\n", title_define_index); |
840 |
fputs("This source file includes following definitions.\n", out); |
fputs("This source file includes following definitions.\n", out); |
841 |
fputs("<OL>\n", out); |
fputs("<ol>\n", out); |
842 |
fputs(strbuf_value(define_index), out); |
fputs(strbuf_value(define_index), out); |
843 |
fputs("</OL>\n", out); |
fputs("</ol>\n", out); |
844 |
fprintf(out, "%s\n", hr); |
fprintf(out, "%s\n", hr); |
845 |
} |
} |
846 |
/* |
/* |
876 |
fprintf(out, "%s\n", verbatim_end); |
fprintf(out, "%s\n", verbatim_end); |
877 |
} |
} |
878 |
fprintf(out, "%s\n", hr); |
fprintf(out, "%s\n", hr); |
879 |
fputs("<A NAME=BOTTOM>\n", out); |
fputs("<a name='BOTTOM'>\n", out); |
880 |
fprintf(out, "%s/* ", comment_begin); |
fprintf(out, "%s/* ", comment_begin); |
881 |
fputs(link_format(anchor_getlinks(-1)), out); |
fputs(link_format(anchor_getlinks(-1)), out); |
882 |
if (show_position) |
if (show_position) |