AV* newAV()
=for hackers
-Found in file av.c
+Found in file av.h
=item sortsv
X<sortsv>
NOTE: the perl_ form of this function is deprecated.
- I32 call_sv(SV* sv, I32 flags)
+ I32 call_sv(SV* sv, VOL I32 flags)
=for hackers
Found in file perl.c
Normally the SV will be cleared before the escaped string is prepared,
but when PERL_PV_ESCAPE_NOCLEAR is set this will not occur.
-If PERL_PV_ESCAPE_UNI is set then the input string is treated as unicode,
+If PERL_PV_ESCAPE_UNI is set then the input string is treated as Unicode,
if PERL_PV_ESCAPE_UNI_DETECT is set then the input string is scanned
-using C<is_utf8_string()> to determine if it is unicode.
+using C<is_utf8_string()> to determine if it is Unicode.
If PERL_PV_ESCAPE_ALL is set then all input chars will be output
using C<\x01F1> style escapes, otherwise only chars above 255 will be
|const U32 flags
Converts a string into something presentable, handling escaping via
-pv_escape() and supporting quoting and elipses.
+pv_escape() and supporting quoting and ellipses.
If the PERL_PV_PRETTY_QUOTE flag is set then the result will be
double quoted with any double quotes in the string escaped. Otherwise
if the PERL_PV_PRETTY_LTGT flag is set then the result be wrapped in
angle brackets.
-If the PERL_PV_PRETTY_ELIPSES flag is set and not all characters in
-string were output then an elipses C<...> will be appended to the
+If the PERL_PV_PRETTY_ELLIPSES flag is set and not all characters in
+string were output then an ellipsis C<...> will be appended to the
string. Note that this happens AFTER it has been quoted.
If start_color is non-null then it will be inserted after the opening
quote (if there is one) but before the escaped text. If end_color
is non-null then it will be inserted after the escaped text but before
-any quotes or elipses.
+any quotes or ellipses.
Returns a pointer to the prettified text as held by dsv.
=back
+=head1 Functions in file pp_ctl.c
+
+
+=over 8
+
+=item find_runcv
+X<find_runcv>
+
+Locate the CV corresponding to the currently executing sub or eval.
+If db_seqp is non_null, skip CVs that are in the DB package and populate
+*db_seqp with the cop sequence number at the point that the DB:: code was
+entered. (allows debuggers to eval in the scope of the breakpoint rather
+than in the scope of the debugger itself).
+
+ CV* find_runcv(U32 *db_seqp)
+
+=for hackers
+Found in file pp_ctl.c
+
+
+=back
+
=head1 Functions in file pp_pack.c
Null AV pointer.
+(deprecated - use C<(AV *)NULL> instead)
+
=for hackers
Found in file av.h
=item Nullch
X<Nullch>
-Null character pointer.
+Null character pointer. (No longer available when C<PERL_CORE> is defined.)
=for hackers
Found in file handy.h
Null CV pointer.
+(deprecated - use C<(CV *)NULL> instead)
+
=for hackers
Found in file cv.h
Null HV pointer.
+(deprecated - use C<(HV *)NULL> instead)
+
=for hackers
Found in file hv.h
=item Nullsv
X<Nullsv>
-Null SV pointer.
+Null SV pointer. (No longer available when C<PERL_CORE> is defined.)
=for hackers
Found in file handy.h
variable. Remember though, that hash keys in perl are free to contain
embedded nulls, so using C<strlen()> or similar is not a good way to find
the length of hash keys. This is very similar to the C<SvPV()> macro
-described elsewhere in this document.
+described elsewhere in this document. See also C<HeUTF8>.
+
+If you are using C<HePV> to get values to pass to C<newSVpvn()> to create a
+new SV, you should consider using C<newSVhek(HeKEY_hek(he))> as it is more
+efficient.
char* HePV(HE* he, STRLEN len)
=for hackers
Found in file hv.h
+=item HeUTF8
+X<HeUTF8>
+
+Returns whether the C<char *> value returned by C<HePV> is encoded in UTF-8,
+doing any necessary dereferencing of possibly C<SV*> keys. The value returned
+will be 0 or non-0, not necessarily 1 (or even a value with any low bits set),
+so B<do not> blindly assign this to a C<bool> variable, as C<bool> may be a
+typedef for C<char>.
+
+ char* HeUTF8(HE* he, STRLEN len)
+
+=for hackers
+Found in file hv.h
+
=item HeVAL
X<HeVAL>
HV* newHV()
=for hackers
-Found in file hv.c
+Found in file hv.h
=back
=for hackers
Found in file handy.h
+=item sv_destroyable
+X<sv_destroyable>
+
+Dummy routine which reports that object can be destroyed when there is no
+sharing module present. It ignores its single SV argument, and returns
+'true'. Exists to avoid test for a NULL function pointer and because it
+could potentially warn under some level of strict-ness.
+
+ bool sv_destroyable(SV *sv)
+
+=for hackers
+Found in file util.c
+
=item sv_nosharing
X<sv_nosharing>
=for hackers
Found in file mro.c
-=item mro_get_linear_isa_c3
-X<mro_get_linear_isa_c3>
-
-Returns the C3 linearization of @ISA
-the given stash. The return value is a read-only AV*.
-C<level> should be 0 (it is used internally in this
-function's recursion).
-
-You are responsible for C<SvREFCNT_inc()> on the
-return value if you plan to store it anywhere
-semi-permanently (otherwise it might be deleted
-out from under you the next time the cache is
-invalidated).
-
- AV* mro_get_linear_isa_c3(HV* stash, I32 level)
-
-=for hackers
-Found in file mro.c
-
-=item mro_get_linear_isa_dfs
-X<mro_get_linear_isa_dfs>
-
-Returns the Depth-First Search linearization of @ISA
-the given stash. The return value is a read-only AV*.
-C<level> should be 0 (it is used internally in this
-function's recursion).
-
-You are responsible for C<SvREFCNT_inc()> on the
-return value if you plan to store it anywhere
-semi-permanently (otherwise it might be deleted
-out from under you the next time the cache is
-invalidated).
-
- AV* mro_get_linear_isa_dfs(HV* stash, I32 level)
-
-=for hackers
-Found in file mro.c
-
=item mro_method_changed_in
X<mro_method_changed_in>
X<mPUSHi>
Push an integer onto the stack. The stack must have room for this element.
-Handles 'set' magic. Does not use C<TARG>. See also C<PUSHi>, C<mXPUSHi>
-and C<XPUSHi>.
+Does not use C<TARG>. See also C<PUSHi>, C<mXPUSHi> and C<XPUSHi>.
void mPUSHi(IV iv)
X<mPUSHn>
Push a double onto the stack. The stack must have room for this element.
-Handles 'set' magic. Does not use C<TARG>. See also C<PUSHn>, C<mXPUSHn>
-and C<XPUSHn>.
+Does not use C<TARG>. See also C<PUSHn>, C<mXPUSHn> and C<XPUSHn>.
void mPUSHn(NV nv)
X<mPUSHp>
Push a string onto the stack. The stack must have room for this element.
-The C<len> indicates the length of the string. Handles 'set' magic. Does
-not use C<TARG>. See also C<PUSHp>, C<mXPUSHp> and C<XPUSHp>.
+The C<len> indicates the length of the string. Does not use C<TARG>.
+See also C<PUSHp>, C<mXPUSHp> and C<XPUSHp>.
void mPUSHp(char* str, STRLEN len)
=for hackers
Found in file pp.h
+=item mPUSHs
+X<mPUSHs>
+
+Push an SV onto the stack and mortalizes the SV. The stack must have room
+for this element. Does not use C<TARG>. See also C<PUSHs> and C<mXPUSHs>.
+
+ void mPUSHs(SV* sv)
+
+=for hackers
+Found in file pp.h
+
=item mPUSHu
X<mPUSHu>
Push an unsigned integer onto the stack. The stack must have room for this
-element. Handles 'set' magic. Does not use C<TARG>. See also C<PUSHu>,
-C<mXPUSHu> and C<XPUSHu>.
+element. Does not use C<TARG>. See also C<PUSHu>, C<mXPUSHu> and C<XPUSHu>.
void mPUSHu(UV uv)
=item mXPUSHi
X<mXPUSHi>
-Push an integer onto the stack, extending the stack if necessary. Handles
-'set' magic. Does not use C<TARG>. See also C<XPUSHi>, C<mPUSHi> and
-C<PUSHi>.
+Push an integer onto the stack, extending the stack if necessary.
+Does not use C<TARG>. See also C<XPUSHi>, C<mPUSHi> and C<PUSHi>.
void mXPUSHi(IV iv)
=item mXPUSHn
X<mXPUSHn>
-Push a double onto the stack, extending the stack if necessary. Handles
-'set' magic. Does not use C<TARG>. See also C<XPUSHn>, C<mPUSHn> and
-C<PUSHn>.
+Push a double onto the stack, extending the stack if necessary.
+Does not use C<TARG>. See also C<XPUSHn>, C<mPUSHn> and C<PUSHn>.
void mXPUSHn(NV nv)
X<mXPUSHp>
Push a string onto the stack, extending the stack if necessary. The C<len>
-indicates the length of the string. Handles 'set' magic. Does not use
-C<TARG>. See also C<XPUSHp>, C<mPUSHp> and C<PUSHp>.
+indicates the length of the string. Does not use C<TARG>. See also C<XPUSHp>,
+C<mPUSHp> and C<PUSHp>.
void mXPUSHp(char* str, STRLEN len)
=for hackers
Found in file pp.h
+=item mXPUSHs
+X<mXPUSHs>
+
+Push an SV onto the stack, extending the stack if necessary and mortalizes
+the SV. Does not use C<TARG>. See also C<XPUSHs> and C<mPUSHs>.
+
+ void mXPUSHs(SV* sv)
+
+=for hackers
+Found in file pp.h
+
=item mXPUSHu
X<mXPUSHu>
Push an unsigned integer onto the stack, extending the stack if necessary.
-Handles 'set' magic. Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu>
-and C<PUSHu>.
+Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
void mXPUSHu(UV uv)
X<PUSHmortal>
Push a new mortal SV onto the stack. The stack must have room for this
-element. Does not handle 'set' magic. Does not use C<TARG>. See also
-C<PUSHs>, C<XPUSHmortal> and C<XPUSHs>.
+element. Does not use C<TARG>. See also C<PUSHs>, C<XPUSHmortal> and C<XPUSHs>.
void PUSHmortal()
=item XPUSHmortal
X<XPUSHmortal>
-Push a new mortal SV onto the stack, extending the stack if necessary. Does
-not handle 'set' magic. Does not use C<TARG>. See also C<XPUSHs>,
-C<PUSHmortal> and C<PUSHs>.
+Push a new mortal SV onto the stack, extending the stack if necessary.
+Does not use C<TARG>. See also C<XPUSHs>, C<PUSHmortal> and C<PUSHs>.
void XPUSHmortal()
=for hackers
Found in file sv.h
+=item newSVpvn_utf8
+X<newSVpvn_utf8>
+
+Creates a new SV and copies a string into it. If utf8 is true, calls
+C<SvUTF8_on> on the new SV. Implemented as a wrapper around C<newSVpvn_flags>.
+
+ SV* newSVpvn_utf8(NULLOK const char* s, STRLEN len, U32 utf8)
+
+=for hackers
+Found in file sv.h
+
=item SvCUR
X<SvCUR>
=item SvOOK
X<SvOOK>
-Returns a U32 indicating whether the SvIVX is a valid offset value for
-the SvPVX. This hack is used internally to speed up removal of characters
-from the beginning of a SvPV. When SvOOK is true, then the start of the
-allocated string buffer is really (SvPVX - SvIVX).
+Returns a U32 indicating whether the pointer to the string buffer is offset.
+This hack is used internally to speed up removal of characters from the
+beginning of a SvPV. When SvOOK is true, then the start of the
+allocated string buffer is actually C<SvOOK_offset()> bytes before SvPVX.
+This offset used to be stored in SvIVX, but is now stored within the spare
+part of the buffer.
U32 SvOOK(SV* sv)
=for hackers
Found in file sv.h
+=item SvOOK_offset
+X<SvOOK_offset>
+
+Reads into I<len> the offset from SvPVX back to the true start of the
+allocated buffer, which will be non-zero if C<sv_chop> has been used to
+efficiently remove characters from start of the buffer. Implemented as a
+macro, which takes the address of I<len>, which must be of type C<STRLEN>.
+Evaluates I<sv> more than once. Sets I<len> to 0 if C<SvOOK(sv)> is false.
+
+ void SvOOK_offset(NN SV*sv, STRLEN len)
+
+=for hackers
+Found in file sv.h
+
=item SvPOK
X<SvPOK>
I<at the C level>. To check derivation at the Perl level, call C<isa()> as a
normal Perl method.
- bool sv_derived_from(SV* sv, const char* name)
+ bool sv_derived_from(SV* sv, const char *const name)
=for hackers
Found in file universal.c
Returns a boolean indicating whether the SV performs a specific, named role.
The SV can be a Perl object or the name of a Perl class.
- bool sv_does(SV* sv, const char* name)
+ bool sv_does(SV* sv, const char *const name)
=for hackers
Found in file universal.c
C<Inf> and C<Infinity> are treated as numbers (so will not issue a
non-numeric warning), even if your atof() doesn't grok them.
- I32 looks_like_number(SV* sv)
+ I32 looks_like_number(SV *const sv)
=for hackers
Found in file sv.c
=for hackers
Found in file sv.c
+=item newSVpvn_flags
+X<newSVpvn_flags>
+
+Creates a new SV and copies a string into it. The reference count for the
+SV is set to 1. Note that if C<len> is zero, Perl will create a zero length
+string. You are responsible for ensuring that the source string is at least
+C<len> bytes long. If the C<s> argument is NULL the new SV will be undefined.
+Currently the only flag bits accepted are C<SVf_UTF8> and C<SVs_TEMP>.
+If C<SVs_TEMP> is set, then C<sv2mortal()> is called on the result before
+returning. If C<SVf_UTF8> is set, then it will be set on the new SV.
+C<newSVpvn_utf8()> is a convenience wrapper for this function, defined as
+
+ #define newSVpvn_utf8(s, len, u) \
+ newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
+
+ SV* newSVpvn_flags(const char* s, STRLEN len, U32 flags)
+
+=for hackers
+Found in file sv.c
+
=item newSVpvn_share
X<newSVpvn_share>
Creates a new SV with its SvPVX_const pointing to a shared string in the string
table. If the string does not already exist in the table, it is created
-first. Turns on READONLY and FAKE. The string's hash is stored in the UV
-slot of the SV; if the C<hash> parameter is non-zero, that value is used;
-otherwise the hash is computed. The idea here is that as the string table
-is used for shared hash keys these strings will have SvPVX_const == HeKEY and
-hash lookup will avoid string compare.
+first. Turns on READONLY and FAKE. If the C<hash> parameter is non-zero, that
+value is used; otherwise the hash is computed. The string's hash can be later
+be retrieved from the SV with the C<SvSHARED_HASH()> macro. The idea here is
+that as the string table is used for shared hash keys these strings will have
+SvPVX_const == HeKEY and hash lookup will avoid string compare.
SV* newSVpvn_share(const char* s, I32 len, U32 hash)
=for hackers
Found in file handy.h
+=item newSVpvs_flags
+X<newSVpvs_flags>
+
+Like C<newSVpvn_flags>, but takes a literal string instead of a string/length
+pair.
+
+ SV* newSVpvs_flags(const char* s, U32 flags)
+
+=for hackers
+Found in file handy.h
+
=item newSVpvs_share
X<newSVpvs_share>
=item newSV_type
X<newSV_type>
-Creates a new SV, of the type specificied. The reference count for the new SV
+Creates a new SV, of the type specified. The reference count for the new SV
is set to 1.
SV* newSV_type(svtype type)
conversion. If flags includes SV_GMAGIC, does an mg_get() first.
Normally used via the C<SvIV(sv)> and C<SvIVx(sv)> macros.
- IV sv_2iv_flags(SV* sv, I32 flags)
+ IV sv_2iv_flags(SV *const sv, const I32 flags)
=for hackers
Found in file sv.c
conversion, magic etc. Normally used via the C<SvNV(sv)> and C<SvNVx(sv)>
macros.
- NV sv_2nv(SV* sv)
+ NV sv_2nv(SV *const sv)
=for hackers
Found in file sv.c
Usually accessed via the C<SvPVbyte> macro.
- char* sv_2pvbyte(SV* sv, STRLEN* lp)
+ char* sv_2pvbyte(SV *const sv, STRLEN *const lp)
=for hackers
Found in file sv.c
Normally invoked via the C<SvPV_flags> macro. C<sv_2pv()> and C<sv_2pv_nomg>
usually end up here too.
- char* sv_2pv_flags(SV* sv, STRLEN* lp, I32 flags)
+ char* sv_2pv_flags(SV *const sv, STRLEN *const lp, const I32 flags)
=for hackers
Found in file sv.c
conversion. If flags includes SV_GMAGIC, does an mg_get() first.
Normally used via the C<SvUV(sv)> and C<SvUVx(sv)> macros.
- UV sv_2uv_flags(SV* sv, I32 flags)
+ UV sv_2uv_flags(SV *const sv, const I32 flags)
=for hackers
Found in file sv.c
Remove any string offset. You should normally use the C<SvOOK_off> macro
wrapper instead.
- int sv_backoff(SV* sv)
+ int sv_backoff(SV *const sv)
=for hackers
Found in file sv.c
Compares the strings in two SVs in a locale-aware manner. Is UTF-8 and
'use bytes' aware, handles get magic, and will coerce its args to strings
-if necessary. See also C<sv_cmp_locale>. See also C<sv_cmp>.
+if necessary. See also C<sv_cmp>.
I32 sv_cmp_locale(SV* sv1, SV* sv2)
string. Mostly uses sv_2pv_flags to do its work, except when that
would lose the UTF-8'ness of the PV.
- void sv_copypv(SV* dsv, SV* ssv)
+ void sv_copypv(SV *const dsv, SV *const ssv)
=for hackers
Found in file sv.c
upgrades the SV to C<SVt_PV>. Returns a pointer to the character buffer.
Use the C<SvGROW> wrapper instead.
- char* sv_grow(SV* sv, STRLEN newlen)
+ char* sv_grow(SV *const sv, STRLEN newlen)
=for hackers
Found in file sv.c
Copies an integer into the given SV, upgrading first if necessary.
Does not handle 'set' magic. See also C<sv_setiv_mg>.
- void sv_setiv(SV* sv, IV num)
+ void sv_setiv(SV *const sv, const IV num)
=for hackers
Found in file sv.c
Like C<sv_setiv>, but also handles 'set' magic.
- void sv_setiv_mg(SV *sv, IV i)
+ void sv_setiv_mg(SV *const sv, const IV i)
=for hackers
Found in file sv.c
Copies a double into the given SV, upgrading first if necessary.
Does not handle 'set' magic. See also C<sv_setnv_mg>.
- void sv_setnv(SV* sv, NV num)
+ void sv_setnv(SV *const sv, const NV num)
=for hackers
Found in file sv.c
Like C<sv_setnv>, but also handles 'set' magic.
- void sv_setnv_mg(SV *sv, NV num)
+ void sv_setnv_mg(SV *const sv, const NV num)
=for hackers
Found in file sv.c
Copies an unsigned integer into the given SV, upgrading first if necessary.
Does not handle 'set' magic. See also C<sv_setuv_mg>.
- void sv_setuv(SV* sv, UV num)
+ void sv_setuv(SV *const sv, const UV num)
=for hackers
Found in file sv.c
Like C<sv_setuv>, but also handles 'set' magic.
- void sv_setuv_mg(SV *sv, UV u)
+ void sv_setuv_mg(SV *const sv, const UV u)
=for hackers
Found in file sv.c
SV, then copies across as much information as possible from the old body.
You generally want to use the C<SvUPGRADE> macro wrapper. See also C<svtype>.
- void sv_upgrade(SV* sv, svtype new_type)
+ void sv_upgrade(SV *const sv, svtype new_type)
=for hackers
Found in file sv.c
X<utf8n_to_uvuni>
Bottom level UTF-8 decode routine.
-Returns the unicode code point value of the first character in the string C<s>
+Returns the Unicode code point value of the first character in the string C<s>
which is assumed to be in UTF-8 encoding and no longer than C<curlen>;
C<retlen> will be set to the length, in bytes, of that character.