Skip to content

Commit 71f3329

Browse files
committed
embed.fnc: Need p flag for non-static public elements
If a function or macro 'foo' is publicly accessible, there should be a 'Perl_foo' form available for callers to use so as to avoid any name collisions with their own names. Now that we can automatically generate Perl_foo equivalents for macros, make sure that the flags indicate that. I first thought to add the p flag automatically, but that would require a bunch of restructuring. By requiring the flag, in embed.fnc, the true state of things doesn't get hidden.
1 parent 2b8cbf5 commit 71f3329

File tree

4 files changed

+184
-89
lines changed

4 files changed

+184
-89
lines changed

embed.fnc

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,18 @@
9999
: placed in perlapi. If no documentation exists, that fact is also
100100
: noted in perlapi.
101101
:
102+
: These require one of the /[iIpS]/ flags to give callers a name to use
103+
: that won't possibly collide with their own
104+
:
102105
: The 'C' flag is used instead for functions and their short names that need to
103106
: be accessible everywhere, typically because they are called from a
104107
: publicly available macro or inline function, but they are not for
105108
: public use by themselves. The documentation for these is placed in
106109
: perlintern. If no documentation exists, that fact is also noted in
107110
: perlintern.
108111
:
109-
: These really need the 'p' flag to avoid name space collisions.
112+
: These require one of the /[iIpS]/ flags to give callers a name to use
113+
: that won't possibly collide with their own
110114
:
111115
: Some of these have been constructed so that the wrapper macro names
112116
: begin with an underscore to lessen the chances of a name collision.
@@ -278,8 +282,8 @@
278282
: The remainder of these introductory comments detail all the possible flags:
279283
:
280284
: 'A' Both long and short names are accessible fully everywhere (usually
281-
: part of the public API). If the function is not part of the public
282-
: API, instead use 'C', 'E', or 'X'.
285+
: part of the public API). Requires one of /[iIpS]/ flags. If the
286+
: function is not part of the public API, instead use 'C', 'E', or 'X'.
283287
:
284288
: * adds entry to the list of symbols available on all platforms unless
285289
: 'e' or 'm' are also specified;
@@ -335,6 +339,7 @@
335339
: for example. Some functions have to be accessible everywhere even if
336340
: they are not intended for public use. An example is helper functions
337341
: that are called from inline ones that are publicly available.
342+
: Requires one of /[iIpS]/ flags.
338343
:
339344
: * add entry to the list of symbols available on all platforms unless e
340345
: or m are also specified;
@@ -1204,7 +1209,7 @@ Cip |I32 |foldEQ_latin1 |NN const char *a \
12041209
Adip |I32 |foldEQ_locale |NN const char *a \
12051210
|NN const char *b \
12061211
|I32 len
1207-
Adm |I32 |foldEQ_utf8 |NN const char *s1 \
1212+
Admp |I32 |foldEQ_utf8 |NN const char *s1 \
12081213
|NULLOK char **pe1 \
12091214
|UV l1 \
12101215
|bool u1 \
@@ -1342,11 +1347,11 @@ Adp |GV * |gv_fetchfile_flags \
13421347
|NN const char * const name \
13431348
|const STRLEN len \
13441349
|const U32 flags
1345-
Adm |GV * |gv_fetchmeth |NULLOK NOCHECK HV *stash \
1350+
Admp |GV * |gv_fetchmeth |NULLOK NOCHECK HV *stash \
13461351
|NN const char *name \
13471352
|STRLEN len \
13481353
|I32 level
1349-
Adm |GV * |gv_fetchmeth_autoload \
1354+
Admp |GV * |gv_fetchmeth_autoload \
13501355
|NULLOK NOCHECK HV *stash \
13511356
|NN const char *name \
13521357
|STRLEN len \
@@ -1422,7 +1427,7 @@ Adp |void |gv_fullname4 |NN SV *sv \
14221427
CRdp |CV * |gv_handler |NULLOK HV *stash \
14231428
|I32 id
14241429
Admp |GV * |gv_HVadd |NULLOK GV *gv
1425-
Adm |void |gv_init |NN GV *gv \
1430+
Admp |void |gv_init |NN GV *gv \
14261431
|NULLOK HV *stash \
14271432
|NN const char *name \
14281433
|STRLEN len \
@@ -1578,19 +1583,19 @@ Ampx |SV ** |hv_store_flags |NULLOK HV *hv \
15781583
|NULLOK SV *val \
15791584
|U32 hash \
15801585
|int flags
1581-
Adm |SV ** |hv_stores |NULLOK HV *hv \
1586+
Admp |SV ** |hv_stores |NULLOK HV *hv \
15821587
|"key" \
15831588
|NULLOK SV *val
1584-
Adm |void |hv_undef |NULLOK HV *hv
1589+
Admp |void |hv_undef |NULLOK HV *hv
15851590
Xop |void |hv_undef_flags |NULLOK HV *hv \
15861591
|U32 flags
1587-
APdm |I32 |ibcmp |NN const char *a \
1592+
APdmp |I32 |ibcmp |NN const char *a \
15881593
|NN const char *b \
15891594
|I32 len
1590-
APdm |I32 |ibcmp_locale |NN const char *a \
1595+
APdmp |I32 |ibcmp_locale |NN const char *a \
15911596
|NN const char *b \
15921597
|I32 len
1593-
Adm |I32 |ibcmp_utf8 |NN const char *s1 \
1598+
Admp |I32 |ibcmp_utf8 |NN const char *s1 \
15941599
|NULLOK char **pe1 \
15951600
|UV l1 \
15961601
|bool u1 \
@@ -1637,10 +1642,10 @@ p |bool |io_close |NN IO *io \
16371642
ARTdip |Size_t |isC9_STRICT_UTF8_CHAR \
16381643
|NN const U8 * const s0 \
16391644
|NN const U8 * const e
1640-
ARTdm |bool |is_c9strict_utf8_string \
1645+
ARTdmp |bool |is_c9strict_utf8_string \
16411646
|NN const U8 *s \
16421647
|STRLEN len
1643-
ATdm |bool |is_c9strict_utf8_string_loc \
1648+
ATdmp |bool |is_c9strict_utf8_string_loc \
16441649
|NN const U8 *s \
16451650
|STRLEN len \
16461651
|NN const U8 **ep
@@ -1664,10 +1669,10 @@ ARdip |bool |is_safe_syscall|NN const char *pv \
16641669
ARTdip |Size_t |isSTRICT_UTF8_CHAR \
16651670
|NN const U8 * const s0 \
16661671
|NN const U8 * const e
1667-
ARTdm |bool |is_strict_utf8_string \
1672+
ARTdmp |bool |is_strict_utf8_string \
16681673
|NN const U8 *s \
16691674
|STRLEN len
1670-
ATdm |bool |is_strict_utf8_string_loc \
1675+
ATdmp |bool |is_strict_utf8_string_loc \
16711676
|NN const U8 *s \
16721677
|STRLEN len \
16731678
|NN const U8 **ep
@@ -1699,11 +1704,11 @@ CPRTp |Size_t |is_utf8_FF_helper_ \
16991704
|NN const U8 * const s0 \
17001705
|NN const U8 * const e \
17011706
|const bool require_partial
1702-
ATdm |bool |is_utf8_fixed_width_buf_flags \
1707+
ATdmp |bool |is_utf8_fixed_width_buf_flags \
17031708
|NN const U8 * const s \
17041709
|STRLEN len \
17051710
|const U32 flags
1706-
ATdm |bool |is_utf8_fixed_width_buf_loc_flags \
1711+
ATdmp |bool |is_utf8_fixed_width_buf_loc_flags \
17071712
|NN const U8 * const s \
17081713
|STRLEN len \
17091714
|NULLOK const U8 **ep \
@@ -1727,7 +1732,7 @@ CRp |bool |_is_utf8_perl_idcont \
17271732
CRp |bool |_is_utf8_perl_idstart \
17281733
|NN const U8 *p \
17291734
|NN const U8 * const e
1730-
ARTdm |bool |is_utf8_string |NN const U8 *s \
1735+
ARTdmp |bool |is_utf8_string |NN const U8 *s \
17311736
|STRLEN len
17321737
ARTdip |bool |is_utf8_string_flags \
17331738
|NN const U8 *s \
@@ -1737,7 +1742,7 @@ ATdmp |bool |is_utf8_string_loc \
17371742
|NN const U8 *s \
17381743
|const STRLEN len \
17391744
|NN const U8 **ep
1740-
ATdm |bool |is_utf8_string_loc_flags \
1745+
ATdmp |bool |is_utf8_string_loc_flags \
17411746
|NN const U8 *s \
17421747
|STRLEN len \
17431748
|NN const U8 **ep \
@@ -1753,7 +1758,7 @@ ATdip |bool |is_utf8_string_loclen_flags \
17531758
|NULLOK const U8 **ep \
17541759
|NULLOK STRLEN *el \
17551760
|const U32 flags
1756-
APTdm |bool |is_utf8_valid_partial_char \
1761+
APTdmp |bool |is_utf8_valid_partial_char \
17571762
|NN const U8 * const s0 \
17581763
|NN const U8 * const e
17591764
ARTdip |bool |is_utf8_valid_partial_char_flags \
@@ -2145,7 +2150,7 @@ ARdp |OP * |newASSIGNOP |I32 flags \
21452150
|NULLOK OP *left \
21462151
|I32 optype \
21472152
|NULLOK OP *right
2148-
Adm |CV * |newATTRSUB |I32 floor \
2153+
Admp |CV * |newATTRSUB |I32 floor \
21492154
|NULLOK OP *o \
21502155
|NULLOK OP *proto \
21512156
|NULLOK OP *attrs \
@@ -2157,11 +2162,11 @@ Xdp |CV * |newATTRSUB_x |I32 floor \
21572162
|NULLOK OP *block \
21582163
|bool o_is_gv
21592164
ARdmp |AV * |newAV
2160-
ARdm |AV * |newAV_alloc_x |SSize_t size
2161-
ARdm |AV * |newAV_alloc_xz |SSize_t size
2165+
ARdmp |AV * |newAV_alloc_x |SSize_t size
2166+
ARdmp |AV * |newAV_alloc_xz |SSize_t size
21622167
ARdp |AV * |newAVav |NULLOK AV *oav
21632168
ARdp |AV * |newAVhv |NULLOK HV *ohv
2164-
ARdm |AV * |newAV_mortal
2169+
ARdmp |AV * |newAV_mortal
21652170
ARdp |OP * |newAVREF |NN OP *o
21662171
ARdp |OP * |newBINOP |I32 type \
21672172
|I32 flags \
@@ -2198,7 +2203,7 @@ ARdp |OP * |newGIVENOP |NN OP *cond \
21982203
|PADOFFSET defsv_off
21992204
: Used in scope.c
22002205
eopx |GP * |newGP |NN GV * const gv
2201-
Adm |GV * |newGVgen |NN const char *pack
2206+
Admp |GV * |newGVgen |NN const char *pack
22022207
ARdp |GV * |newGVgen_flags |NN const char *pack \
22032208
|U32 flags
22042209
ARdp |OP * |newGVOP |I32 type \
@@ -2317,7 +2322,7 @@ Adp |SV * |newSVrv |NN SV * const rv \
23172322
ARdmp |SV * |newSVsv |NULLOK SV * const old
23182323
ARdp |SV * |newSVsv_flags |NULLOK SV * const old \
23192324
|I32 flags
2320-
ARdm |SV * |newSVsv_nomg |NULLOK SV * const old
2325+
ARdmp |SV * |newSVsv_nomg |NULLOK SV * const old
23212326
ARdp |SV * |newSV_true
23222327
ARdip |SV * |newSV_type |const svtype type
23232328
AIRdp |SV * |newSV_type_mortal \
@@ -2409,7 +2414,7 @@ Adfp |void |opdump_printf |NN struct Perl_OpDumpContext *ctx \
24092414
Adp |OP * |op_force_list |NULLOK OP *o
24102415
Adp |void |op_free |NULLOK OP *arg
24112416
Adp |OP * |op_linklist |NN OP *o
2412-
Admx |OP * |op_lvalue |NULLOK OP *o \
2417+
Admpx |OP * |op_lvalue |NULLOK OP *o \
24132418
|I32 type
24142419
Xop |OP * |op_lvalue_flags|NULLOK OP *o \
24152420
|I32 type \
@@ -2563,7 +2568,7 @@ CTp |Signal_t|perly_sighandler \
25632568
|NULLOK void *uap \
25642569
|bool safe
25652570

