diff options
author | Zefram <zefram@fysh.org> | 2017-11-12 05:58:36 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-11-12 06:06:00 +0000 |
commit | 1568d13a11564a7d9d62aaf6a79b9b04172a2a45 (patch) | |
tree | 0ab414c0b8e814426a4df60ec36b77db727443d4 /handy.h | |
parent | bc3331071e1ccbdab715397718bb00282f5c5e88 (diff) | |
download | perl-1568d13a11564a7d9d62aaf6a79b9b04172a2a45.tar.gz |
better document macros taking literal strings
When giving a function-style prototype for a macro taking a literal string
parameter, put a string literal in place of a type for that parameter.
This goofy appearance makes it obvious that this isn't really a function,
and clues the reader in that the parameter can't actually be an arbitrary
expression of the right type. Also change the nonsensical "NUL-terminated
literal string" to "literal string" to describe these parameters.
Fixes [perl #116286].
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 62 |
1 files changed, 31 insertions, 31 deletions
@@ -296,78 +296,78 @@ typedef U64TYPE U64; /* =head1 SV-Body Allocation -=for apidoc Ama|SV*|newSVpvs|const char* s -Like C<newSVpvn>, but takes a C<NUL>-terminated literal string instead of a +=for apidoc Ama|SV*|newSVpvs|"literal string" s +Like C<newSVpvn>, but takes a literal string instead of a string/length pair. -=for apidoc Ama|SV*|newSVpvs_flags|const char* s|U32 flags -Like C<newSVpvn_flags>, but takes a C<NUL>-terminated literal string instead of +=for apidoc Ama|SV*|newSVpvs_flags|"literal string" s|U32 flags +Like C<newSVpvn_flags>, but takes a literal string instead of a string/length pair. -=for apidoc Ama|SV*|newSVpvs_share|const char* s -Like C<newSVpvn_share>, but takes a C<NUL>-terminated literal string instead of +=for apidoc Ama|SV*|newSVpvs_share|"literal string" s +Like C<newSVpvn_share>, but takes a literal string instead of a string/length pair and omits the hash parameter. -=for apidoc Am|void|sv_catpvs_flags|SV* sv|const char* s|I32 flags -Like C<sv_catpvn_flags>, but takes a C<NUL>-terminated literal string instead +=for apidoc Am|void|sv_catpvs_flags|SV* sv|"literal string" s|I32 flags +Like C<sv_catpvn_flags>, but takes a literal string instead of a string/length pair. -=for apidoc Am|void|sv_catpvs_nomg|SV* sv|const char* s -Like C<sv_catpvn_nomg>, but takes a C<NUL>-terminated literal string instead of +=for apidoc Am|void|sv_catpvs_nomg|SV* sv|"literal string" s +Like C<sv_catpvn_nomg>, but takes a literal string instead of a string/length pair. -=for apidoc Am|void|sv_catpvs|SV* sv|const char* s -Like C<sv_catpvn>, but takes a C<NUL>-terminated literal string instead of a +=for apidoc Am|void|sv_catpvs|SV* sv|"literal string" s +Like C<sv_catpvn>, but takes a literal string instead of a string/length pair. -=for apidoc Am|void|sv_catpvs_mg|SV* sv|const char* s -Like C<sv_catpvn_mg>, but takes a C<NUL>-terminated literal string instead of a +=for apidoc Am|void|sv_catpvs_mg|SV* sv|"literal string" s +Like C<sv_catpvn_mg>, but takes a literal string instead of a string/length pair. -=for apidoc Am|void|sv_setpvs|SV* sv|const char* s -Like C<sv_setpvn>, but takes a C<NUL>-terminated literal string instead of a +=for apidoc Am|void|sv_setpvs|SV* sv|"literal string" s +Like C<sv_setpvn>, but takes a literal string instead of a string/length pair. -=for apidoc Am|void|sv_setpvs_mg|SV* sv|const char* s -Like C<sv_setpvn_mg>, but takes a C<NUL>-terminated literal string instead of a +=for apidoc Am|void|sv_setpvs_mg|SV* sv|"literal string" s +Like C<sv_setpvn_mg>, but takes a literal string instead of a string/length pair. -=for apidoc Am|SV *|sv_setref_pvs|const char* s -Like C<sv_setref_pvn>, but takes a C<NUL>-terminated literal string instead of +=for apidoc Am|SV *|sv_setref_pvs|"literal string" s +Like C<sv_setref_pvn>, but takes a literal string instead of a string/length pair. =head1 Memory Management -=for apidoc Ama|char*|savepvs|const char* s -Like C<savepvn>, but takes a C<NUL>-terminated literal string instead of a +=for apidoc Ama|char*|savepvs|"literal string" s +Like C<savepvn>, but takes a literal string instead of a string/length pair. -=for apidoc Ama|char*|savesharedpvs|const char* s +=for apidoc Ama|char*|savesharedpvs|"literal string" s A version of C<savepvs()> which allocates the duplicate string in memory which is shared between threads. =head1 GV Functions -=for apidoc Am|HV*|gv_stashpvs|const char* name|I32 create -Like C<gv_stashpvn>, but takes a C<NUL>-terminated literal string instead of a +=for apidoc Am|HV*|gv_stashpvs|"literal string" name|I32 create +Like C<gv_stashpvn>, but takes a literal string instead of a string/length pair. =head1 Hash Manipulation Functions -=for apidoc Am|SV**|hv_fetchs|HV* tb|const char* key|I32 lval -Like C<hv_fetch>, but takes a C<NUL>-terminated literal string instead of a +=for apidoc Am|SV**|hv_fetchs|HV* tb|"literal string" key|I32 lval +Like C<hv_fetch>, but takes a literal string instead of a string/length pair. -=for apidoc Am|SV**|hv_stores|HV* tb|const char* key|NULLOK SV* val -Like C<hv_store>, but takes a C<NUL>-terminated literal string instead of a +=for apidoc Am|SV**|hv_stores|HV* tb|"literal string" key|NULLOK SV* val +Like C<hv_store>, but takes a literal string instead of a string/length pair and omits the hash parameter. =head1 Lexer interface -=for apidoc Amx|void|lex_stuff_pvs|const char *pv|U32 flags +=for apidoc Amx|void|lex_stuff_pvs|"literal string" pv|U32 flags -Like L</lex_stuff_pvn>, but takes a C<NUL>-terminated literal string instead of +Like L</lex_stuff_pvn>, but takes a literal string instead of a string/length pair. =cut |