Skip to content

Commit d96de58

Browse files
committed
perlapi: PL_check and PL_hexdigit are arrays not macros
This fact is important to Devel::PPPort. It means autodoc has to now recognize the @ flag. And embed.fnc is updated to document this flag
1 parent 12769b2 commit d96de58

File tree

4 files changed

+33
-28
lines changed

4 files changed

+33
-28
lines changed

autodoc.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
use warnings;
7575

7676
my $known_flags_re =
77-
qr/[aA bC dD eE fF Gh iI mM nN oO pP rR sS T uU vW xX y;#?]/xx;
77+
qr/[ aA bC dD eE fF Gh iI mM nN oO pP rR sS T uU vW xX y ;@#? ] /xx;
7878

7979
# Flags that don't apply to this program, like implementation details.
8080
my $irrelevant_flags_re = qr/[ab eE G iI P rR vX?]/xx;
@@ -537,6 +537,7 @@ sub check_and_add_proto_defn {
537537
}
538538

539539
$flags .= "m" if $flags =~ /M/;
540+
$flags .= "U" if $flags =~ /@/; # No usage output for @arrays
540541

541542
my @munged_args= $args_ref->@*;
542543
s/\b(?:NN|NULLOK)\b\s+//g for @munged_args;

embed.fnc

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
: This file is known to be processed by regen/embed.pl, autodoc.pl,
66
: makedef.pl, Devel::PPPort, and porting/diag.t.
77
:
8-
: This file contains entries for various functions and macros defined by perl.
9-
: Each entry includes the name, parameters, and various attributes about it.
10-
: In most functions listed here, the name is a short name, and the function's
11-
: real name is the short one, prefixed by either 'Perl_' (for publicly visible
12-
: functions) or 'S_' (for internal-to-a-file static ones). In many instances a
13-
: macro is defined that is the name in this file, and which expands to call the
14-
: real (full) name, with any appropriate thread context paramaters, thus hiding
15-
: that detail from the typical code.
8+
: This file contains entries for various functions, macros, typedefs, and
9+
: arrays defined by perl. Each entry includes the name, parameters, and
10+
: various attributes about it. In most functions listed here, the name is a
11+
: short name, and the function's real name is the short one, prefixed by either
12+
: 'Perl_' (for publicly visible functions) or 'S_' (for internal-to-a-file
13+
: static ones). In many instances a macro is defined that is the name in this
14+
: file, and which expands to call the real (full) name, with any appropriate
15+
: thread context paramaters, thus hiding that detail from the typical code.
1616
:
1717
: Many macros (as opposed to functions) listed here are the complete full name,
1818
: though we may want to start converting those to have full names.
@@ -140,27 +140,27 @@
140140
: =for apidoc_item name ...
141141
: =for apidoc_defn name ...
142142
:
143-
: The purpose of these lines is to furnish documentation for functions and
144-
: macros. The lines tend to be placed near the source for the item they
143+
: The purpose of these lines is to furnish documentation for functions,
144+
: macros, etc. The lines tend to be placed near the source for the item they
145145
: describe. autodoc.pl is run as part of the standard build process to
146146
: extract this documentation and build either perlapi.pod (from the elements
147147
: that are flagged as A in this file), or perlintern.pod (from the other
148148
: elements.
149149
:
150-
: Functions need to be specified in this file, but macros may not necessarily
151-
: be. The information in this file is sufficient to generate a usage line for
152-
: the element to be documented; otherwise that information needs to be
153-
: specified in the apidoc-ish lines.
154-
:
155-
: 'apidoc_defn' was added to supplement, for macros, the information in this
156-
: file. It is designed to be placed at the point of definition of the macro
157-
: it is for, so that the information can easily be checked for correctness,
158-
: and you know at a glance that the macro actually has documentation. It
159-
: doesn't by itself create any documentation; instead the other apidoc lines
160-
: pull in information specified by these lines. Many of the lines in this
161-
: file for macros that don't also have the 'p' flag (described below) could be
162-
: pulled out of here and replaced by these lines throughout the source. It is
163-
: a goal to do that as convenience dictates.
150+
: Functions need to be specified in this file, but macros and other types of
151+
: elements may not necessarily be. The information in this file is sufficient
152+
: to generate a usage line for the element to be documented; otherwise that
153+
: information needs to be specified in the apidoc-ish lines.
154+
:
155+
: 'apidoc_defn' was added to supplement, for non-functions, the information in
156+
: this file. It is designed to be placed at the point of definition of the
157+
: element it is for, so that the information can easily be checked for
158+
: correctness, and you know at a glance that the element actually has
159+
: documentation. It doesn't by itself create any documentation; instead the
160+
: other apidoc lines pull in information specified by these lines. Many of the
161+
: lines in this file for macros that don't also have the 'p' flag (described
162+
: below) could be pulled out of here and replaced by these lines throughout the
163+
: source. It is a goal to do that as convenience dictates.
164164
:
165165
: The other apidoc lines either have the usage data as part of the line, or
166166
: pull in the data from this file or apidoc_defn lines.
@@ -223,7 +223,7 @@
223223
:
224224
: The 'name' in any such line must not be the same as any in this file (i.e.,
225225
: no redundant definitions), and one of the flags on the apidoc lines must be
226-
: 'm' or 'y', indicating it is not a function.
226+
: 'm', 'y', or '@', indicating it is not a function.
227227
:
228228
: All but the name field of an apidoc_item line are optional, and if empty,
229229
: inherits from a corresponding apidoc_defn line, if one exists, or the
@@ -612,6 +612,10 @@
612612
:
613613
: 'y' Typedef. The element names a type rather than being a macro
614614
:
615+
: '@' This entry is for an array, as opposed to a function or macro, etc.
616+
:
617+
: autodoc.pl automatically suppresses any usage information.
618+
:
615619
: ';' autodoc.pl adds a terminating semi-colon to the usage example in the
616620
: documentation.
617621
:

perl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5419,7 +5419,7 @@ EXTCONST char PL_Zero[]
54195419

54205420
/*
54215421
=for apidoc_section $numeric
5422-
=for apidoc AmTuU|const char *|PL_hexdigit|U8 value
5422+
=for apidoc A@T|const char *|PL_hexdigit|U8 value
54235423
54245424
This array, indexed by an integer, converts that value into the character that
54255425
represents it. For example, if the input is 8, the return will be a string

perlvars.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ PERLVARI(G, C_locale_obj, locale_t, NULL)
123123
PERLVARI(G, watch_pvx, char *, NULL)
124124

125125
/*
126-
=for apidoc AmnU|Perl_check_t *|PL_check
126+
=for apidoc A@nU|Perl_check_t *|PL_check
127127
128128
Array, indexed by opcode, of functions that will be called for the "check"
129129
phase of optree building during compilation of Perl code. For most (but

0 commit comments

Comments
 (0)