2566-
Adm |const char * const|phase_name \
2571+
Admp |const char * const|phase_name \
25672572
|enum perl_phase
25682573
Adp |void |pmop_dump |NULLOK PMOP *pm
25692574
: Used in perly.y
@@ -2797,9 +2802,9 @@ p |void |report_wrongway_fh \
27972802
AOdp |void |require_pv |NN const char *pv
27982803
Cop |void |resume_compcv |NN struct suspended_compcv *buffer \
27992804
|bool save
2800-
Adm |void |resume_compcv_and_save \
2805+
Admp |void |resume_compcv_and_save \
28012806
|NN struct suspended_compcv *buffer
2802-
Adm |void |resume_compcv_final \
2807+
Admp |void |resume_compcv_final \
28032808
|NN struct suspended_compcv *buffer
28042809
APTdp |char * |rninstr |NN const char *big \
28052810
|NN const char *bigend \
@@ -2891,7 +2896,7 @@ ARTdp |Malloc_t|safesysrealloc|Malloc_t where \
28912896
|MEM_SIZE nbytes
28922897
Cdp |void |save_adelete |NN AV *av \
28932898
|SSize_t key
2894-
Adm |void |save_aelem |NN AV *av \
2899+
Admp |void |save_aelem |NN AV *av \
28952900
|SSize_t idx \
28962901
|NN SV **sptr
28972902
Adp |void |save_aelem_flags \
@@ -2927,7 +2932,7 @@ Adp |void |save_gp |NN GV *gv \
29272932
Adhp |HV * |save_hash |NN GV *gv
29282933
Cdp |void |save_hdelete |NN HV *hv \
29292934
|NN SV *keysv
2930-
Adm |void |save_helem |NN HV *hv \
2935+
Admp |void |save_helem |NN HV *hv \
29312936
|NN SV *key \
29322937
|NN SV **sptr
29332938
Adp |void |save_helem_flags \
@@ -3157,7 +3162,7 @@ Admp |void |sv_copypv |NN SV * const dsv \
31573162
Adp |void |sv_copypv_flags|NN SV * const dsv \
31583163
|NN SV * const ssv \
31593164
|const I32 flags
3160-
Adm |void |sv_copypv_nomg |NN SV * const dsv \
3165+
Admp |void |sv_copypv_nomg |NN SV * const dsv \
31613166
|NN SV * const ssv
31623167
Adp |CV * |sv_2cv |NULLOK SV *sv \
31633168
|NN HV ** const st \
@@ -3278,7 +3283,7 @@ Cdp |SV * |sv_newref |NULLOK SV * const sv
32783283
Adp |void |sv_nosharing |NULLOK SV *sv
32793284
: Used in pp.c, pp_hot.c, sv.c
32803285
dpx |SV * |sv_2num |NN SV * const sv
3281-
Adm |bool |sv_numeq |NULLOK SV *sv1 \
3286+
Admp |bool |sv_numeq |NULLOK SV *sv1 \
32823287
|NULLOK SV *sv2
32833288
Adp |bool |sv_numeq_flags |NULLOK SV *sv1 \
32843289
|NULLOK SV *sv2 \
@@ -3360,7 +3365,7 @@ AMdip |void |SvREFCNT_dec |NULLOK SV *sv
33603365
AMdip |void |SvREFCNT_dec_NN|NN SV *sv
33613366
Adip |SV * |SvREFCNT_dec_ret_NULL \
33623367
|NULLOK SV *sv
3363-
Adm |void |SvREFCNT_dec_set_NULL \
3368+
Admp |void |SvREFCNT_dec_set_NULL \
33643369
|NULLOK SV *sv
33653370
AMTdip |SV * |SvREFCNT_inc |NULLOK SV *sv
33663371
AMTdip |SV * |SvREFCNT_inc_NN|NN SV *sv
@@ -3466,7 +3471,7 @@ Adp |void |sv_setuv |NN SV * const sv \
34663471
|const UV num
34673472
Adp |void |sv_setuv_mg |NN SV * const sv \
34683473
|const UV u
3469-
Adm |bool |sv_streq |NULLOK SV *sv1 \
3474+
Admp |bool |sv_streq |NULLOK SV *sv1 \
34703475
|NULLOK SV *sv2
34713476
Adp |bool |sv_streq_flags |NULLOK SV *sv1 \
34723477
|NULLOK SV *sv2 \
@@ -3526,19 +3531,19 @@ Adp |bool |sv_utf8_downgrade_flags \
35263531
|NN SV * const sv \
35273532
|const bool fail_ok \
35283533
|const U32 flags
3529-
Adm |bool |sv_utf8_downgrade_nomg \
3534+
Admp |bool |sv_utf8_downgrade_nomg \
35303535
|NN SV * const sv \
35313536
|const bool fail_ok
35323537
Adp |void |sv_utf8_encode |NN SV * const sv
35333538
Admp |STRLEN |sv_utf8_upgrade|NN SV *sv
3534-
Adm |STRLEN |sv_utf8_upgrade_flags \
3539+
Admp |STRLEN |sv_utf8_upgrade_flags \
35353540
|NN SV * const sv \
35363541
|const I32 flags
35373542
Adp |STRLEN |sv_utf8_upgrade_flags_grow \
35383543
|NN SV * const sv \
35393544
|const I32 flags \
35403545
|STRLEN extra
3541-
Adm |STRLEN |sv_utf8_upgrade_nomg \
3546+
Admp |STRLEN |sv_utf8_upgrade_nomg \
35423547
|NN SV *sv
35433548
Adip |UV |SvUV |NN SV *sv
35443549
Cmp |UV |sv_2uv |NN SV *sv
@@ -3606,7 +3611,7 @@ Fpv |OP * |tied_method |NN SV *methname \
36063611
|...
36073612
Xp |SSize_t|tmps_grow_p |SSize_t ix
36083613
Xiop |Stack_off_t|TOPMARK
3609-
Cm |UV |to_uni_fold |UV c \
3614+
Cmp |UV |to_uni_fold |UV c \
36103615
|NN U8 *p \
36113616
|NN STRLEN *lenp
36123617
Cp |UV |_to_uni_fold_flags \
@@ -3814,13 +3819,13 @@ p |void |utilize |int aver \
38143819
|NN OP *idop \
38153820
|NULLOK OP *arg
38163821

