kernel-doc (232acbcf5304c29f5bb03b0dddeaefd0f98ef45e) kernel-doc (850622dfaf3d62907c96707773e0f8e84b3c0c06)
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## ##

--- 239 unchanged lines hidden (view full) ---

248
249# states
250# 0 - normal code
251# 1 - looking for function name
252# 2 - scanning field start.
253# 3 - scanning prototype.
254# 4 - documentation block
255my $state;
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## ##

--- 239 unchanged lines hidden (view full) ---

248
249# states
250# 0 - normal code
251# 1 - looking for function name
252# 2 - scanning field start.
253# 3 - scanning prototype.
254# 4 - documentation block
255my $state;
256my $in_doc_sect;
256
257#declaration types: can be
258# 'function', 'struct', 'union', 'enum', 'typedef'
259my $decl_type;
260
261my $doc_special = "\@\%\$\&";
262
263my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.

--- 1437 unchanged lines hidden (view full) ---

1701 return;
1702 }
1703
1704 $section_counter = 0;
1705 while (<IN>) {
1706 if ($state == 0) {
1707 if (/$doc_start/o) {
1708 $state = 1; # next line is always the function name
257
258#declaration types: can be
259# 'function', 'struct', 'union', 'enum', 'typedef'
260my $decl_type;
261
262my $doc_special = "\@\%\$\&";
263
264my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.

--- 1437 unchanged lines hidden (view full) ---

1702 return;
1703 }
1704
1705 $section_counter = 0;
1706 while (<IN>) {
1707 if ($state == 0) {
1708 if (/$doc_start/o) {
1709 $state = 1; # next line is always the function name
1710 $in_doc_sect = 0;
1709 }
1710 } elsif ($state == 1) { # this line is the function name (always)
1711 if (/$doc_block/o) {
1712 $state = 4;
1713 $contents = "";
1714 if ( $1 eq "" ) {
1715 $section = $section_intro;
1716 } else {

--- 34 unchanged lines hidden (view full) ---

1751 $state = 0;
1752 }
1753 } elsif ($state == 2) { # look for head: lines, and include content
1754 if (/$doc_sect/o) {
1755 $newsection = $1;
1756 $newcontents = $2;
1757
1758 if ($contents ne "") {
1711 }
1712 } elsif ($state == 1) { # this line is the function name (always)
1713 if (/$doc_block/o) {
1714 $state = 4;
1715 $contents = "";
1716 if ( $1 eq "" ) {
1717 $section = $section_intro;
1718 } else {

--- 34 unchanged lines hidden (view full) ---

1753 $state = 0;
1754 }
1755 } elsif ($state == 2) { # look for head: lines, and include content
1756 if (/$doc_sect/o) {
1757 $newsection = $1;
1758 $newcontents = $2;
1759
1760 if ($contents ne "") {
1761 if (!$in_doc_sect && $verbose) {
1762 print STDERR "Warning(${file}:$.): contents before sections\n";
1763 ++$warnings;
1764 }
1759 dump_section($section, xml_escape($contents));
1760 $section = $section_default;
1761 }
1762
1765 dump_section($section, xml_escape($contents));
1766 $section = $section_default;
1767 }
1768
1769 $in_doc_sect = 1;
1763 $contents = $newcontents;
1764 if ($contents ne "") {
1765 if (substr($contents, 0, 1) eq " ") {
1766 $contents = substr($contents, 1);
1767 }
1768 $contents .= "\n";
1769 }
1770 $section = $newsection;

--- 116 unchanged lines hidden ---
1770 $contents = $newcontents;
1771 if ($contents ne "") {
1772 if (substr($contents, 0, 1) eq " ") {
1773 $contents = substr($contents, 1);
1774 }
1775 $contents .= "\n";
1776 }
1777 $section = $newsection;

--- 116 unchanged lines hidden ---