diff options
author | Karl Williamson <khw@cpan.org> | 2020-09-05 22:20:45 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-11-29 07:43:12 -0700 |
commit | c2b527b3ea8007dff526018f2f60dba8ff99b294 (patch) | |
tree | 6a86cf86129b2514f094bf15f5b89304628c4374 /sv.h | |
parent | e926558e32f7c35e244a99ae9b8bf0cbd90bcf03 (diff) | |
download | perl-c2b527b3ea8007dff526018f2f60dba8ff99b294.tar.gz |
perlapi: Consolidate SvPVX-ish entries
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -781,14 +781,26 @@ Returns the raw value in the SV's NV slot, without checks or conversions. Only use when you are sure C<SvNOK> is true. See also C<L</SvNV>>. =for apidoc Am|char*|SvPVX|SV* sv -Returns a pointer to the physical string in the SV. The SV must contain a -string. Prior to 5.9.3 it is not safe -to execute this macro unless the SV's +=for apidoc_item |char*|SvPVXx|SV* sv +=for apidoc_item |const char*|SvPVX_const|SV* sv +=for apidoc_item |char*|SvPVX_mutable|SV* sv + +These return a pointer to the physical string in the SV. The SV must contain a +string. Prior to 5.9.3 it is not safe to execute these unless the SV's type >= C<SVt_PV>. -This is also used to store the name of an autoloaded subroutine in an XS +These are also used to store the name of an autoloaded subroutine in an XS AUTOLOAD routine. See L<perlguts/Autoloading with XSUBs>. +C<SvPVXx> is identical to C<SvPVX>. + +C<SvPVX_mutable> is merely a synonym for C<SvPVX>, but its name emphasizes that +the string is modifiable by the caller. + +C<SvPVX_const> differs in that the return value has been cast so that the +compiler will complain if you were to try to modify the contents of the string, +(unless you cast away const yourself). + =for apidoc Am|STRLEN|SvCUR|SV* sv Returns the length of the string which is in the SV. See C<L</SvLEN>>. |