/[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.40 by shigio, Wed May 11 01:50:12 2005 UTC revision 1.41 by h-iwamoto, Thu Aug 25 13:04:28 2005 UTC
# Line 133  static FILE * Line 133  static FILE *
133  open_input_file(file)  open_input_file(file)
134          const char *file;          const char *file;
135  {  {
         char command[MAXFILLEN];  
136          FILE *ip;          FILE *ip;
137    
138          snprintf(command, sizeof(command), "gtags --expand -%d < %s", tabs, file);          ip = fopen(file, "r");
         ip = popen(command, "r");  
139          if (!ip)          if (!ip)
140                  die("cannot execute '%s'.", command);                  die("cannot open file '%s'.", file);
141          curpfile = file;          curpfile = file;
142          warned = 0;          warned = 0;
143          return ip;          return ip;
# Line 151  static void Line 149  static void
149  close_input_file(ip)  close_input_file(ip)
150          FILE *ip;          FILE *ip;
151  {  {
152          if (pclose(ip) != 0)          fclose(ip);
                 die("command 'gtags --expand -%d' failed.", tabs);  
153  }  }
154  /*  /*
155   * Open HTML file.   * Open HTML file.
# Line 756  src2html(src, html, notsource) Line 753  src2html(src, html, notsource)
753                  fputs_nl(verbatim_begin, out);                  fputs_nl(verbatim_begin, out);
754                  last_lineno = 0;                  last_lineno = 0;
755                  while ((_ = strbuf_fgets(sb, in, STRBUF_NOCRLF)) != NULL) {                  while ((_ = strbuf_fgets(sb, in, STRBUF_NOCRLF)) != NULL) {
756                            int dst = 0;
757    
758                          fputs(gen_name_number(++last_lineno), out);                          fputs(gen_name_number(++last_lineno), out);
759                          for (; *_; _++) {                          for (; *_; _++) {
760                                  int c = *_;                                  int c = *_;
761    
762                                  if (c == '&')                                  if (c == '\t') {
763                                          fputs(quote_amp, out);                                          do {
764                                  else if (c == '<')                                                  putc(' ', out);
765                                          fputs(quote_little, out);                                          } while (++dst % tabs);
766                                  else if (c == '>')                                  } else {
767                                          fputs(quote_great, out);                                          if (c == '&')
768                                  else                                                  fputs(quote_amp, out);
769                                          fputc(c, out);                                          else if (c == '<')
770                                                    fputs(quote_little, out);
771                                            else if (c == '>')
772                                                    fputs(quote_great, out);
773                                            else
774                                                    fputc(c, out);
775                                            dst++;
776                                    }
777                          }                          }
778                          fputc('\n', out);                          fputc('\n', out);
779                  }                  }

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

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