linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / scripts / kernel-doc
index c9ca0c2..99fe4b7 100755 (executable)
@@ -253,7 +253,6 @@ my $lineprefix="";
 # 3 - scanning prototype.
 # 4 - documentation block
 my $state;
-my $in_doc_sect;
 
 #declaration types: can be
 # 'function', 'struct', 'union', 'enum', 'typedef'
@@ -1056,8 +1055,7 @@ sub output_struct_man(%) {
            # pointer-to-function
            print ".BI \"    ".$1."\" ".$parameter." \") (".$2.")"."\"\n;\n";
        } elsif ($type =~ m/^(.*?)\s*(:.*)/) {
-           # bitfield
-           print ".BI \"    ".$1."\ \" ".$parameter.$2." \""."\"\n;\n";
+           print ".BI \"    ".$1."\" ".$parameter.$2." \""."\"\n;\n";
        } else {
            $type =~ s/([^\*])$/$1 /;
            print ".BI \"    ".$type."\" ".$parameter." \""."\"\n;\n";
@@ -1066,7 +1064,7 @@ sub output_struct_man(%) {
     }
     print "};\n.br\n";
 
-    print ".SH Members\n";
+    print ".SH Arguments\n";
     foreach $parameter (@{$args{'parameterlist'}}) {
        ($parameter =~ /^#/) && next;
 
@@ -1119,10 +1117,7 @@ sub output_function_text(%) {
     my %args = %{$_[0]};
     my ($parameter, $section);
 
-    print "Name:\n\n";
-    print $args{'function'}." - ".$args{'purpose'}."\n";
-
-    print "\nSynopsis:\n\n";
+    print "Function:\n\n";
     my $start=$args{'functiontype'}." ".$args{'function'}." (";
     print $start;
     my $count = 0;
@@ -1173,7 +1168,6 @@ sub output_enum_text(%) {
     my $count;
     print "Enum:\n\n";
 
-    print "enum ".$args{'enum'}." - ".$args{'purpose'}."\n\n";
     print "enum ".$args{'enum'}." {\n";
     $count = 0;
     foreach $parameter (@{$args{'parameterlist'}}) {
@@ -1202,7 +1196,7 @@ sub output_typedef_text(%) {
     my $count;
     print "Typedef:\n\n";
 
-    print "typedef ".$args{'typedef'}." - ".$args{'purpose'}."\n";
+    print "typedef ".$args{'typedef'}."\n";
     output_section_text(@_);
 }
 
@@ -1211,7 +1205,7 @@ sub output_struct_text(%) {
     my %args = %{$_[0]};
     my ($parameter);
 
-    print $args{'type'}." ".$args{'struct'}." - ".$args{'purpose'}."\n\n";
+    print $args{'type'}." ".$args{'struct'}.":\n\n";
     print $args{'type'}." ".$args{'struct'}." {\n";
     foreach $parameter (@{$args{'parameterlist'}}) {
        if ($parameter =~ /^#/) {
@@ -1518,7 +1512,6 @@ sub dump_function($$) {
     $prototype =~ s/^asmlinkage +//;
     $prototype =~ s/^inline +//;
     $prototype =~ s/^__inline__ +//;
-    $prototype =~ s/__devinit +//;
     $prototype =~ s/^#define +//; #ak added
     $prototype =~ s/__attribute__ \(\([a-z,]*\)\)//;
 
@@ -1680,9 +1673,6 @@ sub process_state3_type($$) {
 # replace <, >, and &
 sub xml_escape($) {
        my $text = shift;
-       if (($output_mode eq "text") || ($output_mode eq "man")) {
-               return $text;
-       }
        $text =~ s/\&/\\\\\\amp;/g;
        $text =~ s/\</\\\\\\lt;/g;
        $text =~ s/\>/\\\\\\gt;/g;
@@ -1716,7 +1706,6 @@ sub process_file($) {
        if ($state == 0) {
            if (/$doc_start/o) {
                $state = 1;             # next line is always the function name
-               $in_doc_sect = 0;
            }
        } elsif ($state == 1) { # this line is the function name (always)
            if (/$doc_block/o) {
@@ -1767,20 +1756,12 @@ sub process_file($) {
                $newcontents = $2;
 
                if ($contents ne "") {
-                   if (!$in_doc_sect && $verbose) {
-                       print STDERR "Warning(${file}:$.): contents before sections\n";
-                       ++$warnings;
-                   }
                    dump_section($section, xml_escape($contents));
                    $section = $section_default;
                }
 
-               $in_doc_sect = 1;
                $contents = $newcontents;
                if ($contents ne "") {
-                   if (substr($contents, 0, 1) eq " ") {
-                       $contents = substr($contents, 1);
-                   }
                    $contents .= "\n";
                }
                $section = $newsection;
@@ -1795,7 +1776,7 @@ sub process_file($) {
                $prototype = "";
                $state = 3;
                $brcount = 0;
-#              print STDERR "end of doc comment, looking for prototype\n";
+#          print STDERR "end of doc comment, looking for prototype\n";
            } elsif (/$doc_content/) {
                # miguel-style comment kludge, look for blank lines after
                # @parameter line to signify start of description
@@ -1812,7 +1793,7 @@ sub process_file($) {
                print STDERR "Warning(${file}:$.): bad line: $_";
                ++$warnings;
            }
-       } elsif ($state == 3) { # scanning for function '{' (end of prototype)
+       } elsif ($state == 3) { # scanning for function { (end of prototype)
            if ($decl_type eq 'function') {
                process_state3_function($_, $file);
            } else {