kernel-doc (9c9193c49c1f1662b00476b3d0697a1be37c6b08) | kernel-doc (c099ff6989baf286da8eaed5c7b3d18ae60ea2e7) |
---|---|
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 ## --- 1791 unchanged lines hidden (view full) --- 1800 } 1801 print "\n"; 1802 } 1803} 1804 1805sub output_function_rst(%) { 1806 my %args = %{$_[0]}; 1807 my ($parameter, $section); | 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 ## --- 1791 unchanged lines hidden (view full) --- 1800 } 1801 print "\n"; 1802 } 1803} 1804 1805sub output_function_rst(%) { 1806 my %args = %{$_[0]}; 1807 my ($parameter, $section); |
1808 my $oldprefix = $lineprefix; |
|
1808 my $start; 1809 1810 print ".. c:function:: "; 1811 if ($args{'functiontype'} ne "") { 1812 $start = $args{'functiontype'} . " " . $args{'function'} . " ("; 1813 } else { 1814 $start = $args{'function'} . " ("; 1815 } --- 8 unchanged lines hidden (view full) --- 1824 $type = $args{'parametertypes'}{$parameter}; 1825 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1826 # pointer-to-function 1827 print $1 . $parameter . ") (" . $2; 1828 } else { 1829 print $type . " " . $parameter; 1830 } 1831 } | 1809 my $start; 1810 1811 print ".. c:function:: "; 1812 if ($args{'functiontype'} ne "") { 1813 $start = $args{'functiontype'} . " " . $args{'function'} . " ("; 1814 } else { 1815 $start = $args{'function'} . " ("; 1816 } --- 8 unchanged lines hidden (view full) --- 1825 $type = $args{'parametertypes'}{$parameter}; 1826 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1827 # pointer-to-function 1828 print $1 . $parameter . ") (" . $2; 1829 } else { 1830 print $type . " " . $parameter; 1831 } 1832 } |
1832 print ")\n\n " . $args{'purpose'} . "\n\n"; | 1833 print ")\n\n"; 1834 $lineprefix = " "; 1835 output_highlight_rst($args{'purpose'}); 1836 print "\n"; |
1833 1834 print ":Parameters:\n\n"; | 1837 1838 print ":Parameters:\n\n"; |
1839 $lineprefix = " "; |
|
1835 foreach $parameter (@{$args{'parameterlist'}}) { 1836 my $parameter_name = $parameter; 1837 #$parameter_name =~ s/\[.*//; 1838 $type = $args{'parametertypes'}{$parameter}; 1839 1840 if ($type ne "") { 1841 print " ``$type $parameter``\n"; 1842 } else { 1843 print " ``$parameter``\n"; 1844 } 1845 if (defined($args{'parameterdescs'}{$parameter_name}) && 1846 $args{'parameterdescs'}{$parameter_name} ne $undescribed) { | 1840 foreach $parameter (@{$args{'parameterlist'}}) { 1841 my $parameter_name = $parameter; 1842 #$parameter_name =~ s/\[.*//; 1843 $type = $args{'parametertypes'}{$parameter}; 1844 1845 if ($type ne "") { 1846 print " ``$type $parameter``\n"; 1847 } else { 1848 print " ``$parameter``\n"; 1849 } 1850 if (defined($args{'parameterdescs'}{$parameter_name}) && 1851 $args{'parameterdescs'}{$parameter_name} ne $undescribed) { |
1847 my $oldprefix = $lineprefix; 1848 $lineprefix = " "; | |
1849 output_highlight_rst($args{'parameterdescs'}{$parameter_name}); | 1852 output_highlight_rst($args{'parameterdescs'}{$parameter_name}); |
1850 $lineprefix = $oldprefix; | |
1851 } else { 1852 print "\n _undescribed_\n"; 1853 } 1854 print "\n"; 1855 } | 1853 } else { 1854 print "\n _undescribed_\n"; 1855 } 1856 print "\n"; 1857 } |
1858 1859 $lineprefix = $oldprefix; |
|
1856 output_section_rst(@_); 1857} 1858 1859sub output_section_rst(%) { 1860 my %args = %{$_[0]}; 1861 my $section; 1862 my $oldprefix = $lineprefix; 1863 $lineprefix = " "; --- 5 unchanged lines hidden (view full) --- 1869 } 1870 print "\n"; 1871 $lineprefix = $oldprefix; 1872} 1873 1874sub output_enum_rst(%) { 1875 my %args = %{$_[0]}; 1876 my ($parameter); | 1860 output_section_rst(@_); 1861} 1862 1863sub output_section_rst(%) { 1864 my %args = %{$_[0]}; 1865 my $section; 1866 my $oldprefix = $lineprefix; 1867 $lineprefix = " "; --- 5 unchanged lines hidden (view full) --- 1873 } 1874 print "\n"; 1875 $lineprefix = $oldprefix; 1876} 1877 1878sub output_enum_rst(%) { 1879 my %args = %{$_[0]}; 1880 my ($parameter); |
1881 my $oldprefix = $lineprefix; |
|
1877 my $count; 1878 my $name = "enum " . $args{'enum'}; 1879 1880 print "\n\n.. c:type:: " . $name . "\n\n"; | 1882 my $count; 1883 my $name = "enum " . $args{'enum'}; 1884 1885 print "\n\n.. c:type:: " . $name . "\n\n"; |
1881 print " " . $args{'purpose'} . "\n\n"; | 1886 $lineprefix = " "; 1887 output_highlight_rst($args{'purpose'}); 1888 print "\n"; |
1882 1883 print "..\n\n:Constants:\n\n"; | 1889 1890 print "..\n\n:Constants:\n\n"; |
1884 my $oldprefix = $lineprefix; | |
1885 $lineprefix = " "; 1886 foreach $parameter (@{$args{'parameterlist'}}) { 1887 print " `$parameter`\n"; 1888 if ($args{'parameterdescs'}{$parameter} ne $undescribed) { 1889 output_highlight_rst($args{'parameterdescs'}{$parameter}); 1890 } else { 1891 print " undescribed\n"; 1892 } 1893 print "\n"; 1894 } | 1891 $lineprefix = " "; 1892 foreach $parameter (@{$args{'parameterlist'}}) { 1893 print " `$parameter`\n"; 1894 if ($args{'parameterdescs'}{$parameter} ne $undescribed) { 1895 output_highlight_rst($args{'parameterdescs'}{$parameter}); 1896 } else { 1897 print " undescribed\n"; 1898 } 1899 print "\n"; 1900 } |
1901 |
|
1895 $lineprefix = $oldprefix; 1896 output_section_rst(@_); 1897} 1898 1899sub output_typedef_rst(%) { 1900 my %args = %{$_[0]}; 1901 my ($parameter); | 1902 $lineprefix = $oldprefix; 1903 output_section_rst(@_); 1904} 1905 1906sub output_typedef_rst(%) { 1907 my %args = %{$_[0]}; 1908 my ($parameter); |
1902 my $count; | 1909 my $oldprefix = $lineprefix; |
1903 my $name = "typedef " . $args{'typedef'}; 1904 1905 ### FIXME: should the name below contain "typedef" or not? 1906 print "\n\n.. c:type:: " . $name . "\n\n"; | 1910 my $name = "typedef " . $args{'typedef'}; 1911 1912 ### FIXME: should the name below contain "typedef" or not? 1913 print "\n\n.. c:type:: " . $name . "\n\n"; |
1907 print " " . $args{'purpose'} . "\n\n"; | 1914 $lineprefix = " "; 1915 output_highlight_rst($args{'purpose'}); 1916 print "\n"; |
1908 | 1917 |
1918 $lineprefix = $oldprefix; |
|
1909 output_section_rst(@_); 1910} 1911 1912sub output_struct_rst(%) { 1913 my %args = %{$_[0]}; 1914 my ($parameter); | 1919 output_section_rst(@_); 1920} 1921 1922sub output_struct_rst(%) { 1923 my %args = %{$_[0]}; 1924 my ($parameter); |
1925 my $oldprefix = $lineprefix; |
|
1915 my $name = $args{'type'} . " " . $args{'struct'}; 1916 1917 print "\n\n.. c:type:: " . $name . "\n\n"; | 1926 my $name = $args{'type'} . " " . $args{'struct'}; 1927 1928 print "\n\n.. c:type:: " . $name . "\n\n"; |
1918 print " " . $args{'purpose'} . "\n\n"; | 1929 $lineprefix = " "; 1930 output_highlight_rst($args{'purpose'}); 1931 print "\n"; |
1919 1920 print ":Definition:\n\n"; 1921 print " ::\n\n"; 1922 print " " . $args{'type'} . " " . $args{'struct'} . " {\n"; 1923 foreach $parameter (@{$args{'parameterlist'}}) { 1924 if ($parameter =~ /^#/) { 1925 print " " . "$parameter\n"; 1926 next; --- 12 unchanged lines hidden (view full) --- 1939 print " $1 $parameter$2;\n"; 1940 } else { 1941 print " " . $type . " " . $parameter . ";\n"; 1942 } 1943 } 1944 print " };\n\n"; 1945 1946 print ":Members:\n\n"; | 1932 1933 print ":Definition:\n\n"; 1934 print " ::\n\n"; 1935 print " " . $args{'type'} . " " . $args{'struct'} . " {\n"; 1936 foreach $parameter (@{$args{'parameterlist'}}) { 1937 if ($parameter =~ /^#/) { 1938 print " " . "$parameter\n"; 1939 next; --- 12 unchanged lines hidden (view full) --- 1952 print " $1 $parameter$2;\n"; 1953 } else { 1954 print " " . $type . " " . $parameter . ";\n"; 1955 } 1956 } 1957 print " };\n\n"; 1958 1959 print ":Members:\n\n"; |
1960 $lineprefix = " "; |
|
1947 foreach $parameter (@{$args{'parameterlist'}}) { 1948 ($parameter =~ /^#/) && next; 1949 1950 my $parameter_name = $parameter; 1951 $parameter_name =~ s/\[.*//; 1952 1953 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 1954 $type = $args{'parametertypes'}{$parameter}; 1955 print " `$type $parameter`" . "\n"; | 1961 foreach $parameter (@{$args{'parameterlist'}}) { 1962 ($parameter =~ /^#/) && next; 1963 1964 my $parameter_name = $parameter; 1965 $parameter_name =~ s/\[.*//; 1966 1967 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 1968 $type = $args{'parametertypes'}{$parameter}; 1969 print " `$type $parameter`" . "\n"; |
1956 my $oldprefix = $lineprefix; 1957 $lineprefix = " "; | |
1958 output_highlight_rst($args{'parameterdescs'}{$parameter_name}); | 1970 output_highlight_rst($args{'parameterdescs'}{$parameter_name}); |
1959 $lineprefix = $oldprefix; | |
1960 print "\n"; 1961 } 1962 print "\n"; | 1971 print "\n"; 1972 } 1973 print "\n"; |
1974 1975 $lineprefix = $oldprefix; |
|
1963 output_section_rst(@_); 1964} 1965 1966 1967## list mode output functions 1968 1969sub output_function_list(%) { 1970 my %args = %{$_[0]}; --- 1056 unchanged lines hidden --- | 1976 output_section_rst(@_); 1977} 1978 1979 1980## list mode output functions 1981 1982sub output_function_list(%) { 1983 my %args = %{$_[0]}; --- 1056 unchanged lines hidden --- |