diff options
| author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-10-08 15:14:45 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-10-10 09:29:06 -0400 |
| commit | 837664528e17380cfacfb766de37df31572f07a0 (patch) | |
| tree | 1af084c03541d763bfef0b7b49bb61abaafe8e2e /scripts/kernel-doc | |
| parent | 3a80a766328fe73df5951639b5c9013ddba6efec (diff) | |
kernel-doc: better format typedef function output
A typedef function looks more likely a function and not a
normal typedef. Change the code to use the output_function_*,
in order to properly parse the function prototype parameters.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'scripts/kernel-doc')
| -rwxr-xr-x | scripts/kernel-doc | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 55ce47ffa02d..0276d2b5eefe 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -1869,24 +1869,37 @@ sub dump_typedef($$) { | |||
| 1869 | my $file = shift; | 1869 | my $file = shift; |
| 1870 | 1870 | ||
| 1871 | $x =~ s@/\*.*?\*/@@gos; # strip comments. | 1871 | $x =~ s@/\*.*?\*/@@gos; # strip comments. |
| 1872 | while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) { | ||
| 1873 | $x =~ s/\(*.\)\s*;$/;/; | ||
| 1874 | $x =~ s/\[*.\]\s*;$/;/; | ||
| 1875 | } | ||
| 1876 | 1872 | ||
| 1877 | if ($x =~ /typedef.*\s+(\w+)\s*;/) { | 1873 | # Parse function prototypes |
| 1878 | $declaration_name = $1; | 1874 | if ($x =~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/) { |
| 1875 | # Function typedefs | ||
| 1876 | $return_type = $1; | ||
| 1877 | $declaration_name = $2; | ||
| 1878 | my $args = $3; | ||
| 1879 | |||
| 1880 | create_parameterlist($args, ',', $file); | ||
| 1879 | 1881 | ||
| 1880 | output_declaration($declaration_name, | 1882 | output_declaration($declaration_name, |
| 1881 | 'typedef', | 1883 | 'function', |
| 1882 | {'typedef' => $declaration_name, | 1884 | {'function' => $declaration_name, |
| 1883 | 'module' => $modulename, | 1885 | 'module' => $modulename, |
| 1886 | 'functiontype' => $return_type, | ||
| 1887 | 'parameterlist' => \@parameterlist, | ||
| 1888 | 'parameterdescs' => \%parameterdescs, | ||
| 1889 | 'parametertypes' => \%parametertypes, | ||
| 1884 | 'sectionlist' => \@sectionlist, | 1890 | 'sectionlist' => \@sectionlist, |
| 1885 | 'sections' => \%sections, | 1891 | 'sections' => \%sections, |
| 1886 | 'purpose' => $declaration_purpose | 1892 | 'purpose' => $declaration_purpose |
| 1887 | }); | 1893 | }); |
| 1894 | return; | ||
| 1895 | } | ||
| 1896 | |||
| 1897 | while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) { | ||
| 1898 | $x =~ s/\(*.\)\s*;$/;/; | ||
| 1899 | $x =~ s/\[*.\]\s*;$/;/; | ||
| 1888 | } | 1900 | } |
| 1889 | elsif ($x =~ /typedef\s+\w+\s*\(\*\s*(\w\S+)\s*\)\s*\(/) { # functions | 1901 | |
| 1902 | if ($x =~ /typedef.*\s+(\w+)\s*;/) { | ||
| 1890 | $declaration_name = $1; | 1903 | $declaration_name = $1; |
| 1891 | 1904 | ||
| 1892 | output_declaration($declaration_name, | 1905 | output_declaration($declaration_name, |
