kernel-doc (5a2dd72abdae75ea2960145e0549635ce4e0be96) kernel-doc (b4870bc5ee8c7a37541a3eb1208b5c76c13a078a)
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-2008 Randy Dunlap ##

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

1822 @sectionlist = ();
1823 $sectcheck = "";
1824 $struct_actual = "";
1825 $prototype = "";
1826
1827 $state = 0;
1828}
1829
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-2008 Randy Dunlap ##

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

1822 @sectionlist = ();
1823 $sectcheck = "";
1824 $struct_actual = "";
1825 $prototype = "";
1826
1827 $state = 0;
1828}
1829
1830sub syscall_munge() {
1831 my $void = 0;
1832
1833 $prototype =~ s@[\r\n\t]+@ @gos; # strip newlines/CR's/tabs
1834## if ($prototype =~ m/SYSCALL_DEFINE0\s*\(\s*(a-zA-Z0-9_)*\s*\)/) {
1835 if ($prototype =~ m/SYSCALL_DEFINE0/) {
1836 $void = 1;
1837## $prototype = "long sys_$1(void)";
1838 }
1839
1840 $prototype =~ s/SYSCALL_DEFINE.*\(/long sys_/; # fix return type & func name
1841 if ($prototype =~ m/long (sys_.*?),/) {
1842 $prototype =~ s/,/\(/;
1843 } elsif ($void) {
1844 $prototype =~ s/\)/\(void\)/;
1845 }
1846
1847 # now delete all of the odd-number commas in $prototype
1848 # so that arg types & arg names don't have a comma between them
1849 my $count = 0;
1850 my $len = length($prototype);
1851 if ($void) {
1852 $len = 0; # skip the for-loop
1853 }
1854 for (my $ix = 0; $ix < $len; $ix++) {
1855 if (substr($prototype, $ix, 1) eq ',') {
1856 $count++;
1857 if ($count % 2 == 1) {
1858 substr($prototype, $ix, 1) = ' ';
1859 }
1860 }
1861 }
1862}
1863
1830sub process_state3_function($$) {
1831 my $x = shift;
1832 my $file = shift;
1833
1834 $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line
1835
1836 if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#\s*define/)) {
1837 # do nothing
1838 }
1839 elsif ($x =~ /([^\{]*)/) {
1840 $prototype .= $1;
1841 }
1864sub process_state3_function($$) {
1865 my $x = shift;
1866 my $file = shift;
1867
1868 $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line
1869
1870 if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#\s*define/)) {
1871 # do nothing
1872 }
1873 elsif ($x =~ /([^\{]*)/) {
1874 $prototype .= $1;
1875 }
1876
1842 if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) {
1843 $prototype =~ s@/\*.*?\*/@@gos; # strip comments.
1844 $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
1845 $prototype =~ s@^\s+@@gos; # strip leading spaces
1877 if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) {
1878 $prototype =~ s@/\*.*?\*/@@gos; # strip comments.
1879 $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
1880 $prototype =~ s@^\s+@@gos; # strip leading spaces
1846 dump_function($prototype,$file);
1881 if ($prototype =~ /SYSCALL_DEFINE/) {
1882 syscall_munge();
1883 }
1884 dump_function($prototype, $file);
1847 reset_state();
1848 }
1849}
1850
1851sub process_state3_type($$) {
1852 my $x = shift;
1853 my $file = shift;
1854

--- 284 unchanged lines hidden ---
1885 reset_state();
1886 }
1887}
1888
1889sub process_state3_type($$) {
1890 my $x = shift;
1891 my $file = shift;
1892

--- 284 unchanged lines hidden ---