kernel-doc (fc8e1ead9314cf0e0f1922e661428b93d3a50d88) | kernel-doc (6423133bdee0e07d1c2f8411cb3fe676c207ba33) |
---|---|
1#!/usr/bin/perl -w 2 3use strict; 4 5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## 6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## 7## Copyright (C) 2001 Simon Huggins ## 8## Copyright (C) 2005-2009 Randy Dunlap ## --- 1981 unchanged lines hidden (view full) --- 1990 return $text; 1991} 1992 1993sub process_file($) { 1994 my $file; 1995 my $identifier; 1996 my $func; 1997 my $descr; | 1#!/usr/bin/perl -w 2 3use strict; 4 5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## 6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## 7## Copyright (C) 2001 Simon Huggins ## 8## Copyright (C) 2005-2009 Randy Dunlap ## --- 1981 unchanged lines hidden (view full) --- 1990 return $text; 1991} 1992 1993sub process_file($) { 1994 my $file; 1995 my $identifier; 1996 my $func; 1997 my $descr; |
1998 my $in_purpose = 0; |
|
1998 my $initial_section_counter = $section_counter; 1999 2000 if (defined($ENV{'SRCTREE'})) { 2001 $file = "$ENV{'SRCTREE'}" . "/" . "@_"; 2002 } 2003 else { 2004 $file = "@_"; 2005 } --- 33 unchanged lines hidden (view full) --- 2039 $state = 2; 2040 if (/-(.*)/) { 2041 # strip leading/trailing/multiple spaces 2042 $descr= $1; 2043 $descr =~ s/^\s*//; 2044 $descr =~ s/\s*$//; 2045 $descr =~ s/\s+/ /; 2046 $declaration_purpose = xml_escape($descr); | 1999 my $initial_section_counter = $section_counter; 2000 2001 if (defined($ENV{'SRCTREE'})) { 2002 $file = "$ENV{'SRCTREE'}" . "/" . "@_"; 2003 } 2004 else { 2005 $file = "@_"; 2006 } --- 33 unchanged lines hidden (view full) --- 2040 $state = 2; 2041 if (/-(.*)/) { 2042 # strip leading/trailing/multiple spaces 2043 $descr= $1; 2044 $descr =~ s/^\s*//; 2045 $descr =~ s/\s*$//; 2046 $descr =~ s/\s+/ /; 2047 $declaration_purpose = xml_escape($descr); |
2048 $in_purpose = 1; |
|
2047 } else { 2048 $declaration_purpose = ""; 2049 } 2050 2051 if (($declaration_purpose eq "") && $verbose) { 2052 print STDERR "Warning(${file}:$.): missing initial short description on line:\n"; 2053 print STDERR $_; 2054 ++$warnings; --- 30 unchanged lines hidden (view full) --- 2085 print STDERR "Warning(${file}:$.): contents before sections\n"; 2086 ++$warnings; 2087 } 2088 dump_section($file, $section, xml_escape($contents)); 2089 $section = $section_default; 2090 } 2091 2092 $in_doc_sect = 1; | 2049 } else { 2050 $declaration_purpose = ""; 2051 } 2052 2053 if (($declaration_purpose eq "") && $verbose) { 2054 print STDERR "Warning(${file}:$.): missing initial short description on line:\n"; 2055 print STDERR $_; 2056 ++$warnings; --- 30 unchanged lines hidden (view full) --- 2087 print STDERR "Warning(${file}:$.): contents before sections\n"; 2088 ++$warnings; 2089 } 2090 dump_section($file, $section, xml_escape($contents)); 2091 $section = $section_default; 2092 } 2093 2094 $in_doc_sect = 1; |
2095 $in_purpose = 0; |
|
2093 $contents = $newcontents; 2094 if ($contents ne "") { 2095 while ((substr($contents, 0, 1) eq " ") || 2096 substr($contents, 0, 1) eq "\t") { 2097 $contents = substr($contents, 1); 2098 } 2099 $contents .= "\n"; 2100 } --- 13 unchanged lines hidden (view full) --- 2114 2115 $prototype = ""; 2116 $state = 3; 2117 $brcount = 0; 2118# print STDERR "end of doc comment, looking for prototype\n"; 2119 } elsif (/$doc_content/) { 2120 # miguel-style comment kludge, look for blank lines after 2121 # @parameter line to signify start of description | 2096 $contents = $newcontents; 2097 if ($contents ne "") { 2098 while ((substr($contents, 0, 1) eq " ") || 2099 substr($contents, 0, 1) eq "\t") { 2100 $contents = substr($contents, 1); 2101 } 2102 $contents .= "\n"; 2103 } --- 13 unchanged lines hidden (view full) --- 2117 2118 $prototype = ""; 2119 $state = 3; 2120 $brcount = 0; 2121# print STDERR "end of doc comment, looking for prototype\n"; 2122 } elsif (/$doc_content/) { 2123 # miguel-style comment kludge, look for blank lines after 2124 # @parameter line to signify start of description |
2122 if ($1 eq "" && 2123 ($section =~ m/^@/ || $section eq $section_context)) { 2124 dump_section($file, $section, xml_escape($contents)); 2125 $section = $section_default; 2126 $contents = ""; | 2125 if ($1 eq "") { 2126 if ($section =~ m/^@/ || $section eq $section_context) { 2127 dump_section($file, $section, xml_escape($contents)); 2128 $section = $section_default; 2129 $contents = ""; 2130 } else { 2131 $contents .= "\n"; 2132 } 2133 $in_purpose = 0; 2134 } elsif ($in_purpose == 1) { 2135 # Continued declaration purpose 2136 chomp($declaration_purpose); 2137 $declaration_purpose .= " " . xml_escape($1); |
2127 } else { 2128 $contents .= $1 . "\n"; 2129 } 2130 } else { 2131 # i dont know - bad line? ignore. 2132 print STDERR "Warning(${file}:$.): bad line: $_"; 2133 ++$warnings; 2134 } --- 84 unchanged lines hidden --- | 2138 } else { 2139 $contents .= $1 . "\n"; 2140 } 2141 } else { 2142 # i dont know - bad line? ignore. 2143 print STDERR "Warning(${file}:$.): bad line: $_"; 2144 ++$warnings; 2145 } --- 84 unchanged lines hidden --- |