3817-
Adm |U8 * |uvchr_to_utf8 |NN U8 *d \
3822+
Admp |U8 * |uvchr_to_utf8 |NN U8 *d \
38183823
|UV uv
3819-
Adm |U8 * |uvchr_to_utf8_flags \
3824+
Admp |U8 * |uvchr_to_utf8_flags \
38203825
|NN U8 *d \
38213826
|UV uv \
38223827
|UV flags
3823-
Adm |U8 * |uvchr_to_utf8_flags_msgs \
3828+
Admp |U8 * |uvchr_to_utf8_flags_msgs \
38243829
|NN U8 *d \
38253830
|UV uv \
38263831
|UV flags \
@@ -3911,7 +3916,7 @@ Adp |void |warn_sv |NN SV *baseex
39113916
RXop |I32 |was_lvalue_sub
39123917
: FIXME
39133918
p |void |watch |NN char **addr
3914-
Adm |I32 |whichsig |NN const char *sig
3919+
Admp |I32 |whichsig |NN const char *sig
39153920
Adp |I32 |whichsig_pv |NN const char *sig
39163921
Adp |I32 |whichsig_pvn |NN const char *sig \
39173922
|STRLEN len
@@ -6373,7 +6378,7 @@ p |void |op_relocate_sv |NN SV **svp \
63736378
|NN PADOFFSET *targp
63746379
# endif
63756380
#else /* if !defined(USE_ITHREADS) */
6376-
Adm |void |CopFILEGV_set |NN COP *c \
6381+
Admp |void |CopFILEGV_set |NN COP *c \
63776382
|NN GV *gv
63786383
#endif
63796384
#if defined(USE_LOCALE_COLLATE)

0 commit comments

Comments
 (0)