kernel-doc (e8ebb853eb5751168cfd87c706fb1c38e053d4fb) | kernel-doc (d3c55a710f95e11e2369a57cb53d4a7f3280aa57) |
---|---|
1#!/usr/bin/env perl 2# SPDX-License-Identifier: GPL-2.0 3# vim: softtabstop=4 4 5use warnings; 6use strict; 7 8## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## --- 808 unchanged lines hidden (view full) --- 817} 818 819sub output_function_rst(%) { 820 my %args = %{$_[0]}; 821 my ($parameter, $section); 822 my $oldprefix = $lineprefix; 823 my $is_macro = 0; 824 | 1#!/usr/bin/env perl 2# SPDX-License-Identifier: GPL-2.0 3# vim: softtabstop=4 4 5use warnings; 6use strict; 7 8## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## --- 808 unchanged lines hidden (view full) --- 817} 818 819sub output_function_rst(%) { 820 my %args = %{$_[0]}; 821 my ($parameter, $section); 822 my $oldprefix = $lineprefix; 823 my $is_macro = 0; 824 |
825 my $signature = ""; 826 if ($args{'functiontype'} ne "") { 827 $signature = $args{'functiontype'} . " " . $args{'function'} . " ("; 828 } else { 829 $signature = $args{'function'} . " ("; 830 } 831 832 my $count = 0; 833 foreach my $parameter (@{$args{'parameterlist'}}) { 834 if ($count ne 0) { 835 $signature .= ", "; 836 } 837 $count++; 838 $type = $args{'parametertypes'}{$parameter}; 839 840 if ($type =~ m/$function_pointer/) { 841 # pointer-to-function 842 $signature .= $1 . $parameter . ") (" . $2 . ")"; 843 } else { 844 $signature .= $type; 845 } 846 } 847 848 $signature .= ")"; 849 |
|
825 if ($sphinx_major < 3) { 826 if ($args{'typedef'}) { 827 print ".. c:type:: ". $args{'function'} . "\n\n"; 828 print_lineno($declaration_start_line); 829 print " **Typedef**: "; 830 $lineprefix = ""; 831 output_highlight_rst($args{'purpose'}); 832 print "\n\n**Syntax**\n\n ``"; --- 14 unchanged lines hidden (view full) --- 847 print " **Typedef**: "; 848 $lineprefix = ""; 849 output_highlight_rst($args{'purpose'}); 850 print "\n\n**Syntax**\n\n ``"; 851 } else { 852 print "``" if ($is_macro); 853 } 854 } | 850 if ($sphinx_major < 3) { 851 if ($args{'typedef'}) { 852 print ".. c:type:: ". $args{'function'} . "\n\n"; 853 print_lineno($declaration_start_line); 854 print " **Typedef**: "; 855 $lineprefix = ""; 856 output_highlight_rst($args{'purpose'}); 857 print "\n\n**Syntax**\n\n ``"; --- 14 unchanged lines hidden (view full) --- 872 print " **Typedef**: "; 873 $lineprefix = ""; 874 output_highlight_rst($args{'purpose'}); 875 print "\n\n**Syntax**\n\n ``"; 876 } else { 877 print "``" if ($is_macro); 878 } 879 } |
855 if ($args{'functiontype'} ne "") { 856 print $args{'functiontype'} . " " . $args{'function'} . " ("; 857 } else { 858 print $args{'function'} . " ("; 859 } | |
860 | 880 |
861 my $count = 0; 862 foreach my $parameter (@{$args{'parameterlist'}}) { 863 if ($count ne 0) { 864 print ", "; 865 } 866 $count++; 867 $type = $args{'parametertypes'}{$parameter}; | 881 print $signature; |
868 | 882 |
869 if ($type =~ m/$function_pointer/) { 870 # pointer-to-function 871 print $1 . $parameter . ") (" . $2 . ")"; 872 } else { 873 print $type; 874 } 875 } | |
876 if ($is_macro) { | 883 if ($is_macro) { |
877 print ")``\n\n"; | 884 print "``\n\n"; |
878 } else { | 885 } else { |
879 print ")\n\n"; | 886 print "\n\n"; |
880 } 881 if (!$args{'typedef'}) { 882 print_lineno($declaration_start_line); 883 $lineprefix = " "; 884 output_highlight_rst($args{'purpose'}); 885 print "\n"; 886 } 887 --- 1655 unchanged lines hidden --- | 887 } 888 if (!$args{'typedef'}) { 889 print_lineno($declaration_start_line); 890 $lineprefix = " "; 891 output_highlight_rst($args{'purpose'}); 892 print "\n"; 893 } 894 --- 1655 unchanged lines hidden --- |