Returns the highest index in the array. The number of elements in the
array is C<av_len(av) + 1>. Returns -1 if the array is empty.
- I32 av_len(const AV *av)
+ I32 av_len(AV *av)
=for hackers
Found in file av.c
=item av_shift
X<av_shift>
-Shifts an SV off the beginning of the array.
+Shifts an SV off the beginning of the array. Returns C<&PL_sv_undef> if the
+array is empty.
SV* av_shift(AV *av)
=item pv_escape
X<pv_escape>
- |const STRLEN count|const STRLEN max
- |STRLEN const *escaped, const U32 flags
-
Escapes at most the first "count" chars of pv and puts the results into
dsv such that the size of the escaped string will not exceed "max" chars
and will not contain any incomplete escape sequences.
Returns a pointer to the escaped text as held by dsv.
-NOTE: the perl_ form of this function is deprecated.
-
char* pv_escape(SV *dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags)
=for hackers
=item pv_pretty
X<pv_pretty>
- |const STRLEN count|const STRLEN max\
- |const char const *start_color| const char const *end_color\
- |const U32 flags
-
Converts a string into something presentable, handling escaping via
pv_escape() and supporting quoting and ellipses.
Returns a pointer to the prettified text as held by dsv.
-NOTE: the perl_ form of this function is deprecated.
-
char* pv_pretty(SV *dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags)
=for hackers
=over 8
+=item croak_xs_usage
+X<croak_xs_usage>
+
+A specialised variant of C<croak()> for emitting the usage message for xsubs
+
+ croak_xs_usage(cv, "eee_yow");
+
+works out the package name and subroutine name from C<cv>, and then calls
+C<croak()>. Hence if C<cv> is C<&ouch::awk>, it would call C<croak> as:
+
+ Perl_croak(aTHX_ "Usage %s::%s(%s)", "ouch" "awk", "eee_yow");
+
+ void croak_xs_usage(const CV *const cv, const char *const params)
+
+=for hackers
+Found in file universal.c
+
=item get_sv
X<get_sv>
Creates an RV wrapper for an SV. The reference count for the original
SV is B<not> incremented.
- SV* newRV_noinc(SV* sv)
+ SV* newRV_noinc(SV *const sv)
=for hackers
Found in file sv.c
point to the shared string table where possible. Returns a new (undefined)
SV if the hek is NULL.
- SV* newSVhek(const HEK *hek)
+ SV* newSVhek(const HEK *const hek)
=for hackers
Found in file sv.c
Creates a new SV and copies an integer into it. The reference count for the
SV is set to 1.
- SV* newSViv(IV i)
+ SV* newSViv(const IV i)
=for hackers
Found in file sv.c
Creates a new SV and copies a floating point value into it.
The reference count for the SV is set to 1.
- SV* newSVnv(NV n)
+ SV* newSVnv(const NV n)
=for hackers
Found in file sv.c
SV is set to 1. If C<len> is zero, Perl will compute the length using
strlen(). For efficiency, consider using C<newSVpvn> instead.
- SV* newSVpv(const char* s, STRLEN len)
+ SV* newSVpv(const char *const s, const STRLEN len)
=for hackers
Found in file sv.c
Creates a new SV and initializes it with the string formatted like
C<sprintf>.
- SV* newSVpvf(const char* pat, ...)
+ SV* newSVpvf(const char *const pat, ...)
=for hackers
Found in file sv.c
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.
- SV* newSVpvn(const char* s, STRLEN len)
+ SV* newSVpvn(const char *const s, const STRLEN len)
=for hackers
Found in file sv.c
#define newSVpvn_utf8(s, len, u) \
newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
- SV* newSVpvn_flags(const char* s, STRLEN len, U32 flags)
+ SV* newSVpvn_flags(const char *const s, const STRLEN len, const U32 flags)
=for hackers
Found in file sv.c
be blessed in the specified package. The new SV is returned and its
reference count is 1.
- SV* newSVrv(SV* rv, const char* classname)
+ SV* newSVrv(SV *const rv, const char *const classname)
=for hackers
Found in file sv.c
Creates a new SV which is an exact duplicate of the original SV.
(Uses C<sv_setsv>).
- SV* newSVsv(SV* old)
+ SV* newSVsv(SV *const old)
=for hackers
Found in file sv.c
Creates a new SV and copies an unsigned integer into it.
The reference count for the SV is set to 1.
- SV* newSVuv(UV u)
+ SV* newSVuv(const UV u)
=for hackers
Found in file sv.c
possible to set C<*st> and C<*gvp> to the stash and GV associated with it.
The flags in C<lref> are passed to sv_fetchsv.
- CV* sv_2cv(SV* sv, HV** st, GV** gvp, I32 lref)
+ CV* sv_2cv(SV* sv, HV **const st, GV **const gvp, const I32 lref)
=for hackers
Found in file sv.c
GV; or the recursive result if we're an RV; or the IO slot of the symbol
named after the PV if we're a string.
- IO* sv_2io(SV* sv)
+ IO* sv_2io(SV *const sv)
=for hackers
Found in file sv.c
string buffer can be "stolen" if this SV is copied. See also C<sv_newmortal>
and C<sv_mortalcopy>.
- SV* sv_2mortal(SV* sv)
+ SV* sv_2mortal(SV *const sv)
=for hackers
Found in file sv.c
must be designated by its stash (see C<gv_stashpv()>). The reference count
of the SV is unaffected.
- SV* sv_bless(SV* sv, HV* stash)
+ SV* sv_bless(SV *const sv, HV *const stash)
=for hackers
Found in file sv.c
C<sv_catpvf_mg>. If the original SV was UTF-8, the pattern should be
valid UTF-8; if the original SV was bytes, the pattern should be too.
- void sv_catpvf(SV* sv, const char* pat, ...)
+ void sv_catpvf(SV *const sv, const char *const pat, ...)
=for hackers
Found in file sv.c
Like C<sv_catpvf>, but also handles 'set' magic.
- void sv_catpvf_mg(SV *sv, const char* pat, ...)
+ void sv_catpvf_mg(SV *const sv, const char *const pat, ...)
=for hackers
Found in file sv.c
X<sv_insert>
Inserts a string at the specified offset/length within the SV. Similar to
-the Perl substr() function.
+the Perl substr() function. Handles get magic.
void sv_insert(SV *const bigstr, const STRLEN offset, const STRLEN len, const char *const little, const STRLEN littlelen)
=for hackers
Found in file sv.c
+=item sv_insert_flags
+X<sv_insert_flags>
+
+Same as C<sv_insert>, but the extra C<flags> are passed the C<SvPV_force_flags> that applies to C<bigstr>.
+
+ void sv_insert_flags(SV *const bigstr, const STRLEN offset, const STRLEN len, const char *const little, const STRLEN littlelen, const U32 flags)
+
+=for hackers
+Found in file sv.c
+
=item sv_isa
X<sv_isa>
class. This does not check for subtypes; use C<sv_derived_from> to verify
an inheritance relationship.
- int sv_isa(SV* sv, const char* name)
+ int sv_isa(SV* sv, const char *const name)
=for hackers
Found in file sv.c
The backend for the C<SvPVbytex_force> macro. Always use the macro instead.
- char* sv_pvbyten_force(SV* sv, STRLEN* lp)
+ char* sv_pvbyten_force(SV *const sv, STRLEN *const lp)
=for hackers
Found in file sv.c
You normally want to use the various wrapper macros instead: see
C<SvPV_force> and C<SvPV_force_nomg>
- char* sv_pvn_force_flags(SV* sv, STRLEN* lp, I32 flags)
+ char* sv_pvn_force_flags(SV *const sv, STRLEN *const lp, const I32 flags)
=for hackers
Found in file sv.c
The backend for the C<SvPVutf8x_force> macro. Always use the macro instead.
- char* sv_pvutf8n_force(SV* sv, STRLEN* lp)
+ char* sv_pvutf8n_force(SV *const sv, STRLEN *const lp)
=for hackers
Found in file sv.c
Returns a string describing what the SV is a reference to.
- const char* sv_reftype(const SV* sv, int ob)
+ const char* sv_reftype(const SV *const sv, const int ob)
=for hackers
Found in file sv.c
Underlying implementation for the C<reset> Perl function.
Note that the perl-level function is vaguely deprecated.
- void sv_reset(const char* s, HV* stash)
+ void sv_reset(const char* s, HV *const stash)
=for hackers
Found in file sv.c
Works like C<sv_catpvf> but copies the text into the SV instead of
appending it. Does not handle 'set' magic. See C<sv_setpvf_mg>.
- void sv_setpvf(SV* sv, const char* pat, ...)
+ void sv_setpvf(SV *const sv, const char *const pat, ...)
=for hackers
Found in file sv.c
Like C<sv_setpvf>, but also handles 'set' magic.
- void sv_setpvf_mg(SV *sv, const char* pat, ...)
+ void sv_setpvf_mg(SV *const sv, const char *const pat, ...)
=for hackers
Found in file sv.c
Copies an integer into the given SV, also updating its string value.
Does not handle 'set' magic. See C<sv_setpviv_mg>.
- void sv_setpviv(SV* sv, IV num)
+ void sv_setpviv(SV *const sv, const IV num)
=for hackers
Found in file sv.c
Like C<sv_setpviv>, but also handles 'set' magic.
- void sv_setpviv_mg(SV *sv, IV iv)
+ void sv_setpviv_mg(SV *const sv, const IV iv)
=for hackers
Found in file sv.c
blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
- SV* sv_setref_iv(SV* rv, const char* classname, IV iv)
+ SV* sv_setref_iv(SV *const rv, const char *const classname, const IV iv)
=for hackers
Found in file sv.c
blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
- SV* sv_setref_nv(SV* rv, const char* classname, NV nv)
+ SV* sv_setref_nv(SV *const rv, const char *const classname, const NV nv)
=for hackers
Found in file sv.c
Note that C<sv_setref_pvn> copies the string while this copies the pointer.
- SV* sv_setref_pv(SV* rv, const char* classname, void* pv)
+ SV* sv_setref_pv(SV *const rv, const char *const classname, void *const pv)
=for hackers
Found in file sv.c
Note that C<sv_setref_pv> copies the pointer while this copies the string.
- SV* sv_setref_pvn(SV* rv, const char* classname, const char* pv, STRLEN n)
+ SV* sv_setref_pvn(SV *const rv, const char *const classname, const char *const pv, const STRLEN n)
=for hackers
Found in file sv.c
blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
- SV* sv_setref_uv(SV* rv, const char* classname, UV uv)
+ SV* sv_setref_uv(SV *const rv, const char *const classname, const UV uv)
=for hackers
Found in file sv.c
X<sv_tainted>
Test an SV for taintedness. Use C<SvTAINTED> instead.
- bool sv_tainted(SV* sv)
+ bool sv_tainted(SV *const sv)
=for hackers
Found in file sv.c
Use the C<SvTRUE> macro instead, which may call C<sv_true()> or may
instead use an in-line version.
- I32 sv_true(SV *sv)
+ I32 sv_true(SV *const sv)
=for hackers
Found in file sv.c
different from one or the reference being a readonly SV).
See C<SvROK_off>.
- void sv_unref_flags(SV *ref, U32 flags)
+ void sv_unref_flags(SV *const ref, const U32 flags)
=for hackers
Found in file sv.c
X<sv_untaint>
Untaint an SV. Use C<SvTAINTED_off> instead.
- void sv_untaint(SV* sv)
+ void sv_untaint(SV *const sv)
=for hackers
Found in file sv.c
Usually used via its frontend C<sv_catpvf>.
- void sv_vcatpvf(SV* sv, const char* pat, va_list* args)
+ void sv_vcatpvf(SV *const sv, const char *const pat, va_list *const args)
=for hackers
Found in file sv.c
Usually used via one of its frontends C<sv_vcatpvf> and C<sv_vcatpvf_mg>.
- void sv_vcatpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted)
+ void sv_vcatpvfn(SV *const sv, const char *const pat, const STRLEN patlen, va_list *const args, SV **const svargs, const I32 svmax, bool *const maybe_tainted)
=for hackers
Found in file sv.c
Usually used via its frontend C<sv_catpvf_mg>.
- void sv_vcatpvf_mg(SV* sv, const char* pat, va_list* args)
+ void sv_vcatpvf_mg(SV *const sv, const char *const pat, va_list *const args)
=for hackers
Found in file sv.c
Usually used via its frontend C<sv_setpvf>.
- void sv_vsetpvf(SV* sv, const char* pat, va_list* args)
+ void sv_vsetpvf(SV *const sv, const char *const pat, va_list *const args)
=for hackers
Found in file sv.c
Usually used via one of its frontends C<sv_vsetpvf> and C<sv_vsetpvf_mg>.
- void sv_vsetpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted)
+ void sv_vsetpvfn(SV *const sv, const char *const pat, const STRLEN patlen, va_list *const args, SV **const svargs, const I32 svmax, bool *const maybe_tainted)
=for hackers
Found in file sv.c
Usually used via its frontend C<sv_setpvf_mg>.
- void sv_vsetpvf_mg(SV* sv, const char* pat, va_list* args)
+ void sv_vsetpvf_mg(SV *const sv, const char *const pat, va_list *const args)
=for hackers
Found in file sv.c