/[global]/global/htags/src2html.c
ViewVC logotype

Diff of /global/htags/src2html.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.41 by h-iwamoto, Thu Aug 25 13:04:28 2005 UTC revision 1.42 by shigio, Tue Oct 4 07:59:04 2005 UTC
# Line 91  struct lang_entry lang_switch[] = { Line 91  struct lang_entry lang_switch[] = {
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    
# Line 130  static int last_lineno; Line 129  static int last_lineno;
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    
# Line 146  open_input_file(file) Line 144  open_input_file(file)
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  }  }
# Line 158  close_input_file(ip) Line 155  close_input_file(ip)
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;
# Line 181  open_output_file(file) Line 177  open_output_file(file)
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)
# Line 196  close_output_file(op) Line 191  close_output_file(op)
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  }  }
# Line 207  echoc(c) Line 201  echoc(c)
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  }  }
# Line 224  echos(s) Line 217  echos(s)
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;
# Line 270  fill_anchor(root, path) Line 261  fill_anchor(root, path)
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;
# Line 314  link_format(ref) Line 304  link_format(ref)
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;
# Line 346  generate_guide(lineno) Line 335  generate_guide(lineno)
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    
# Line 395  tooltip(type, lno, opt) Line 381  tooltip(type, lno, opt)
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;
# Line 474  put_anchor(name, type, lineno) Line 457  put_anchor(name, type, lineno)
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));
# Line 492  put_include_anchor(inc, path) Line 473  put_include_anchor(inc, path)
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);
# Line 503  put_reserved_word(word) Line 483  put_reserved_word(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);
# Line 514  put_macro(word) Line 493  put_macro(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);
# Line 527  unknown_preprocessing_directive(word, li Line 504  unknown_preprocessing_directive(word, li
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)
# Line 538  unexpected_eof(lineno) Line 514  unexpected_eof(lineno)
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)
# Line 550  unknown_yacc_directive(word, lineno) Line 524  unknown_yacc_directive(word, lineno)
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)
# Line 564  missing_left(word, lineno) Line 536  missing_left(word, lineno)
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);
# Line 582  put_char(c) Line 553  put_char(c)
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);
# Line 592  put_string(s) Line 562  put_string(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);
# Line 610  static const char *guide = NULL; Line 579  static const char *guide = NULL;
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))
# Line 634  put_begin_of_line(lineno) Line 602  put_begin_of_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)
# Line 674  put_end_of_line(lineno) Line 641  put_end_of_line(lineno)
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    

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26