"Fossies" - the Fresh Open Source Software Archive

Member "mod_ftp-0.9.6/build/addloadexample.awk" (18 Dec 2007, 933 Bytes) of package /linux/www/apache_httpd_modules/old/mod_ftp-0.9.6-beta.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 # Invoke as awk addloadexample.awk
    2 
    3 BEGIN {
    4   lms = 0;
    5 } 
    6 
    7 tolower($0) ~ /^[# \t]*loadmodule[ \t]/ {
    8   if ( $2 == MODULE "_module" ) {
    9     print "LoadModule " MODULE "_module " LIBPATH "/mod_" MODULE DSO;
   10     lms = 2;
   11     next;
   12   }
   13   # test $3 since # LoadModule is split into two tokens
   14   else if ( $3 == MODULE "_module" ) {
   15     print $1 "LoadModule " MODULE "_module " LIBPATH "/mod_" MODULE DSO;
   16     lms = 2;
   17     next;
   18   }
   19   else if ( ! lms ) lms = 1;
   20 }
   21 
   22 $0 ~ /^[ \t]*$/ && lms == 1 {
   23   print "LoadModule " MODULE "_module " LIBPATH "/mod_" MODULE DSO;
   24   lms = 2;
   25 } 
   26 
   27 tolower($0) ~ /^[# \t]*include[ \t]/ && $NF == EXAMPLECONF {
   28   lms = 3;
   29 }
   30 
   31 { print }
   32 
   33 END {
   34   if ( lms < 3 ) { 
   35     if ( ! /^[ \t]*$/ ) print "";
   36     if ( lms < 2 ) { 
   37       print "LoadModule " MODULE "_module " LIBPATH "/mod_" MODULE DSO;
   38       print "";
   39     }
   40     print "# Example mod_" MODULE " configuration";
   41     print "#Include " EXAMPLECONF "\n";
   42   }
   43 }
   44