"Fossies" - the Fresh Open Source Software Archive

Member "links-1.03/wipe-out-ssl.awk" (31 Dec 2000, 408 Bytes) of archive /linux/www/links-1.03.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) (G)AWK source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/awk -f
    2 BEGIN {
    3     iflevel = 0;
    4 }
    5 
    6 {
    7     if (!iflevel) {
    8         if ($1 == "#ifdef" && $2 == "HAVE_SSL") iflevel = 1;
    9         else print $0;
   10     } else {
   11         if (iflevel == 1 && ($1 == "#else" || $1 == "#elif")) {
   12             iflevel = 0;
   13             if ($1 == "#else") print "#if 1";
   14             else {
   15                 print "#if 0";
   16                 print $0;
   17             }
   18         }
   19         if ($1 == "#if" || $1 == "#ifdef" || $1 == "#ifndef") iflevel++;
   20         if ($1 == "#endif") iflevel--;
   21     }
   22 }