/[global]/global/htags/global.cgi.tmpl.in
ViewVC logotype

Diff of /global/htags/global.cgi.tmpl.in

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

revision 1.12 by h-iwamoto, Tue Nov 8 17:22:43 2005 UTC revision 1.13 by shigio, Wed Nov 9 01:28:55 2005 UTC
# Line 115  if ($flag eq 'g' || $flag eq 'I') { Line 115  if ($flag eq 'g' || $flag eq 'I') {
115  local(%ctab) = ('&', '&amp;', '<', '&lt;', '>', '&gt;');  local(%ctab) = ('&', '&amp;', '<', '&lt;', '>', '&gt;');
116  #  #
117  # fork and exec global(1) to avoid command substitutions in $pattern.  # fork and exec global(1) to avoid command substitutions in $pattern.
118    # The --fileid print the file id of the path at the head of each line.
119  #  #
120  open(PIPE, "-|") || exec '@globalpath@', '-x'.$flag.$iflag.$oflag, '-e', $pattern;  open(PIPE, "-|") || exec '@globalpath@', '-x'.$flag.$iflag.$oflag, '--fileid', '-e', $pattern;
121  if ($?) {        if ($?) {      
122          print "@error_begin@Error@error_end@\n";          print "@error_begin@Error@error_end@\n";
123          print "@message_begin@Cannot execute global. <a href='$htmlbase/mains.@normal_suffix@'>[return]</a>@message_end@\n";          print "@message_begin@Cannot execute global. <a href='$htmlbase/mains.@normal_suffix@'>[return]</a>@message_end@\n";
# Line 130  print "Following $words are matched to a Line 131  print "Following $words are matched to a
131  $cnt = 0;  $cnt = 0;
132  local($tag, $lno, $filename);  local($tag, $lno, $filename);
133  print "@verbatim_begin@\n";  print "@verbatim_begin@\n";
134  open(PIPEOUT, "| @gtagspath@ --convert");  #
135  if ($?) {        # Input format:
136          print "@error_begin@Error@error_end@\n";  #
137          print "@message_begin@Cannot execute gtags --convert. <a href='$htmlbase/mains.@normal_suffix@'>[return]</a>@message_end@\n";  # fid tag   lno filename
138          print "@body_end@\n";  # ---------------------------------------------
139          print "@page_end@\n";  # 100@main  32 ./main.c main(argc, argv)
140          exit 0;  #
 }  
 $| = 1; # flush buffer  
141  while (<PIPE>) {  while (<PIPE>) {
142          $cnt++;          $cnt++;
143          ($tag, $lno, $filename) = split;          ($fid_tag, $lno, $filename) = split;
144            ($fid, $tag) = split(/@/, $fid_tag);
145            s/^[0-9]+@//;
146          s/([&<>])/$ctab{$1}/ge;          s/([&<>])/$ctab{$1}/ge;
147          # " ./$filename " is replaced with file number by gtags --convert.          s!(^[^ \t]+)!<a href='$htmlbase/S/$fid.@HTML@#L$lno'>$1<\/a>!;
148          s!(^[^ \t]+)!<a href='$htmlbase/S/ ./$filename .@HTML@#L$lno'>$1<\/a>!;          print;
         print PIPEOUT;  
149  }  }
 $| = 1; # flush buffer  
150  close(PIPE);  close(PIPE);
 close(PIPEOUT);  
151  print "@verbatim_end@\n";  print "@verbatim_end@\n";
152  if ($cnt == 0) {  if ($cnt == 0) {
153          print "@message_begin@Pattern not found. <a href='$htmlbase/mains.@normal_suffix@'>[return]</a>@message_end@\n";          print "@message_begin@Pattern not found. <a href='$htmlbase/mains.@normal_suffix@'>[return]</a>@message_end@\n";

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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