kernel-doc (d37c43ce1975c1c3f28064bf3ebd2876e177bad8) kernel-doc (82801d065b4915d030e7f63212d146a75042aa91)
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-2012 Randy Dunlap ##

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

1826 print $lineprefix . $line . "\n";
1827 }
1828}
1829
1830sub output_function_rst(%) {
1831 my %args = %{$_[0]};
1832 my ($parameter, $section);
1833 my $oldprefix = $lineprefix;
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-2012 Randy Dunlap ##

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

1826 print $lineprefix . $line . "\n";
1827 }
1828}
1829
1830sub output_function_rst(%) {
1831 my %args = %{$_[0]};
1832 my ($parameter, $section);
1833 my $oldprefix = $lineprefix;
1834 my $start;
1834 my $start = "";
1835
1835
1836 print ".. c:function:: ";
1836 if ($args{'typedef'}) {
1837 print ".. c:type:: ". $args{'function'} . "\n\n";
1838 print_lineno($declaration_start_line);
1839 print " **Typedef**: ";
1840 $lineprefix = "";
1841 output_highlight_rst($args{'purpose'});
1842 $start = "\n\n**Syntax**\n\n ``";
1843 } else {
1844 print ".. c:function:: ";
1845 }
1837 if ($args{'functiontype'} ne "") {
1846 if ($args{'functiontype'} ne "") {
1838 $start = $args{'functiontype'} . " " . $args{'function'} . " (";
1847 $start .= $args{'functiontype'} . " " . $args{'function'} . " (";
1839 } else {
1848 } else {
1840 $start = $args{'function'} . " (";
1849 $start .= $args{'function'} . " (";
1841 }
1842 print $start;
1843
1844 my $count = 0;
1845 foreach my $parameter (@{$args{'parameterlist'}}) {
1846 if ($count ne 0) {
1847 print ", ";
1848 }
1849 $count++;
1850 $type = $args{'parametertypes'}{$parameter};
1851
1852 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1853 # pointer-to-function
1854 print $1 . $parameter . ") (" . $2;
1855 } else {
1856 print $type . " " . $parameter;
1857 }
1858 }
1850 }
1851 print $start;
1852
1853 my $count = 0;
1854 foreach my $parameter (@{$args{'parameterlist'}}) {
1855 if ($count ne 0) {
1856 print ", ";
1857 }
1858 $count++;
1859 $type = $args{'parametertypes'}{$parameter};
1860
1861 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1862 # pointer-to-function
1863 print $1 . $parameter . ") (" . $2;
1864 } else {
1865 print $type . " " . $parameter;
1866 }
1867 }
1859 print ")\n\n";
1860 print_lineno($declaration_start_line);
1861 $lineprefix = " ";
1862 output_highlight_rst($args{'purpose'});
1863 print "\n";
1868 if ($args{'typedef'}) {
1869 print ");``\n\n";
1870 } else {
1871 print ")\n\n";
1872 print_lineno($declaration_start_line);
1873 $lineprefix = " ";
1874 output_highlight_rst($args{'purpose'});
1875 print "\n";
1876 }
1864
1865 print "**Parameters**\n\n";
1866 $lineprefix = " ";
1867 foreach $parameter (@{$args{'parameterlist'}}) {
1868 my $parameter_name = $parameter;
1869 #$parameter_name =~ s/\[.*//;
1870 $type = $args{'parametertypes'}{$parameter};
1871

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

2198 $declaration_name = $2;
2199 my $args = $3;
2200
2201 create_parameterlist($args, ',', $file);
2202
2203 output_declaration($declaration_name,
2204 'function',
2205 {'function' => $declaration_name,
1877
1878 print "**Parameters**\n\n";
1879 $lineprefix = " ";
1880 foreach $parameter (@{$args{'parameterlist'}}) {
1881 my $parameter_name = $parameter;
1882 #$parameter_name =~ s/\[.*//;
1883 $type = $args{'parametertypes'}{$parameter};
1884

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

2211 $declaration_name = $2;
2212 my $args = $3;
2213
2214 create_parameterlist($args, ',', $file);
2215
2216 output_declaration($declaration_name,
2217 'function',
2218 {'function' => $declaration_name,
2219 'typedef' => 1,
2206 'module' => $modulename,
2207 'functiontype' => $return_type,
2208 'parameterlist' => \@parameterlist,
2209 'parameterdescs' => \%parameterdescs,
2210 'parametertypes' => \%parametertypes,
2211 'sectionlist' => \@sectionlist,
2212 'sections' => \%sections,
2213 'purpose' => $declaration_purpose

--- 912 unchanged lines hidden ---
2220 'module' => $modulename,
2221 'functiontype' => $return_type,
2222 'parameterlist' => \@parameterlist,
2223 'parameterdescs' => \%parameterdescs,
2224 'parametertypes' => \%parametertypes,
2225 'sectionlist' => \@sectionlist,
2226 'sections' => \%sections,
2227 'purpose' => $declaration_purpose

--- 912 unchanged lines hidden ---