X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Fpmccabe2html;h=3f887adc7d1b7f2ff25cfea0840a438e911bc51b;hb=5c92acef552620a440dc134faf6d1f7fd14f825f;hp=ea3e262eae9044f829c4d90782871f63a051ace9;hpb=42095643379113b8f7eaf6b32a06521c78887331;p=gnulib.git diff --git a/build-aux/pmccabe2html b/build-aux/pmccabe2html index ea3e262ea..3f887adc7 100644 --- a/build-aux/pmccabe2html +++ b/build-aux/pmccabe2html @@ -1,8 +1,6 @@ -#!/bin/sh -exec awk -f "$0" "$@" -# pmccabe2html - pmccabe to html converter +# pmccabe2html - AWK script to convert pmccabe output to html -# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,16 +21,16 @@ exec awk -f "$0" "$@" # Typical Invocation is from a Makefile.am: # -# cyclo-$(PROJECT).html: +# cyclo-$(PACKAGE).html: # $(PMCCABE) ${top_srcdir}/lib/*.[ch] \ # | sort -nr \ # | $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \ # -v lang=html -v name="$(PACKAGE_NAME)" \ -# -v vcurl="http://git.savannah.gnu.org/gitweb/?p=$(PROJECT).git;a=blob;f=%FILENAME%;hb=HEAD" \ -# -v url="http://www.gnu.org/software/$(PROJECT)/" \ +# -v vcurl="http://git.savannah.gnu.org/gitweb/?p=$(PACKAGE).git;a=blob;f=%FILENAME%;hb=HEAD" \ +# -v url="http://www.gnu.org/software/$(PACKAGE)/" \ # -v css=${top_srcdir}/build-aux/pmccabe.css \ -# > tmp -# mv tmp $@ +# > $@-tmp +# mv $@-tmp $@ # # The variables available are: # lang output language, either 'html' or 'wiki' @@ -66,7 +64,7 @@ BEGIN { html_prolog = "Back to " package_name " Homepage

" } html_epilog = "
\ -Copyright (c) 2007, 2008 Free Software Foundation Inc." +Copyright (c) 2007, 2008 Free Software Foundation, Inc." html_doctype = "" html_comment = "" @@ -137,22 +135,22 @@ function html_fnc_table (caption, { print "" caption "" } - html_fnc_header(fname_p, - mcyclo_p, - cyclo_p, - num_statements_p, - num_lines_p, - first_line_p, + html_fnc_header(fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, file_p) for (nfnc = 1; nfnc < nfuncs; nfnc++) { html_fnc(nfnc, - fname_p, - mcyclo_p, - cyclo_p, - num_statements_p, - num_lines_p, - first_line_p, + fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, file_p) } print "" @@ -309,7 +307,7 @@ function html_fnc (nfun, if (mcyclo[nfun] > cyclo_high_max) { trclass="function_entry_untestable" - } + } else if (mcyclo[nfun] > cyclo_moderate_max) { trclass="function_entry_high" @@ -393,7 +391,7 @@ function html_fnc (nfun, { print file[nfun] } - + print "" @@ -411,7 +409,7 @@ function html_fnc (nfun, if (num_lines_p) { num_columns++ } if (first_line_p) { num_columns++ } if (file_p) { num_columns++ } - + print "" print "
" print "
"
@@ -421,7 +419,7 @@ function html_fnc (nfun,
                 sub(/\\/, ">", codeline)
                 sub(/&/, "&", codeline)
-                
+
                 print codeline
             }
             close(fname nfun "_fn.txt")
@@ -519,7 +517,7 @@ function html_function_cyclo ()
     print "Simple module, without much risk"
     print ""
     print ""
-    # Moderate 
+    # Moderate
     print ""
     print ""
     print " "
@@ -591,7 +589,7 @@ function wiki_function_cyclo ()
     print "==Details for all functions=="
 
     print "Used ranges:"
-    
+
     print "{| class =\"cyclo_ranges_table\""
     print "|-"
     print "| class=\"cyclo_ranges_header_entry\" | "
@@ -648,22 +646,22 @@ function wiki_fnc_table (caption,
     {
         print "|+" caption
     }
-    wiki_fnc_header(fname_p, 
-                    mcyclo_p, 
-                    cyclo_p, 
-                    num_statements_p, 
-                    num_lines_p, 
-                    first_line_p, 
+    wiki_fnc_header(fname_p,
+                    mcyclo_p,
+                    cyclo_p,
+                    num_statements_p,
+                    num_lines_p,
+                    first_line_p,
                     file_p)
     for (nfnc = 1; nfnc < nfuncs; nfnc++)
     {
         wiki_fnc(nfnc,
-                 fname_p, 
-                 mcyclo_p, 
-                 cyclo_p, 
-                 num_statements_p, 
-                 num_lines_p, 
-                 first_line_p, 
+                 fname_p,
+                 mcyclo_p,
+                 cyclo_p,
+                 num_statements_p,
+                 num_lines_p,
+                 first_line_p,
                  file_p)
     }
     print "|}"
@@ -726,7 +724,7 @@ function wiki_fnc (nfnc,
     if (mcyclo[nfnc] > cyclo_high_max)
     {
         trclass="cyclo_function_entry_untestable"
-    }   
+    }
     else if (mcyclo[nfnc] > cyclo_moderate_max)
     {
         trclass="cyclo_function_entry_high"
@@ -775,7 +773,7 @@ function wiki_fnc (nfnc,
             href = source_file_link_tmpl
             sub(/%FILENAME%/, file[nfnc], href)
         }
-        
+
         # Source file
         print "| class=\"cyclo_function_entry_filename\" |" \
             ((href != "") ? "[" href " " file[nfnc] "]" : "[" file[nfnc] "]")
@@ -840,7 +838,7 @@ END {
     }
 
     # Print prolog
-    if ((output_lang == "html") && 
+    if ((output_lang == "html") &&
         (html_prolog != ""))
     {
         print html_prolog
@@ -886,9 +884,9 @@ END {
             wiki_function_cyclo()
         }
     }
-    
+
     # Print epilog
-    if ((output_lang == "html") && 
+    if ((output_lang == "html") &&
         (html_epilog != ""))
     {
         print html_epilog