X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlapi.pod;h=26420dedf35b39aafa817e32e2f9a17c857b4502;hb=12964ddd5d77e0f02593286e5ca100221b0f8c59;hp=b7cb7b30d04facafb45c2e2c3ad3ffddc32b8bde;hpb=740cce10afff4bec3346f61ab3d0f7bfa424948c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlapi.pod b/pod/perlapi.pod index b7cb7b3..26420de 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -129,7 +129,7 @@ X Clears an array, making it empty. Does not free the memory used by the array itself. - void av_clear(AV* ar) + void av_clear(AV *av) =for hackers Found in file av.c @@ -170,7 +170,7 @@ Deletes the element indexed by C from the array. Returns the deleted element. If C equals C, the element is freed and null is returned. - SV* av_delete(AV* ar, I32 key, I32 flags) + SV* av_delete(AV *av, I32 key, I32 flags) =for hackers Found in file av.c @@ -183,7 +183,7 @@ Returns true if the element indexed by C has been initialized. This relies on the fact that uninitialized array elements are set to C<&PL_sv_undef>. - bool av_exists(AV* ar, I32 key) + bool av_exists(AV *av, I32 key) =for hackers Found in file av.c @@ -194,7 +194,7 @@ X Pre-extend an array. The C is the index to which the array should be extended. - void av_extend(AV* ar, I32 key) + void av_extend(AV *av, I32 key) =for hackers Found in file av.c @@ -209,7 +209,7 @@ that the return value is non-null before dereferencing it to a C. See L for more information on how to use this function on tied arrays. - SV** av_fetch(AV* ar, I32 key, I32 lval) + SV** av_fetch(AV *av, I32 key, I32 lval) =for hackers Found in file av.c @@ -226,7 +226,7 @@ additional elements appended are set to C. If the array was longer, then the excess elements are freed. C is the same as C. - void av_fill(AV* ar, I32 fill) + void av_fill(AV *av, I32 fill) =for hackers Found in file av.c @@ -237,7 +237,7 @@ X Returns the highest index in the array. The number of elements in the array is C. Returns -1 if the array is empty. - I32 av_len(const AV* ar) + I32 av_len(const AV *av) =for hackers Found in file av.c @@ -249,7 +249,7 @@ Creates a new AV and populates it with a list of SVs. The SVs are copied into the array, so they may be freed after the call to av_make. The new AV will have a reference count of 1. - AV* av_make(I32 size, SV** svp) + AV* av_make(I32 size, SV **strp) =for hackers Found in file av.c @@ -260,7 +260,7 @@ X Pops an SV off the end of the array. Returns C<&PL_sv_undef> if the array is empty. - SV* av_pop(AV* ar) + SV* av_pop(AV *av) =for hackers Found in file av.c @@ -271,7 +271,7 @@ X Pushes an SV onto the end of the array. The array will grow automatically to accommodate the addition. - void av_push(AV* ar, SV* val) + void av_push(AV *av, SV *val) =for hackers Found in file av.c @@ -281,7 +281,7 @@ X Shifts an SV off the beginning of the array. - SV* av_shift(AV* ar) + SV* av_shift(AV *av) =for hackers Found in file av.c @@ -300,7 +300,7 @@ returned NULL. See L for more information on how to use this function on tied arrays. - SV** av_store(AV* ar, I32 key, SV* val) + SV** av_store(AV *av, I32 key, SV *val) =for hackers Found in file av.c @@ -310,7 +310,7 @@ X Undefines the array. Frees the memory used by the array itself. - void av_undef(AV* ar) + void av_undef(AV *av) =for hackers Found in file av.c @@ -322,7 +322,7 @@ Unshift the given number of C values onto the beginning of the array. The array will grow automatically to accommodate the addition. You must then use C to assign values to these new elements. - void av_unshift(AV* ar, I32 num) + void av_unshift(AV *av, I32 num) =for hackers Found in file av.c @@ -428,7 +428,7 @@ L. 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 @@ -632,7 +632,7 @@ if you just want to do some stuff in a separate perl interpreter and then throw it away and return to the original one, you don't need to do anything. - PerlInterpreter* perl_clone(PerlInterpreter* interp, UV flags) + PerlInterpreter* perl_clone(PerlInterpreter *proto_perl, UV flags) =for hackers Found in file sv.c @@ -745,7 +745,7 @@ X Initializes a new Perl interpreter. See L. - void perl_construct(PerlInterpreter* interp) + void perl_construct(PerlInterpreter *my_perl) =for hackers Found in file perl.c @@ -755,7 +755,7 @@ X Shuts down a Perl interpreter. See L. - int perl_destruct(PerlInterpreter* interp) + int perl_destruct(PerlInterpreter *my_perl) =for hackers Found in file perl.c @@ -765,7 +765,7 @@ X Releases a Perl interpreter. See L. - void perl_free(PerlInterpreter* interp) + void perl_free(PerlInterpreter *my_perl) =for hackers Found in file perl.c @@ -775,7 +775,7 @@ X Tells a Perl interpreter to parse a Perl script. See L. - int perl_parse(PerlInterpreter* interp, XSINIT_t xsinit, int argc, char** argv, char** env) + int perl_parse(PerlInterpreter *my_perl, XSINIT_t xsinit, int argc, char** argv, char** env) =for hackers Found in file perl.c @@ -785,7 +785,7 @@ X Tells a Perl interpreter to run. See L. - int perl_run(PerlInterpreter* interp) + int perl_run(PerlInterpreter *my_perl) =for hackers Found in file perl.c @@ -992,7 +992,7 @@ X Like C, but also handles 'set' magic. - void sv_catsv_mg(SV *dstr, SV *sstr) + void sv_catsv_mg(SV *dsv, SV *ssv) =for hackers Found in file mathoms.c @@ -1086,7 +1086,7 @@ A private implementation of the C macro for compilers which can't cope with complex macro expressions. Always use the macro instead. - char* sv_pvbyten(SV *sv, STRLEN *len) + char* sv_pvbyten(SV *sv, STRLEN *lp) =for hackers Found in file mathoms.c @@ -1097,7 +1097,7 @@ X A private implementation of the C macro for compilers which can't cope with complex macro expressions. Always use the macro instead. - char* sv_pvn(SV *sv, STRLEN *len) + char* sv_pvn(SV *sv, STRLEN *lp) =for hackers Found in file mathoms.c @@ -1119,7 +1119,7 @@ A private implementation of the C macro for compilers which can't cope with complex macro expressions. Always use the macro instead. - char* sv_pvutf8n(SV *sv, STRLEN *len) + char* sv_pvutf8n(SV *sv, STRLEN *lp) =for hackers Found in file mathoms.c @@ -1399,6 +1399,8 @@ X Null AV pointer. +(deprecated - use C<(AV *)NULL> instead) + =for hackers Found in file av.h @@ -1415,6 +1417,8 @@ X Null CV pointer. +(deprecated - use C<(CV *)NULL> instead) + =for hackers Found in file cv.h @@ -1423,6 +1427,8 @@ X Null HV pointer. +(deprecated - use C<(HV *)NULL> instead) + =for hackers Found in file hv.h @@ -1512,7 +1518,11 @@ variable C, though this is rather less efficient than using a local variable. Remember though, that hash keys in perl are free to contain embedded nulls, so using C or similar is not a good way to find the length of hash keys. This is very similar to the C macro -described elsewhere in this document. +described elsewhere in this document. See also C. + +If you are using C to get values to pass to C to create a +new SV, you should consider using C as it is more +efficient. char* HePV(HE* he, STRLEN len) @@ -1553,6 +1563,20 @@ C. =for hackers Found in file hv.h +=item HeUTF8 +X + +Returns whether the C value returned by C is encoded in UTF-8, +doing any necessary dereferencing of possibly C keys. The value returned +will be 0 or non-0, not necessarily 1 (or even a value with any low bits set), +so B blindly assign this to a C variable, as C may be a +typedef for C. + + char* HeUTF8(HE* he, STRLEN len) + +=for hackers +Found in file hv.h + =item HeVAL X @@ -1579,7 +1603,7 @@ X Check that a hash is in an internally consistent state. - void hv_assert(HV* tb) + void hv_assert(HV *hv) =for hackers Found in file hv.c @@ -1589,7 +1613,7 @@ X Clears a hash, making it empty. - void hv_clear(HV* tb) + void hv_clear(HV *hv) =for hackers Found in file hv.c @@ -1605,7 +1629,7 @@ but will still allow the hash to have a value reassigned to the key at some future point. This function clears any such placeholder keys from the hash. See Hash::Util::lock_keys() for an example of its use. - void hv_clear_placeholders(HV* hb) + void hv_clear_placeholders(HV *hv) =for hackers Found in file hv.c @@ -1618,7 +1642,7 @@ hash and returned to the caller. The C is the length of the key. The C value will normally be zero; if set to G_DISCARD then NULL will be returned. - SV* hv_delete(HV* tb, const char* key, I32 klen, I32 flags) + SV* hv_delete(HV *hv, const char *key, I32 klen, I32 flags) =for hackers Found in file hv.c @@ -1631,7 +1655,7 @@ hash and returned to the caller. The C value will normally be zero; if set to G_DISCARD then NULL will be returned. C can be a valid precomputed hash value, or 0 to ask for it to be computed. - SV* hv_delete_ent(HV* tb, SV* key, I32 flags, U32 hash) + SV* hv_delete_ent(HV *hv, SV *keysv, I32 flags, U32 hash) =for hackers Found in file hv.c @@ -1642,7 +1666,7 @@ X Returns a boolean indicating whether the specified hash key exists. The C is the length of the key. - bool hv_exists(HV* tb, const char* key, I32 klen) + bool hv_exists(HV *hv, const char *key, I32 klen) =for hackers Found in file hv.c @@ -1654,7 +1678,7 @@ Returns a boolean indicating whether the specified hash key exists. C can be a valid precomputed hash value, or 0 to ask for it to be computed. - bool hv_exists_ent(HV* tb, SV* key, U32 hash) + bool hv_exists_ent(HV *hv, SV *keysv, U32 hash) =for hackers Found in file hv.c @@ -1670,7 +1694,7 @@ dereferencing it to an C. See L for more information on how to use this function on tied hashes. - SV** hv_fetch(HV* tb, const char* key, I32 klen, I32 lval) + SV** hv_fetch(HV *hv, const char *key, I32 klen, I32 lval) =for hackers Found in file hv.c @@ -1699,7 +1723,7 @@ store it somewhere. See L for more information on how to use this function on tied hashes. - HE* hv_fetch_ent(HV* tb, SV* key, I32 lval, U32 hash) + HE* hv_fetch_ent(HV *hv, SV *keysv, I32 lval, U32 hash) =for hackers Found in file hv.c @@ -1716,7 +1740,7 @@ hash buckets that happen to be in use. If you still need that esoteric value, you can get it through the macro C. - I32 hv_iterinit(HV* tb) + I32 hv_iterinit(HV *hv) =for hackers Found in file hv.c @@ -1757,7 +1781,7 @@ to free the entry on the next call to C, so you must not discard your iterator immediately else the entry will leak - call C to trigger the resource deallocation. - HE* hv_iternext(HV* tb) + HE* hv_iternext(HV *hv) =for hackers Found in file hv.c @@ -1768,7 +1792,7 @@ X Performs an C, C, and C in one operation. - SV* hv_iternextsv(HV* hv, char** key, I32* retlen) + SV* hv_iternextsv(HV *hv, char **key, I32 *retlen) =for hackers Found in file hv.c @@ -1788,7 +1812,7 @@ insufficiently abstracted for any change to be tidy. NOTE: this function is experimental and may change or be removed without notice. - HE* hv_iternext_flags(HV* tb, I32 flags) + HE* hv_iternext_flags(HV *hv, I32 flags) =for hackers Found in file hv.c @@ -1799,7 +1823,7 @@ X Returns the value from the current position of the hash iterator. See C. - SV* hv_iterval(HV* tb, HE* entry) + SV* hv_iterval(HV *hv, HE *entry) =for hackers Found in file hv.c @@ -1809,7 +1833,7 @@ X Adds magic to a hash. See C. - void hv_magic(HV* hv, GV* gv, int how) + void hv_magic(HV *hv, GV *gv, int how) =for hackers Found in file hv.c @@ -1819,7 +1843,7 @@ X Evaluates the hash in scalar context and returns the result. Handles magic when the hash is tied. - SV* hv_scalar(HV* hv) + SV* hv_scalar(HV *hv) =for hackers Found in file hv.c @@ -1847,7 +1871,7 @@ hv_store_ent. See L for more information on how to use this function on tied hashes. - SV** hv_store(HV* tb, const char* key, I32 klen, SV* val, U32 hash) + SV** hv_store(HV *hv, const char *key, I32 klen, SV *val, U32 hash) =for hackers Found in file hv.c @@ -1889,7 +1913,7 @@ hv_store in preference to hv_store_ent. See L for more information on how to use this function on tied hashes. - HE* hv_store_ent(HV* tb, SV* key, SV* val, U32 hash) + HE* hv_store_ent(HV *hv, SV *key, SV *val, U32 hash) =for hackers Found in file hv.c @@ -1899,7 +1923,7 @@ X Undefines the hash. - void hv_undef(HV* tb) + void hv_undef(HV *hv) =for hackers Found in file hv.c @@ -1936,7 +1960,7 @@ X Copies the magic from one SV to another. See C. - int mg_copy(SV* sv, SV* nsv, const char* key, I32 klen) + int mg_copy(SV *sv, SV *nsv, const char *key, I32 klen) =for hackers Found in file mg.c @@ -2389,7 +2413,7 @@ C. It returns C if the string can't be found. The C does not have to be fbm_compiled, but the search will not be as fast then. - char* fbm_instr(unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags) + char* fbm_instr(unsigned char* big, unsigned char* bigend, SV* littlestr, U32 flags) =for hackers Found in file util.c @@ -2500,7 +2524,7 @@ is an alpha version). The boolean qv denotes that the version should be interpreted as if it had multiple decimals, even if it doesn't. - const char* scan_version(const char *vstr, SV *sv, bool qv) + const char* scan_version(const char *s, SV *rv, bool qv) =for hackers Found in file util.c @@ -2641,7 +2665,7 @@ X Version object aware cmp. Both operands must already have been converted into version objects. - int vcmp(SV *lvs, SV *rvs) + int vcmp(SV *lhv, SV *rhv) =for hackers Found in file util.c @@ -3288,8 +3312,7 @@ Found in file pp.h X Push an integer onto the stack. The stack must have room for this element. -Handles 'set' magic. Does not use C. See also C, C -and C. +Does not use C. See also C, C and C. void mPUSHi(IV iv) @@ -3300,8 +3323,7 @@ Found in file pp.h X Push a double onto the stack. The stack must have room for this element. -Handles 'set' magic. Does not use C. See also C, C -and C. +Does not use C. See also C, C and C. void mPUSHn(NV nv) @@ -3312,20 +3334,30 @@ Found in file pp.h X Push a string onto the stack. The stack must have room for this element. -The C indicates the length of the string. Handles 'set' magic. Does -not use C. See also C, C and C. +The C indicates the length of the string. Does not use C. +See also C, C and C. void mPUSHp(char* str, STRLEN len) =for hackers Found in file pp.h +=item mPUSHs +X + +Push an SV onto the stack and mortalizes the SV. The stack must have room +for this element. Does not use C. See also C and C. + + void mPUSHs(SV* sv) + +=for hackers +Found in file pp.h + =item mPUSHu X Push an unsigned integer onto the stack. The stack must have room for this -element. Handles 'set' magic. Does not use C. See also C, -C and C. +element. Does not use C. See also C, C and C. void mPUSHu(UV uv) @@ -3335,9 +3367,8 @@ Found in file pp.h =item mXPUSHi X -Push an integer onto the stack, extending the stack if necessary. Handles -'set' magic. Does not use C. See also C, C and -C. +Push an integer onto the stack, extending the stack if necessary. +Does not use C. See also C, C and C. void mXPUSHi(IV iv) @@ -3347,9 +3378,8 @@ Found in file pp.h =item mXPUSHn X -Push a double onto the stack, extending the stack if necessary. Handles -'set' magic. Does not use C. See also C, C and -C. +Push a double onto the stack, extending the stack if necessary. +Does not use C. See also C, C and C. void mXPUSHn(NV nv) @@ -3360,20 +3390,30 @@ Found in file pp.h X Push a string onto the stack, extending the stack if necessary. The C -indicates the length of the string. Handles 'set' magic. Does not use -C. See also C, C and C. +indicates the length of the string. Does not use C. See also C, +C and C. void mXPUSHp(char* str, STRLEN len) =for hackers Found in file pp.h +=item mXPUSHs +X + +Push an SV onto the stack, extending the stack if necessary and mortalizes +the SV. Does not use C. See also C and C. + + void mXPUSHs(SV* sv) + +=for hackers +Found in file pp.h + =item mXPUSHu X Push an unsigned integer onto the stack, extending the stack if necessary. -Handles 'set' magic. Does not use C. See also C, C -and C. +Does not use C. See also C, C and C. void mXPUSHu(UV uv) @@ -3487,8 +3527,7 @@ Found in file pp.h X 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. See also -C, C and C. +element. Does not use C. See also C, C and C. void PUSHmortal() @@ -3595,9 +3634,8 @@ Found in file pp.h =item XPUSHmortal X -Push a new mortal SV onto the stack, extending the stack if necessary. Does -not handle 'set' magic. Does not use C. See also C, -C and C. +Push a new mortal SV onto the stack, extending the stack if necessary. +Does not use C. See also C, C and C. void XPUSHmortal() @@ -4321,16 +4359,32 @@ Found in file sv.h =item SvOOK X -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 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 + +Reads into I the offset from SvPVX back to the true start of the +allocated buffer, which will be non-zero if C has been used to +efficiently remove characters from start of the buffer. Implemented as a +macro, which takes the address of I, which must be of type C. +Evaluates I more than once. Sets I to 0 if C is false. + + void SvOOK_offset(NN SV*sv, STRLEN len) + +=for hackers +Found in file sv.h + =item SvPOK X @@ -4993,7 +5047,7 @@ Returns a boolean indicating whether the SV is derived from the specified class I. To check derivation at the Perl level, call C 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 @@ -5004,7 +5058,7 @@ X 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 @@ -5043,7 +5097,7 @@ Test if the content of an SV looks like a number (or is a number). C and C 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 @@ -5054,7 +5108,7 @@ X Creates an RV wrapper for an SV. The reference count for the original SV is B incremented. - SV* newRV_noinc(SV* sv) + SV* newRV_noinc(SV *const sv) =for hackers Found in file sv.c @@ -5073,7 +5127,7 @@ This aid has been superseded by a new build option, PERL_MEM_LOG (see L). The older API is still there for use in XS modules supporting older perls. - SV* newSV(STRLEN len) + SV* newSV(const STRLEN len) =for hackers Found in file sv.c @@ -5085,7 +5139,7 @@ Creates a new SV from the hash key structure. It will generate scalars that 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 @@ -5096,7 +5150,7 @@ X 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 @@ -5107,7 +5161,7 @@ X 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 @@ -5119,7 +5173,7 @@ Creates a new SV and copies a string into it. The reference count for the SV is set to 1. If C is zero, Perl will compute the length using strlen(). For efficiency, consider using C instead. - SV* newSVpv(const char* s, STRLEN len) + SV* newSVpv(const char *const s, const STRLEN len) =for hackers Found in file sv.c @@ -5130,7 +5184,7 @@ X Creates a new SV and initializes it with the string formatted like C. - SV* newSVpvf(const char* pat, ...) + SV* newSVpvf(const char *const pat, ...) =for hackers Found in file sv.c @@ -5143,7 +5197,7 @@ SV is set to 1. Note that if C is zero, Perl will create a zero length string. You are responsible for ensuring that the source string is at least C bytes long. If the C 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 @@ -5155,14 +5209,15 @@ Creates a new SV and copies a string into it. The reference count for the SV is set to 1. Note that if C is zero, Perl will create a zero length string. You are responsible for ensuring that the source string is at least C bytes long. If the C argument is NULL the new SV will be undefined. -Currently the only flag bit accepted is SVf_UTF8. If this is set, then it -will be set on the new SV. C is a convenience wrapper for -this function, defined as +Currently the only flag bits accepted are C and C. +If C is set, then C is called on the result before +returning. If C is set, then it will be set on the new SV. +C 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) + SV* newSVpvn_flags(const char *const s, const STRLEN len, const U32 flags) =for hackers Found in file sv.c @@ -5193,6 +5248,17 @@ Like C, but takes a literal string instead of a string/length pair. =for hackers Found in file handy.h +=item newSVpvs_flags +X + +Like C, 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 @@ -5212,7 +5278,7 @@ it will be upgraded to one. If C is non-null then the new SV will 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 @@ -5223,7 +5289,7 @@ X Creates a new SV which is an exact duplicate of the original SV. (Uses C). - SV* newSVsv(SV* old) + SV* newSVsv(SV *const old) =for hackers Found in file sv.c @@ -5234,7 +5300,7 @@ X 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 @@ -5245,7 +5311,7 @@ X Creates a new SV, of the type specified. The reference count for the new SV is set to 1. - SV* newSV_type(svtype type) + SV* newSV_type(const svtype type) =for hackers Found in file sv.c @@ -5256,7 +5322,7 @@ X This function is only called on magical items, and is only used by sv_true() or its macro equivalent. - bool sv_2bool(SV* sv) + bool sv_2bool(SV *const sv) =for hackers Found in file sv.c @@ -5268,7 +5334,7 @@ Using various gambits, try to get a CV from an SV; in addition, try if possible to set C<*st> and C<*gvp> to the stash and GV associated with it. The flags in C 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 @@ -5280,7 +5346,7 @@ Using various gambits, try to get an IO from an SV: the IO slot if its a 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 @@ -5292,7 +5358,7 @@ Return the integer value of an SV, doing any necessary string conversion. If flags includes SV_GMAGIC, does an mg_get() first. Normally used via the C and C 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 @@ -5306,7 +5372,7 @@ statement boundaries. SvTEMP() is turned on which means that the SV's string buffer can be "stolen" if this SV is copied. See also C and C. - SV* sv_2mortal(SV* sv) + SV* sv_2mortal(SV *const sv) =for hackers Found in file sv.c @@ -5318,7 +5384,7 @@ Return the num value of an SV, doing any necessary string or integer conversion, magic etc. Normally used via the C and C macros. - NV sv_2nv(SV* sv) + NV sv_2nv(SV *const sv) =for hackers Found in file sv.c @@ -5332,7 +5398,7 @@ side-effect. Usually accessed via the C macro. - char* sv_2pvbyte(SV* sv, STRLEN* lp) + char* sv_2pvbyte(SV *const sv, STRLEN *const lp) =for hackers Found in file sv.c @@ -5345,7 +5411,7 @@ to its length. May cause the SV to be upgraded to UTF-8 as a side-effect. Usually accessed via the C macro. - char* sv_2pvutf8(SV* sv, STRLEN* lp) + char* sv_2pvutf8(SV *const sv, STRLEN *const lp) =for hackers Found in file sv.c @@ -5359,7 +5425,7 @@ if necessary. Normally invoked via the C macro. C and C 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 @@ -5371,7 +5437,7 @@ Return the unsigned integer value of an SV, doing any necessary string conversion. If flags includes SV_GMAGIC, does an mg_get() first. Normally used via the C and C 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 @@ -5382,7 +5448,7 @@ X Remove any string offset. You should normally use the C macro wrapper instead. - int sv_backoff(SV* sv) + int sv_backoff(SV *const sv) =for hackers Found in file sv.c @@ -5394,7 +5460,7 @@ Blesses an SV into a specified package. The SV must be an RV. The package must be designated by its stash (see C). 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 @@ -5406,7 +5472,7 @@ Concatenates the string onto the end of the string which is in the SV. If the SV has the UTF-8 status set, then the bytes appended should be valid UTF-8. Handles 'get' magic, but not 'set' magic. See C. - void sv_catpv(SV* sv, const char* ptr) + void sv_catpv(SV *const sv, const char* ptr) =for hackers Found in file sv.c @@ -5445,7 +5511,7 @@ C indicates number of bytes to copy. If the SV has the UTF-8 status set, then the bytes appended should be valid UTF-8. Handles 'get' magic, but not 'set' magic. See C. - void sv_catpvn(SV* sv, const char* ptr, STRLEN len) + void sv_catpvn(SV *dsv, const char *sstr, STRLEN len) =for hackers Found in file sv.c @@ -5460,7 +5526,7 @@ If C has C bit set, will C on C if appropriate, else not. C and C are implemented in terms of this function. - void sv_catpvn_flags(SV* sv, const char* ptr, STRLEN len, I32 flags) + void sv_catpvn_flags(SV *const dstr, const char *sstr, const STRLEN len, const I32 flags) =for hackers Found in file sv.c @@ -5480,7 +5546,7 @@ X Like C, but also handles 'set' magic. - void sv_catpv_mg(SV *sv, const char *ptr) + void sv_catpv_mg(SV *const sv, const char *const ptr) =for hackers Found in file sv.c @@ -5492,7 +5558,7 @@ Concatenates the string from SV C onto the end of the string in SV C. Modifies C but not C. Handles 'get' magic, but not 'set' magic. See C. - void sv_catsv(SV* dsv, SV* ssv) + void sv_catsv(SV *dstr, SV *sstr) =for hackers Found in file sv.c @@ -5505,7 +5571,7 @@ SV C. Modifies C but not C. If C has C bit set, will C on the SVs if appropriate, else not. C and C are implemented in terms of this function. - void sv_catsv_flags(SV* dsv, SV* ssv, I32 flags) + void sv_catsv_flags(SV *const dsv, SV *const ssv, const I32 flags) =for hackers Found in file sv.c @@ -5520,7 +5586,7 @@ string. Uses the "OOK hack". Beware: after this function returns, C and SvPVX_const(sv) may no longer refer to the same chunk of data. - void sv_chop(SV* sv, const char* ptr) + void sv_chop(SV *const sv, const char *const ptr) =for hackers Found in file sv.c @@ -5536,7 +5602,7 @@ This function should only be called when REFCNT is zero. Most of the time you'll want to call C (or its macro wrapper C) instead. - void sv_clear(SV* sv) + void sv_clear(SV *const sv) =for hackers Found in file sv.c @@ -5549,7 +5615,7 @@ string in C is less than, equal to, or greater than the string in C. Is UTF-8 and 'use bytes' aware, handles get magic, and will coerce its args to strings if necessary. See also C. - I32 sv_cmp(SV* sv1, SV* sv2) + I32 sv_cmp(SV *const sv1, SV *const sv2) =for hackers Found in file sv.c @@ -5559,9 +5625,9 @@ X 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. See also C. +if necessary. See also C. - I32 sv_cmp_locale(SV* sv1, SV* sv2) + I32 sv_cmp_locale(SV *const sv1, SV *const sv2) =for hackers Found in file sv.c @@ -5576,7 +5642,7 @@ scalar data of the variable, but transformed to such a format that a normal memory comparison can be used to compare the data according to the locale settings. - char* sv_collxfrm(SV* sv, STRLEN* nxp) + char* sv_collxfrm(SV *const sv, STRLEN *const nxp) =for hackers Found in file sv.c @@ -5592,7 +5658,7 @@ sv_2pv[_flags] but operates directly on an SV instead of just the 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 @@ -5603,7 +5669,7 @@ X Auto-decrement of the value in the SV, doing string to numeric conversion if necessary. Handles 'get' magic. - void sv_dec(SV* sv) + void sv_dec(SV *const sv) =for hackers Found in file sv.c @@ -5633,7 +5699,7 @@ set to some other value.) In addition, the C parameter gets passed to C when unrefing. C calls this function with flags set to 0. - void sv_force_normal_flags(SV *sv, U32 flags) + void sv_force_normal_flags(SV *const sv, const U32 flags) =for hackers Found in file sv.c @@ -5646,7 +5712,7 @@ C to invoke destructors and free up any memory used by the body; finally, deallocate the SV's head itself. Normally called via a wrapper macro C. - void sv_free(SV* sv) + void sv_free(SV *const sv) =for hackers Found in file sv.c @@ -5657,7 +5723,7 @@ X Get a line from the filehandle and store it into the SV, optionally appending to the currently-stored string. - char* sv_gets(SV* sv, PerlIO* fp, I32 append) + char* sv_gets(SV *const sv, PerlIO *const fp, I32 append) =for hackers Found in file sv.c @@ -5669,7 +5735,7 @@ Expands the character buffer in the SV. If necessary, uses C and upgrades the SV to C. Returns a pointer to the character buffer. Use the C wrapper instead. - char* sv_grow(SV* sv, STRLEN newlen) + char* sv_grow(SV *const sv, STRLEN newlen) =for hackers Found in file sv.c @@ -5680,7 +5746,7 @@ X Auto-increment of the value in the SV, doing string to numeric conversion if necessary. Handles 'get' magic. - void sv_inc(SV* sv) + void sv_inc(SV *const sv) =for hackers Found in file sv.c @@ -5691,7 +5757,7 @@ X Inserts a string at the specified offset/length within the SV. Similar to the Perl substr() function. - void sv_insert(SV* bigsv, STRLEN offset, STRLEN len, const char* little, STRLEN littlelen) + 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 @@ -5703,7 +5769,7 @@ Returns a boolean indicating whether the SV is blessed into the specified class. This does not check for subtypes; use C 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 @@ -5726,7 +5792,7 @@ X Returns the length of the string in the SV. Handles magic and type coercion. See also C, which gives raw access to the xpv_cur slot. - STRLEN sv_len(SV* sv) + STRLEN sv_len(SV *const sv) =for hackers Found in file sv.c @@ -5737,7 +5803,7 @@ X Returns the number of characters in the string in an SV, counting wide UTF-8 bytes as a single character. Handles magic and type coercion. - STRLEN sv_len_utf8(SV* sv) + STRLEN sv_len_utf8(SV *const sv) =for hackers Found in file sv.c @@ -5754,7 +5820,7 @@ handling of the C and C arguments. You need to use C to add magic to SvREADONLY SVs and also to add more than one instance of the same 'how'. - void sv_magic(SV* sv, SV* obj, int how, const char* name, I32 namlen) + void sv_magic(SV *const sv, SV *const obj, const int how, const char *const name, const I32 namlen) =for hackers Found in file sv.c @@ -5776,7 +5842,7 @@ to contain an C and is stored as-is with its REFCNT incremented. (This is now used as a subroutine by C.) - MAGIC * sv_magicext(SV* sv, SV* obj, int how, const MGVTBL *vtbl, const char* name, I32 namlen) + MAGIC * sv_magicext(SV *const sv, SV *const obj, const int how, const MGVTBL *const vtbl, const char *const name, const I32 namlen) =for hackers Found in file sv.c @@ -5789,7 +5855,7 @@ The new SV is marked as mortal. It will be destroyed "soon", either by an explicit call to FREETMPS, or by an implicit call at places such as statement boundaries. See also C and C. - SV* sv_mortalcopy(SV* oldsv) + SV* sv_mortalcopy(SV *const oldsv) =for hackers Found in file sv.c @@ -5813,7 +5879,7 @@ X Increment an SV's reference count. Use the C wrapper instead. - SV* sv_newref(SV* sv) + SV* sv_newref(SV *const sv) =for hackers Found in file sv.c @@ -5825,7 +5891,7 @@ Converts the value pointed to by offsetp from a count of bytes from the start of the string, to a count of the equivalent number of UTF-8 chars. Handles magic and type coercion. - void sv_pos_b2u(SV* sv, I32* offsetp) + void sv_pos_b2u(SV *const sv, I32 *const offsetp) =for hackers Found in file sv.c @@ -5839,7 +5905,7 @@ lenp is non-zero, it does the same to lenp, but this time starting from the offset, rather than from the start of the string. Handles magic and type coercion. - void sv_pos_u2b(SV* sv, I32* offsetp, I32* lenp) + void sv_pos_u2b(SV *const sv, I32 *const offsetp, I32 *const lenp) =for hackers Found in file sv.c @@ -5849,7 +5915,7 @@ X The backend for the C 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 @@ -5876,7 +5942,7 @@ implemented in terms of this function. You normally want to use the various wrapper macros instead: see C and C - 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 @@ -5886,7 +5952,7 @@ X The backend for the C 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 @@ -5896,7 +5962,7 @@ X 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 @@ -5911,7 +5977,7 @@ and any magic in the source is discarded. Note that this is a rather specialist SV copying operation; most of the time you'll want to use C or one of its many macro front-ends. - void sv_replace(SV* sv, SV* nsv) + void sv_replace(SV *const sv, SV *const nsv) =for hackers Found in file sv.c @@ -5922,7 +5988,7 @@ X Underlying implementation for the C 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 @@ -5936,7 +6002,7 @@ push a back-reference to this RV onto the array of backreferences associated with that magic. If the RV is magical, set magic will be called after the RV is cleared. - SV* sv_rvweaken(SV *sv) + SV* sv_rvweaken(SV *const sv) =for hackers Found in file sv.c @@ -5947,7 +6013,7 @@ X Copies an integer into the given SV, upgrading first if necessary. Does not handle 'set' magic. See also C. - void sv_setiv(SV* sv, IV num) + void sv_setiv(SV *const sv, const IV num) =for hackers Found in file sv.c @@ -5957,7 +6023,7 @@ X Like C, 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 @@ -5968,7 +6034,7 @@ X Copies a double into the given SV, upgrading first if necessary. Does not handle 'set' magic. See also C. - void sv_setnv(SV* sv, NV num) + void sv_setnv(SV *const sv, const NV num) =for hackers Found in file sv.c @@ -5978,7 +6044,7 @@ X Like C, 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 @@ -5989,7 +6055,7 @@ X Copies a string into an SV. The string must be null-terminated. Does not handle 'set' magic. See C. - void sv_setpv(SV* sv, const char* ptr) + void sv_setpv(SV *const sv, const char *const ptr) =for hackers Found in file sv.c @@ -6043,7 +6109,7 @@ Copies a string into an SV. The C parameter indicates the number of bytes to be copied. If the C argument is NULL the SV will become undefined. Does not handle 'set' magic. See C. - void sv_setpvn(SV* sv, const char* ptr, STRLEN len) + void sv_setpvn(SV *const sv, const char *const ptr, const STRLEN len) =for hackers Found in file sv.c @@ -6053,7 +6119,7 @@ X Like C, but also handles 'set' magic. - void sv_setpvn_mg(SV *sv, const char *ptr, STRLEN len) + void sv_setpvn_mg(SV *const sv, const char *const ptr, const STRLEN len) =for hackers Found in file sv.c @@ -6073,7 +6139,7 @@ X Like C, but also handles 'set' magic. - void sv_setpv_mg(SV *sv, const char *ptr) + void sv_setpv_mg(SV *const sv, const char *const ptr) =for hackers Found in file sv.c @@ -6087,7 +6153,7 @@ the new SV. The C argument indicates the package for the blessing. Set C to C 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 @@ -6101,7 +6167,7 @@ the new SV. The C argument indicates the package for the blessing. Set C to C 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 @@ -6121,7 +6187,7 @@ objects will become corrupted by the pointer copy process. Note that C 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 @@ -6138,7 +6204,7 @@ of 1, and the RV will be returned. Note that C 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 @@ -6152,7 +6218,7 @@ the new SV. The C argument indicates the package for the blessing. Set C to C 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 @@ -6170,7 +6236,7 @@ You probably want to use one of the assortment of wrappers, such as C, C, C and C. - void sv_setsv(SV* dsv, SV* ssv) + void sv_setsv(SV *dstr, SV *sstr) =for hackers Found in file sv.c @@ -6195,7 +6261,7 @@ C. This is the primary function for copying scalars, and most other copy-ish functions and macros use this underneath. - void sv_setsv_flags(SV* dsv, SV* ssv, I32 flags) + void sv_setsv_flags(SV *dstr, SV *sstr, const I32 flags) =for hackers Found in file sv.c @@ -6205,7 +6271,7 @@ X Like C, but also handles 'set' magic. - void sv_setsv_mg(SV *dstr, SV *sstr) + void sv_setsv_mg(SV *const dstr, SV *const sstr) =for hackers Found in file sv.c @@ -6216,7 +6282,7 @@ X Copies an unsigned integer into the given SV, upgrading first if necessary. Does not handle 'set' magic. See also C. - void sv_setuv(SV* sv, UV num) + void sv_setuv(SV *const sv, const UV num) =for hackers Found in file sv.c @@ -6226,7 +6292,7 @@ X Like C, 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 @@ -6247,7 +6313,7 @@ Returns true if the SV has a true value by Perl's rules. Use the C macro instead, which may call C 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 @@ -6257,7 +6323,7 @@ X Removes all magic of type C from an SV. - int sv_unmagic(SV* sv, int type) + int sv_unmagic(SV *const sv, const int type) =for hackers Found in file sv.c @@ -6273,7 +6339,7 @@ C to force the reference count to be decremented different from one or the reference being a readonly SV). See C. - void sv_unref_flags(SV* sv, U32 flags) + void sv_unref_flags(SV *ref, U32 flags) =for hackers Found in file sv.c @@ -6294,7 +6360,7 @@ Upgrade an SV to a more complex form. Generally adds a new body type to the SV, then copies across as much information as possible from the old body. You generally want to use the C macro wrapper. See also C. - void sv_upgrade(SV* sv, svtype new_type) + void sv_upgrade(SV *const sv, svtype new_type) =for hackers Found in file sv.c @@ -6316,7 +6382,7 @@ SV_HAS_TRAILING_NUL is true, then C must be NUL, and the realloc will be skipped. (i.e. the buffer is actually at least 1 byte longer than C, and already meets the requirements for storing in C) - void sv_usepvn_flags(SV* sv, char* ptr, STRLEN len, U32 flags) + void sv_usepvn_flags(SV *const sv, char* ptr, const STRLEN len, const U32 flags) =for hackers Found in file sv.c @@ -6333,7 +6399,7 @@ Scans PV for validity and returns false if the PV is invalid UTF-8. NOTE: this function is experimental and may change or be removed without notice. - bool sv_utf8_decode(SV *sv) + bool sv_utf8_decode(SV *const sv) =for hackers Found in file sv.c @@ -6352,7 +6418,7 @@ use the Encode extension for that. NOTE: this function is experimental and may change or be removed without notice. - bool sv_utf8_downgrade(SV *sv, bool fail_ok) + bool sv_utf8_downgrade(SV *const sv, const bool fail_ok) =for hackers Found in file sv.c @@ -6363,7 +6429,7 @@ X Converts the PV of an SV to UTF-8, but then turns the C flag off so that it looks like octets again. - void sv_utf8_encode(SV *sv) + void sv_utf8_encode(SV *const sv) =for hackers Found in file sv.c @@ -6397,7 +6463,7 @@ C are implemented in terms of this function. This is not as a general purpose byte encoding to Unicode interface: use the Encode extension for that. - STRLEN sv_utf8_upgrade_flags(SV *sv, I32 flags) + STRLEN sv_utf8_upgrade_flags(SV *const sv, const I32 flags) =for hackers Found in file sv.c @@ -6548,7 +6614,7 @@ For case-insensitiveness, the "casefolding" of Unicode is used instead of upper/lowercasing both the characters, see http://www.unicode.org/unicode/reports/tr21/ (Case Mappings). - I32 ibcmp_utf8(const char* a, char **pe1, UV l1, bool u1, const char* b, char **pe2, UV l2, bool u2) + I32 ibcmp_utf8(const char *s1, char **pe1, UV l1, bool u1, const char *s2, char **pe2, UV l2, bool u2) =for hackers Found in file utf8.c @@ -6561,7 +6627,7 @@ character. Note that an INVARIANT (i.e. ASCII) character is a valid UTF-8 character. The actual number of bytes in the UTF-8 character will be returned if it is valid, otherwise 0. - STRLEN is_utf8_char(const U8 *p) + STRLEN is_utf8_char(const U8 *s) =for hackers Found in file utf8.c