diff options
author | Fred Drake <fdrake@acm.org> | 2002-04-15 20:48:40 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-04-15 20:48:40 (GMT) |
commit | 34adb8a8ec035afef6bbef0607ad48ed0973f838 (patch) | |
tree | edf273940d28df33cbcc2086f00b31b824dd5077 /Doc/perl/python.perl | |
parent | 1251b0eb242d313d778538ce55888c11bfa8b678 (diff) | |
download | cpython-34adb8a8ec035afef6bbef0607ad48ed0973f838.zip cpython-34adb8a8ec035afef6bbef0607ad48ed0973f838.tar.gz cpython-34adb8a8ec035afef6bbef0607ad48ed0973f838.tar.bz2 |
Separate out a \cfuncline macro from the cfuncdesc environment.
This matches many other of the *desc environments, and is useful when
multiple functions share a description.
Diffstat (limited to 'Doc/perl/python.perl')
-rw-r--r-- | Doc/perl/python.perl | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl index 515b1e8..5d33a6b 100644 --- a/Doc/perl/python.perl +++ b/Doc/perl/python.perl @@ -907,16 +907,29 @@ sub get_refcount{ $TLSTART = '<span class="typelabel">'; $TLEND = '</span>'; -sub do_env_cfuncdesc{ - local($_) = @_; - my $return_type = next_argument(); - my $function_name = next_argument(); - my $arg_list = next_argument(); +sub cfuncline_helper{ + my ($type, $name, $args) = @_; my $idx = make_str_index_entry( - "<tt class=\"cfunction\">$function_name()</tt>" . get_indexsubitem()); + "<tt class=\"cfunction\">$name()</tt>" . get_indexsubitem()); $idx =~ s/ \(.*\)//; $idx =~ s/\(\)//; # ???? - why both of these? - my $result_rc = get_refcount($function_name, ''); + return "$type <b>$idx</b>(<var>$args</var>)"; +} +sub do_cmd_cfuncline{ + local($_) = @_; + my $type = next_argument(); + my $name = next_argument(); + my $args = next_argument(); + my $siginfo = cfuncline_helper($type, $name, $args); + return "<dt>$siginfo\n<dd>" . $_; +} +sub do_env_cfuncdesc{ + local($_) = @_; + my $type = next_argument(); + my $name = next_argument(); + my $args = next_argument(); + my $siginfo = cfuncline_helper($type, $name, $args); + my $result_rc = get_refcount($name, ''); my $rcinfo = ''; if ($result_rc eq '+1') { $rcinfo = 'New reference'; @@ -933,7 +946,7 @@ sub do_env_cfuncdesc{ . "\n <span class=\"value\">$rcinfo.</span>" . "\n</div>"); } - return "<dl><dt>$return_type <b>$idx</b>(<var>$arg_list</var>)\n<dd>" + return "<dl><dt>$siginfo\n<dd>" . $rcinfo . $_ . '</dl>'; |