Skip to content

Commit d5379e5

Browse files
committed
perlapi: Use new 'apidoc_flag' lines
This replaces the clumsy method used previously by the new construct introduced in the previous commit.
1 parent d007ca6 commit d5379e5

File tree

13 files changed

+170
-217
lines changed

13 files changed

+170
-217
lines changed

cop.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ typedef struct refcounted_he COPHH;
202202
=for apidoc_item|SV *|cophh_fetch_pvn|const COPHH *cophh|const char *key|STRLEN keylen|U32 hash|U32 flags
203203
=for apidoc_item|SV *|cophh_fetch_pvs|const COPHH *cophh| "key" |U32 flags
204204
=for apidoc_item|SV *|cophh_fetch_sv |const COPHH *cophh| SV *key |U32 hash|U32 flags
205+
=for apidoc_flag COPHH_KEY_UTF8
205206
206207
These look up the entry in the cop hints hash C<cophh> with the key specified by
207208
C<key> (and C<keylen> in the C<pvn> form), returning that value as a mortal
@@ -226,8 +227,6 @@ whether the key octets are interpreted as UTF-8 (if set) or as Latin-1 (if
226227
cleared). The C<sv> form uses the underlying SV to determine the UTF-8ness of
227228
the octets.
228229
229-
=for apidoc Amnh||COPHH_KEY_UTF8
230-
231230
=cut
232231
233232
*/

