Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, October 15, 2026

Diff for scripts/shell/docbook/db-get-id between version 1.3 and 1.4

version 1.3, 2002/09/05 23:24:44 version 1.4, 2002/09/05 23:37:35
Line 5  BEGIN {
Line 5  BEGIN {
         last_tag  = "";          last_tag  = "";
         str       = "";          str       = "";
         desc      = "";          desc      = "";
         printf "# id-name\tfilename\tid-type\tdescription\n";          manpage   = "";
           printf "# id-name\tfilename\tmanpage\tid-type\tdescription\n";
   }
   
   function remove_tag(s, reg)
   {
                   sub(/\t+/, " ", s);
                   reg1 = sprintf("^.*<%s[^>]*> *", reg);
                   reg2 = sprintf(" *</%s>.*$", reg);
                   if (!sub(reg1, "", s)) { s = ""; }
                   if (!sub(reg2, "", s)) { s = ""; }
   
                   return s;
 }  }
   
 function compete_tag(reg)  function compete_tag(reg)
Line 20  function compete_tag(reg)
Line 32  function compete_tag(reg)
 #               printf "AFTER = '%s'\n", str;  #               printf "AFTER = '%s'\n", str;
         }          }
         if (str ~ reg && str ~ /id=['"]/ && desc == "") {          if (str ~ reg && str ~ /id=['"]/ && desc == "") {
                 desc = str;                  desc = remove_tag(str, reg);
                 sub(/\t+/, " ", desc);  
                 reg1 = sprintf("^.*<%s[^>]*> *", reg);  
                 reg2 = sprintf(" *</%s>.*$", reg);  
                 if (!sub(reg1, "", desc)) { desc = ""; }  
                 if (!sub(reg2, "", desc)) { desc = ""; }  
         }          }
   
 }  }
   
   /<refentrytitle>/ {
           manpage = remove_tag($0, "refentrytitle");
   }
   
 {  {
         if (last_tag != "") {          if (last_tag != "") {
                 str = sprintf("<%s %s", last_tag, $0); # join last notcompleted tag                  str = sprintf("<%s %s", last_tag, $0); # join last notcompleted tag
Line 59  function compete_tag(reg)
Line 70  function compete_tag(reg)
                                 if (b[j] ~ /id=['"]/) {                                  if (b[j] ~ /id=['"]/) {
                                         sub(/^id=['"]/, "", b[j]);                                          sub(/^id=['"]/, "", b[j]);
                                         sub(/['"]$/,    "", b[j]);                                          sub(/['"]$/,    "", b[j]);
                                         printf "%s\t%s\t%s\t%s\n", b[j], FILENAME, b[1], desc;  #                               In future manpage volume may be generated dynamicaly
                                           printf "%s\t%s\t%s(3)\t%s\t%s\n",
                                                   b[j], FILENAME, manpage, b[1], desc;
                                         desc = "";                                          desc = "";
                                 }                                  }
                         }                          }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top