kernel-doc (5ef09c96d48b41a55121df1b57404f68d7e4e5f1) kernel-doc (6e9e415854c15dbf920481eb1d245988e405bbc0)
1#!/usr/bin/env perl
2# SPDX-License-Identifier: GPL-2.0
3
4use warnings;
5use strict;
6
7## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
8## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##

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

912 }
913}
914
915sub output_function_rst(%) {
916 my %args = %{$_[0]};
917 my ($parameter, $section);
918 my $oldprefix = $lineprefix;
919 my $start = "";
1#!/usr/bin/env perl
2# SPDX-License-Identifier: GPL-2.0
3
4use warnings;
5use strict;
6
7## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
8## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##

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

912 }
913}
914
915sub output_function_rst(%) {
916 my %args = %{$_[0]};
917 my ($parameter, $section);
918 my $oldprefix = $lineprefix;
919 my $start = "";
920 my $is_macro = 0;
920
921 if ($sphinx_major < 3) {
922 if ($args{'typedef'}) {
923 print ".. c:type:: ". $args{'function'} . "\n\n";
924 print_lineno($declaration_start_line);
925 print " **Typedef**: ";
926 $lineprefix = "";
927 output_highlight_rst($args{'purpose'});
928 $start = "\n\n**Syntax**\n\n ``";
921
922 if ($sphinx_major < 3) {
923 if ($args{'typedef'}) {
924 print ".. c:type:: ". $args{'function'} . "\n\n";
925 print_lineno($declaration_start_line);
926 print " **Typedef**: ";
927 $lineprefix = "";
928 output_highlight_rst($args{'purpose'});
929 $start = "\n\n**Syntax**\n\n ``";
930 $is_macro = 1;
929 } else {
930 print ".. c:function:: ";
931 }
932 } else {
931 } else {
932 print ".. c:function:: ";
933 }
934 } else {
933 print ".. c:macro:: ". $args{'function'} . "\n\n";
935 if ($args{'typedef'} || $args{'functiontype'} eq "") {
936 $is_macro = 1;
937 print ".. c:macro:: ". $args{'function'} . "\n\n";
938 } else {
939 print ".. c:function:: ";
940 }
934
935 if ($args{'typedef'}) {
936 print_lineno($declaration_start_line);
937 print " **Typedef**: ";
938 $lineprefix = "";
939 output_highlight_rst($args{'purpose'});
940 $start = "\n\n**Syntax**\n\n ``";
941 } else {
941
942 if ($args{'typedef'}) {
943 print_lineno($declaration_start_line);
944 print " **Typedef**: ";
945 $lineprefix = "";
946 output_highlight_rst($args{'purpose'});
947 $start = "\n\n**Syntax**\n\n ``";
948 } else {
942 print "``";
949 print "``" if ($is_macro);
943 }
944 }
945 if ($args{'functiontype'} ne "") {
946 $start .= $args{'functiontype'} . " " . $args{'function'} . " (";
947 } else {
948 $start .= $args{'function'} . " (";
949 }
950 print $start;

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

959
960 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
961 # pointer-to-function
962 print $1 . $parameter . ") (" . $2 . ")";
963 } else {
964 print $type;
965 }
966 }
950 }
951 }
952 if ($args{'functiontype'} ne "") {
953 $start .= $args{'functiontype'} . " " . $args{'function'} . " (";
954 } else {
955 $start .= $args{'function'} . " (";
956 }
957 print $start;

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

966
967 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
968 # pointer-to-function
969 print $1 . $parameter . ") (" . $2 . ")";
970 } else {
971 print $type;
972 }
973 }
967 if ($args{'typedef'}) {
968 print ");``\n\n";
974 if ($is_macro) {
975 print ")``\n\n";
969 } else {
976 } else {
970 if ($sphinx_major < 3) {
971 print ")\n\n";
972 } else {
973 print ")``\n";
974 }
977 print ")\n\n";
978 }
979 if (!$args{'typedef'}) {
975 print_lineno($declaration_start_line);
976 $lineprefix = " ";
977 output_highlight_rst($args{'purpose'});
978 print "\n";
979 }
980
981 print "**Parameters**\n\n";
982 $lineprefix = " ";

--- 1443 unchanged lines hidden ---
980 print_lineno($declaration_start_line);
981 $lineprefix = " ";
982 output_highlight_rst($args{'purpose'});
983 print "\n";
984 }
985
986 print "**Parameters**\n\n";
987 $lineprefix = " ";

--- 1443 unchanged lines hidden ---