dump.c

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,19 @@ S_append_flags(pTHX_ SV *sv, U32 flags, const struct flag_to_name *start,
9999

100100
/*
101101
=for apidoc pv_escape
102+
=for apidoc_flag PERL_PV_ESCAPE_ALL
103+
=for apidoc_flag PERL_PV_ESCAPE_FIRSTCHAR
104+
=for apidoc_flag PERL_PV_ESCAPE_NOBACKSLASH
105+
=for apidoc_flag PERL_PV_ESCAPE_NOCLEAR
106+
=for apidoc_flag PERL_PV_ESCAPE_NONASCII
107+
=for apidoc_flag PERL_PV_ESCAPE_QUOTE
108+
=for apidoc_flag PERL_PV_ESCAPE_RE
109+
=for apidoc_flag PERL_PV_ESCAPE_UNI
110+
=for apidoc_flag PERL_PV_ESCAPE_UNI_DETECT
111+
=for apidoc_flag PERL_PV_ESCAPE_NON_WC
112+
=for apidoc_flag C|PERL_PV_PRETTY_REGPROP
113+
=for apidoc_flag C|PERL_PV_PRETTY_DUMP
114+
=for apidoc_flag C|PERL_PV_PRETTY_NOCLEAR
102115
103116
Escapes at most the first C<count> chars of C<pv> and puts the results into
104117
C<dsv> such that the size of the escaped string will not exceed C<max> chars
@@ -141,24 +154,6 @@ character in patterns.
141154
142155
Returns a pointer to the escaped text as held by C<dsv>.
143156
144-
=for apidoc Amnh||PERL_PV_ESCAPE_ALL
145-
=for apidoc Amnh||PERL_PV_ESCAPE_FIRSTCHAR
146-
=for apidoc Amnh||PERL_PV_ESCAPE_NOBACKSLASH
147-
=for apidoc Amnh||PERL_PV_ESCAPE_NOCLEAR
148-
=for apidoc Amnh||PERL_PV_ESCAPE_NONASCII
149-
=for apidoc Amnh||PERL_PV_ESCAPE_QUOTE
150-
=for apidoc Amnh||PERL_PV_ESCAPE_RE
151-
=for apidoc Amnh||PERL_PV_ESCAPE_UNI
152-
=for apidoc Amnh||PERL_PV_ESCAPE_UNI_DETECT
153-
=for apidoc Amnh||PERL_PV_ESCAPE_NON_WC
154-
155-
=cut
156-
157-
Unused or not for public use
158-
=for apidoc Cmnh||PERL_PV_PRETTY_REGPROP
159-
=for apidoc Cmnh||PERL_PV_PRETTY_DUMP
160-
=for apidoc Cmnh||PERL_PV_PRETTY_NOCLEAR
161-
162157
=cut
163158
*/
164159
#define PV_ESCAPE_OCTBUFSIZE 32
@@ -334,7 +329,10 @@ Perl_pv_escape( pTHX_ SV *dsv, char const * const str,
334329
return dsv ? SvPVX(dsv) : NULL;
335330
}
336331
/*
337-
=for apidoc pv_pretty
332+
=for apidoc pv_pretty
333+
=for apidoc_flag PERL_PV_PRETTY_QUOTE
334+
=for apidoc_flag PERL_PV_PRETTY_LTGT
335+
=for apidoc_flag PERL_PV_PRETTY_ELLIPSES
338336
339337
Converts a string into something presentable, handling escaping via
340338
C<pv_escape()> and supporting quoting and ellipses.
@@ -355,10 +353,6 @@ any quotes or ellipses.
355353
356354
Returns a pointer to the prettified text as held by C<dsv>.
357355
358-
=for apidoc Amnh||PERL_PV_PRETTY_QUOTE
359-
=for apidoc Amnh||PERL_PV_PRETTY_LTGT
360-
=for apidoc Amnh||PERL_PV_PRETTY_ELLIPSES
361-
362356
=cut
363357
*/
364358

gv.c

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ Perl_cvstash_set(pTHX_ CV *cv, HV *stash)
335335
=for apidoc_item gv_init_pv
336336
=for apidoc_item gv_init_pvn
337337
=for apidoc_item gv_init_sv
338+
=for apidoc_flag GV_ADDMULTI
338339
339340
These each convert a scalar into a typeglob. This is an incoercible typeglob;
340341
assigning a reference to it will assign to one of its slots, instead of
@@ -378,8 +379,6 @@ strings, as it has no flags parameter. Setting the C<multi> parameter to
378379
non-zero has the same effect as setting the C<GV_ADDMULTI> flag in the other
379380
forms.
380381
381-
=for apidoc Amnh||GV_ADDMULTI
382-
383382
=cut
384383
*/
385384

@@ -736,6 +735,8 @@ S_maybe_add_coresub(pTHX_ HV * const stash, GV *gv,
736735
=for apidoc_item gv_fetchmeth_pvn_autoload
737736
=for apidoc_item gv_fetchmeth_sv
738737
=for apidoc_item gv_fetchmeth_sv_autoload
738+
=for apidoc_flag GV_SUPER
739+
=for apidoc_flag GV_NOUNIVERSAL
739740
740741
These each look for a glob with name C<name>, containing a defined subroutine,
741742
returning the GV of that glob if found, or C<NULL> if not.
@@ -822,9 +823,6 @@ as being in UTF-8, the extracted PV will also be. Including C<SVf_UTF8> in
822823
C<flags> will force the name to be considered to be UTF-8 even if the SV is
823824
not so marked.
824825
825-
=for apidoc Amnh||GV_SUPER
826-
=for apidoc Amnh||GV_NOUNIVERSAL
827-
828826
=cut
829827
*/
830828

@@ -1307,6 +1305,9 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le
13071305
=for apidoc_item gv_autoload_pvn
13081306
=for apidoc_item gv_autoload_sv
13091307
=for apidoc_item gv_autoload4
1308+
=for apidoc_flag GV_AUTOLOAD_ISMETHOD
1309+
=for apidoc_flag SVf_UTF8
1310+
=for apidoc_flag GV_SUPER
13101311
13111312
These each search for an C<AUTOLOAD> method, returning NULL if not found, or
13121313
else returning a pointer to its GV, while setting the package
@@ -1344,9 +1345,6 @@ to indicate, if set, to skip searching for the name in C<stash>.
13441345
13451346
=cut
13461347
1347-
=for apidoc Amnh||GV_AUTOLOAD_ISMETHOD
1348-
=for apidoc Amnh||SVf_UTF8
1349-
=for apidoc Amnh||GV_SUPER
13501348
*/
13511349

13521350
GV*
@@ -1582,6 +1580,12 @@ S_require_tie_mod(pTHX_ GV *gv, const char varname, const char * name,
15821580
=for apidoc_item gv_stashpvn
15831581
=for apidoc_item gv_stashpvs
15841582
=for apidoc_item gv_stashsv
1583+
=for apidoc_flag GV_ADD
1584+
=for apidoc_flag GV_NOADD_NOINIT
1585+
=for apidoc_flag GV_NOINIT
1586+
=for apidoc_flag GV_NOEXPAND
1587+
=for apidoc_flag GV_ADDMG
1588+
=for apidoc_flag SVf_UTF8
15851589
15861590
Note C<gv_stashsv> is strongly preferred for performance reasons.
15871591
@@ -1613,13 +1617,6 @@ Flags may be one of:
16131617
16141618
The most important of which are probably C<GV_ADD> and C<SVf_UTF8>.
16151619
1616-
=for apidoc Amnh||GV_ADD
1617-
=for apidoc Amnh||GV_NOADD_NOINIT
1618-
=for apidoc Amnh||GV_NOINIT
1619-
=for apidoc Amnh||GV_NOEXPAND
1620-
=for apidoc Amnh||GV_ADDMG
1621-
=for apidoc Amnh||SVf_UTF8
1622-
16231620
=cut
16241621
*/
16251622

@@ -1678,7 +1675,8 @@ S_gv_stashpvn_internal(pTHX_ const char *name, U32 namelen, I32 flags)
16781675
}
16791676

16801677
/*
1681-
=for apidoc gv_stashsvpvn_cached
1678+
=for apidoc gv_stashsvpvn_cached
1679+
=for apidoc_flag E|GV_CACHE_ONLY
16821680
16831681
Returns a pointer to the stash for a specified package, possibly
16841682
cached. Implements both L<perlapi/C<gv_stashpvn>> and
@@ -1692,8 +1690,6 @@ cache; see L<perlapi/C<gv_stashpvn>> for details on the other C<flags>.
16921690
Note it is strongly preferred for C<namesv> to be non-null, for performance
16931691
reasons.
16941692
1695-
=for apidoc Emnh||GV_CACHE_ONLY
1696-
16971693
=cut
16981694
*/
16991695

@@ -2505,6 +2501,15 @@ S_maybe_multimagic_gv(pTHX_ GV *gv, const char *name, const svtype sv_type)
25052501
=for apidoc_item gv_fetchpvs
25062502
=for apidoc_item gv_fetchsv
25072503
=for apidoc_item gv_fetchsv_nomg
2504+
=for apidoc_flag GV_ADD
2505+
=for apidoc_flag GV_ADDMG
2506+
=for apidoc_flag GV_ADDMULTI
2507+
=for apidoc_flag GV_ADDWARN
2508+
=for apidoc_flag GV_NOINIT
2509+
=for apidoc_flag GV_NOADD_NOINIT
2510+
=for apidoc_flag GV_NOTQUAL
2511+
=for apidoc_flag GV_NO_SVGMAGIC
2512+
=for apidoc_flag SVf_UTF8
25082513
25092514
These all return the GV of type C<sv_type> whose name is given by the inputs,
25102515
or NULL if no GV of that name and type could be found. See L<perlguts/Stashes
@@ -2553,16 +2558,6 @@ the input C<name> SV. The only difference between these two forms is that
25532558
with C<gv_fetchsv_nomg>. Including C<GV_NO_SVGMAGIC> in the C<flags> parameter
25542559
to C<gv_fetchsv> makes it behave identically to C<gv_fetchsv_nomg>.
25552560
2556-
=for apidoc Amnh||GV_ADD
2557-
=for apidoc Amnh||GV_ADDMG
2558-
=for apidoc Amnh||GV_ADDMULTI
2559-
=for apidoc Amnh||GV_ADDWARN
2560-
=for apidoc Amnh||GV_NOINIT
2561-
=for apidoc Amnh||GV_NOADD_NOINIT
2562-
=for apidoc Amnh||GV_NOTQUAL
2563-
=for apidoc Amnh||GV_NO_SVGMAGIC
2564-
=for apidoc Amnh||SVf_UTF8
2565-
25662561
=cut
25672562
*/
25682563

hv.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,6 +2639,7 @@ Perl_hv_eiter_set(pTHX_ HV *hv, HE *eiter) {
26392639
/*
26402640
=for apidoc hv_name_set
26412641
=for apidoc_item hv_name_sets
2642+
=for apidoc_flag HV_NAME_SETALL
26422643
26432644
These each set the name of stash C<hv> to the specified name.
26442645
@@ -2656,8 +2657,6 @@ otherwise not.
26562657
If C<HV_NAME_SETALL> is set in C<flags>, both the name and the effective name
26572658
are set.
26582659
2659-
=for apidoc Amnh||HV_NAME_SETALL
2660-
26612660
=cut
26622661
*/
26632662

@@ -2926,7 +2925,8 @@ Perl_hv_kill_backrefs(pTHX_ HV *hv) {
29262925
/*
29272926
hv_iternext is implemented as a macro in hv.h
29282927
2929-
=for apidoc hv_iternext
2928+
=for apidoc hv_iternext
2929+
=for apidoc_flag HV_ITERNEXT_WANTPLACEHOLDERS
29302930
29312931
Returns entries from a hash iterator. See C<L</hv_iterinit>>.
29322932
@@ -2950,8 +2950,6 @@ C<&PL_sv_placeholder>. Note that the implementation of placeholders and
29502950
restricted hashes may change, and the implementation currently is
29512951
insufficiently abstracted for any change to be tidy.
29522952
2953-
=for apidoc Amnh||HV_ITERNEXT_WANTPLACEHOLDERS
2954-
29552953
=cut
29562954
*/
29572955

intrpvar.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ PERLVARI(I, dumpindent, U16, 4) /* number of blanks per dump
349349
/*
350350
=for apidoc_section $embedding
351351
=for apidoc Amn|U8|PL_exit_flags
352+
=for apidoc_flag PERL_EXIT_EXPECTED
353+
=for apidoc_flag PERL_EXIT_ABORT
354+
=for apidoc_flag PERL_EXIT_DESTRUCT_END
355+
=for apidoc_flag PERL_EXIT_WARN
352356
353357
Contains flags controlling perl's behaviour on exit():
354358
@@ -379,11 +383,6 @@ On threaded perls, each thread has an independent copy of this variable;
379383
each initialized at creation time with the current value of the creating
380384
thread's copy.
381385
382-
=for apidoc Amnh||PERL_EXIT_EXPECTED
383-
=for apidoc Amnh||PERL_EXIT_ABORT
384-
=for apidoc Amnh||PERL_EXIT_DESTRUCT_END
385-
=for apidoc Amnh||PERL_EXIT_WARN
386-
387386
=cut
388387
*/
389388

numeric.c

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ Perl_cast_uv(NV f)
218218

219219
/*
220220
=for apidoc grok_bin
221+
=for apidoc_flag PERL_SCAN_ALLOW_UNDERSCORES
222+
=for apidoc_flag PERL_SCAN_DISALLOW_PREFIX
223+
=for apidoc_flag PERL_SCAN_GREATER_THAN_UV_MAX
224+
=for apidoc_flag PERL_SCAN_SILENT_ILLDIGIT
221225
222226
converts a string representing a binary number to numeric form.
223227
@@ -242,11 +246,6 @@ If C<PERL_SCAN_ALLOW_UNDERSCORES> is set in C<*flags> then any or all pairs of
242246
digits may be separated from each other by a single underscore; also a single
243247
leading underscore is accepted.
244248
245-
=for apidoc Amnh||PERL_SCAN_ALLOW_UNDERSCORES
246-
=for apidoc Amnh||PERL_SCAN_DISALLOW_PREFIX
247-
=for apidoc Amnh||PERL_SCAN_GREATER_THAN_UV_MAX
248-
=for apidoc Amnh||PERL_SCAN_SILENT_ILLDIGIT
249-
250249
=cut
251250
252251
Not documented yet because experimental is C<PERL_SCAN_SILENT_NON_PORTABLE
@@ -745,6 +744,12 @@ Perl_grok_numeric_radix(pTHX_ const char **sp, const char *send)
745744

746745
/*
747746
=for apidoc grok_infnan
747+
=for apidoc_flag IS_NUMBER_GREATER_THAN_UV_MAX
748+
=for apidoc_flag IS_NUMBER_INFINITY
749+
=for apidoc_flag IS_NUMBER_IN_UV
750+
=for apidoc_flag IS_NUMBER_NAN
751+
=for apidoc_flag IS_NUMBER_NEG
752+
=for apidoc_flag IS_NUMBER_NOT_INT
748753
749754
Helper for C<grok_number()>, accepts various ways of spelling "infinity"
750755
or "not a number", and returns one of the following flag combinations:
@@ -761,13 +766,6 @@ If an infinity or a not-a-number is recognized, C<*sp> will point to
761766
one byte past the end of the recognized string. If the recognition fails,
762767
zero is returned, and C<*sp> will not move.
763768
764-
=for apidoc Amnh||IS_NUMBER_GREATER_THAN_UV_MAX
765-
=for apidoc Amnh||IS_NUMBER_INFINITY
766-
=for apidoc Amnh||IS_NUMBER_IN_UV
767-
=for apidoc Amnh||IS_NUMBER_NAN
768-
=for apidoc Amnh||IS_NUMBER_NEG
769-
=for apidoc Amnh||IS_NUMBER_NOT_INT
770-
771769
=cut
772770
*/
773771

@@ -1016,6 +1014,14 @@ Perl_grok_infnan(pTHX_ const char** sp, const char* send)
10161014
10171015
=for apidoc grok_number
10181016
=for apidoc_item grok_number_flags
1017+
=for apidoc_flag IS_NUMBER_GREATER_THAN_UV_MAX
1018+
=for apidoc_flag IS_NUMBER_INFINITY
1019+
=for apidoc_flag IS_NUMBER_IN_UV
1020+
=for apidoc_flag IS_NUMBER_NAN
1021+
=for apidoc_flag IS_NUMBER_NEG
1022+
=for apidoc_flag IS_NUMBER_NOT_INT
1023+
=for apidoc_flag IS_NUMBER_TRAILING
1024+
=for apidoc_flag PERL_SCAN_TRAILING
10191025
10201026
Look for a base 10 number in the C<len> bytes starting at C<pv>. If one isn't
10211027
found, return 0; otherwise return its type (and optionally its value). In
@@ -1060,15 +1066,6 @@ In C<grok_number_flags> when C<flags> contains the C<PERL_SCAN_TRAILING>
10601066
bit, and trailing non-numeric text was found, the returned type will include
10611067
the C<IS_NUMBER_TRAILING> bit.
10621068
1063-
=for apidoc Amnh||IS_NUMBER_GREATER_THAN_UV_MAX
1064-
=for apidoc Amnh||IS_NUMBER_INFINITY
1065-
=for apidoc Amnh||IS_NUMBER_IN_UV
1066-
=for apidoc Amnh||IS_NUMBER_NAN
1067-
=for apidoc Amnh||IS_NUMBER_NEG
1068-
=for apidoc Amnh||IS_NUMBER_NOT_INT
1069-
=for apidoc Amnh||IS_NUMBER_TRAILING
1070-
=for apidoc Amnh||PERL_SCAN_TRAILING
1071-
10721069
=cut
10731070
*/
10741071
int

0 commit comments

Comments
 (0)