91 |
* r) language entry |
* r) language entry |
92 |
*/ |
*/ |
93 |
static struct lang_entry * |
static struct lang_entry * |
94 |
get_lang_entry(lang) |
get_lang_entry(const char *lang) |
|
const char *lang; |
|
95 |
{ |
{ |
96 |
int i, size = sizeof(lang_switch) / sizeof(struct lang_entry); |
int i, size = sizeof(lang_switch) / sizeof(struct lang_entry); |
97 |
|
|
129 |
* r) file pointer |
* r) file pointer |
130 |
*/ |
*/ |
131 |
static FILE * |
static FILE * |
132 |
open_input_file(file) |
open_input_file(const char *file) |
|
const char *file; |
|
133 |
{ |
{ |
134 |
FILE *ip; |
FILE *ip; |
135 |
|
|
144 |
* Close source file. |
* Close source file. |
145 |
*/ |
*/ |
146 |
static void |
static void |
147 |
close_input_file(ip) |
close_input_file(FILE *ip) |
|
FILE *ip; |
|
148 |
{ |
{ |
149 |
fclose(ip); |
fclose(ip); |
150 |
} |
} |
155 |
* r) file pointer |
* r) file pointer |
156 |
*/ |
*/ |
157 |
static FILE * |
static FILE * |
158 |
open_output_file(file) |
open_output_file(const char *file) |
|
const char *file; |
|
159 |
{ |
{ |
160 |
char command[MAXFILLEN]; |
char command[MAXFILLEN]; |
161 |
FILE *op; |
FILE *op; |
177 |
* Close HTML file. |
* Close HTML file. |
178 |
*/ |
*/ |
179 |
static void |
static void |
180 |
close_output_file(op) |
close_output_file(FILE *op) |
|
FILE *op; |
|
181 |
{ |
{ |
182 |
if (cflag) { |
if (cflag) { |
183 |
if (pclose(op) != 0) |
if (pclose(op) != 0) |
191 |
* You should use this function to put a control character. |
* You should use this function to put a control character. |
192 |
*/ |
*/ |
193 |
void |
void |
194 |
echoc(c) |
echoc(int c) |
|
int c; |
|
195 |
{ |
{ |
196 |
strbuf_putc(outbuf, c); |
strbuf_putc(outbuf, c); |
197 |
} |
} |
201 |
* You should use this function to put a control sequence. |
* You should use this function to put a control sequence. |
202 |
*/ |
*/ |
203 |
void |
void |
204 |
echos(s) |
echos(const char *s) |
|
const char *s; |
|
205 |
{ |
{ |
206 |
strbuf_puts(outbuf, s); |
strbuf_puts(outbuf, s); |
207 |
} |
} |
217 |
* r) hypertext file name string |
* r) hypertext file name string |
218 |
*/ |
*/ |
219 |
const char * |
const char * |
220 |
fill_anchor(root, path) |
fill_anchor(const char *root, const char *path) |
|
const char *root; |
|
|
const char *path; |
|
221 |
{ |
{ |
222 |
STATIC_STRBUF(sb); |
STATIC_STRBUF(sb); |
223 |
char buf[MAXBUFLEN], *limit, *p; |
char buf[MAXBUFLEN], *limit, *p; |
261 |
* r) HTML |
* r) HTML |
262 |
*/ |
*/ |
263 |
const char * |
const char * |
264 |
link_format(ref) |
link_format(int ref[A_SIZE]) |
|
int ref[A_SIZE]; |
|
265 |
{ |
{ |
266 |
STATIC_STRBUF(sb); |
STATIC_STRBUF(sb); |
267 |
const char **label = icon_list ? anchor_comment : anchor_label; |
const char **label = icon_list ? anchor_comment : anchor_label; |
304 |
* r) guide string |
* r) guide string |
305 |
*/ |
*/ |
306 |
const char * |
const char * |
307 |
generate_guide(lineno) |
generate_guide(int lineno) |
|
int lineno; |
|
308 |
{ |
{ |
309 |
STATIC_STRBUF(sb); |
STATIC_STRBUF(sb); |
310 |
int i = 0; |
int i = 0; |
335 |
* r) tooltip string |
* r) tooltip string |
336 |
*/ |
*/ |
337 |
const char * |
const char * |
338 |
tooltip(type, lno, opt) |
tooltip(int type, int lno, const char *opt) |
|
int type; |
|
|
int lno; |
|
|
const char *opt; |
|
339 |
{ |
{ |
340 |
STATIC_STRBUF(sb); |
STATIC_STRBUF(sb); |
341 |
|
|
381 |
* i) lineno current line no |
* i) lineno current line no |
382 |
*/ |
*/ |
383 |
void |
void |
384 |
put_anchor(name, type, lineno) |
put_anchor(char *name, int type, int lineno) |
|
char *name; |
|
|
int type; |
|
|
int lineno; |
|
385 |
{ |
{ |
386 |
const char *line; |
const char *line; |
387 |
int db; |
int db; |
457 |
* i) path path name for display |
* i) path path name for display |
458 |
*/ |
*/ |
459 |
void |
void |
460 |
put_include_anchor(inc, path) |
put_include_anchor(struct data *inc, const char *path) |
|
struct data *inc; |
|
|
const char *path; |
|
461 |
{ |
{ |
462 |
if (inc->count == 1) |
if (inc->count == 1) |
463 |
strbuf_puts(outbuf, gen_href_begin(NULL, path2fid(strbuf_value(inc->contents)), HTML, NULL)); |
strbuf_puts(outbuf, gen_href_begin(NULL, path2fid(strbuf_value(inc->contents)), HTML, NULL)); |
473 |
* Put a reserved word. (if, while, ...) |
* Put a reserved word. (if, while, ...) |
474 |
*/ |
*/ |
475 |
void |
void |
476 |
put_reserved_word(word) |
put_reserved_word(const char *word) |
|
const char *word; |
|
477 |
{ |
{ |
478 |
strbuf_puts(outbuf, reserved_begin); |
strbuf_puts(outbuf, reserved_begin); |
479 |
strbuf_puts(outbuf, word); |
strbuf_puts(outbuf, word); |
483 |
* Put a macro (#define,#undef,...) |
* Put a macro (#define,#undef,...) |
484 |
*/ |
*/ |
485 |
void |
void |
486 |
put_macro(word) |
put_macro(const char *word) |
|
const char *word; |
|
487 |
{ |
{ |
488 |
strbuf_puts(outbuf, sharp_begin); |
strbuf_puts(outbuf, sharp_begin); |
489 |
strbuf_puts(outbuf, word); |
strbuf_puts(outbuf, word); |
493 |
* Print warning message when unkown preprocessing directive is found. |
* Print warning message when unkown preprocessing directive is found. |
494 |
*/ |
*/ |
495 |
void |
void |
496 |
unknown_preprocessing_directive(word, lineno) |
unknown_preprocessing_directive(const char *word, int lineno) |
|
const char *word; |
|
|
int lineno; |
|
497 |
{ |
{ |
498 |
word = strtrim(word, TRIM_ALL, NULL); |
word = strtrim(word, TRIM_ALL, NULL); |
499 |
warning("unknown preprocessing directive '%s'. [+%d %s]", word, lineno, curpfile); |
warning("unknown preprocessing directive '%s'. [+%d %s]", word, lineno, curpfile); |
504 |
* Print warning message when unexpected eof. |
* Print warning message when unexpected eof. |
505 |
*/ |
*/ |
506 |
void |
void |
507 |
unexpected_eof(lineno) |
unexpected_eof(int lineno) |
|
int lineno; |
|
508 |
{ |
{ |
509 |
warning("unexpected eof. [+%d %s]", lineno, curpfile); |
warning("unexpected eof. [+%d %s]", lineno, curpfile); |
510 |
if (colorize_warned_line) |
if (colorize_warned_line) |
514 |
* Print warning message when unknown yacc directive is found. |
* Print warning message when unknown yacc directive is found. |
515 |
*/ |
*/ |
516 |
void |
void |
517 |
unknown_yacc_directive(word, lineno) |
unknown_yacc_directive(const char *word, int lineno) |
|
const char *word; |
|
|
int lineno; |
|
518 |
{ |
{ |
519 |
warning("unknown yacc directive '%s'. [+%d %s]", word, lineno, curpfile); |
warning("unknown yacc directive '%s'. [+%d %s]", word, lineno, curpfile); |
520 |
if (colorize_warned_line) |
if (colorize_warned_line) |
524 |
* Print warning message when unmatched brace is found. |
* Print warning message when unmatched brace is found. |
525 |
*/ |
*/ |
526 |
void |
void |
527 |
missing_left(word, lineno) |
missing_left(const char *word, int lineno) |
|
const char *word; |
|
|
int lineno; |
|
528 |
{ |
{ |
529 |
warning("missing left '%s'. [+%d %s]", word, lineno, curpfile); |
warning("missing left '%s'. [+%d %s]", word, lineno, curpfile); |
530 |
if (colorize_warned_line) |
if (colorize_warned_line) |
536 |
* If you want to put '<', '>' and '&', you should echoc() instead. |
* If you want to put '<', '>' and '&', you should echoc() instead. |
537 |
*/ |
*/ |
538 |
void |
void |
539 |
put_char(c) |
put_char(int c) |
|
int c; |
|
540 |
{ |
{ |
541 |
if (c == '<') |
if (c == '<') |
542 |
strbuf_puts(outbuf, quote_little); |
strbuf_puts(outbuf, quote_little); |
553 |
* If you want to put HTML tag itself, you should echoc() instead. |
* If you want to put HTML tag itself, you should echoc() instead. |
554 |
*/ |
*/ |
555 |
void |
void |
556 |
put_string(s) |
put_string(const char *s) |
|
const char *s; |
|
557 |
{ |
{ |
558 |
for (; *s; s++) |
for (; *s; s++) |
559 |
put_char(*s); |
put_char(*s); |
562 |
* Put brace ('{', '}') |
* Put brace ('{', '}') |
563 |
*/ |
*/ |
564 |
void |
void |
565 |
put_brace(text) |
put_brace(const char *text) |
|
const char *text; |
|
566 |
{ |
{ |
567 |
strbuf_puts(outbuf, brace_begin); |
strbuf_puts(outbuf, brace_begin); |
568 |
strbuf_puts(outbuf, text); |
strbuf_puts(outbuf, text); |
579 |
* Begin of line processing. |
* Begin of line processing. |
580 |
*/ |
*/ |
581 |
void |
void |
582 |
put_begin_of_line(lineno) |
put_begin_of_line(int lineno) |
|
int lineno; |
|
583 |
{ |
{ |
584 |
if (definition_header != NO_HEADER) { |
if (definition_header != NO_HEADER) { |
585 |
if (define_line(lineno)) |
if (define_line(lineno)) |
602 |
* This function flush and clear it. |
* This function flush and clear it. |
603 |
*/ |
*/ |
604 |
void |
void |
605 |
put_end_of_line(lineno) |
put_end_of_line(int lineno) |
|
int lineno; |
|
606 |
{ |
{ |
607 |
fputs(gen_name_number(lineno), out); |
fputs(gen_name_number(lineno), out); |
608 |
if (nflag) |
if (nflag) |
641 |
* i) notsource 1: isn't source, 0: source. |
* i) notsource 1: isn't source, 0: source. |
642 |
*/ |
*/ |
643 |
void |
void |
644 |
src2html(src, html, notsource) |
src2html(const char *src, const char *html, int notsource) |
|
const char *src; |
|
|
const char *html; |
|
|
int notsource; |
|
645 |
{ |
{ |
646 |
char indexlink[128]; |
char indexlink[128]; |
647 |
|
|