perlfunc.pod grammar fixes
[p5sagit/p5-mst-13.2.git] / pod / perlapi.pod
index ba8b4a8..0d8a2cc 100644 (file)
@@ -1078,7 +1078,8 @@ Found in file hv.h
 
 =item HvNAME
 
-Returns the package name of a stash.  See C<SvSTASH>, C<CvSTASH>.
+Returns the package name of a stash, or NULL if C<stash> isn't a stash.
+See C<SvSTASH>, C<CvSTASH>.
 
        char*   HvNAME(HV* stash)
 
@@ -1598,31 +1599,37 @@ optimise.
 =for hackers
 Found in file handy.h
 
-=item New
+=item Newx
 
 The XSUB-writer's interface to the C C<malloc> function.
 
-       void    New(int id, void* ptr, int nitems, type)
+In 5.9.3, Newx() and friends replace the older New() API, and drops
+the first parameter, I<x>, a debug aid which allowed callers to identify
+themselves.  This aid has been superceded by a new build option,
+PERL_MEM_LOG (see L<perlhack/PERL_MEM_LOG>).  The older API is still
+there for use in XS modules supporting older perls.
+
+       void    Newx(void* ptr, int nitems, type)
 
 =for hackers
 Found in file handy.h
 
-=item Newc
+=item Newxc
 
 The XSUB-writer's interface to the C C<malloc> function, with
-cast.
+cast.  See also C<Newx>.
 
-       void    Newc(int id, void* ptr, int nitems, type, cast)
+       void    Newxc(void* ptr, int nitems, type, cast)
 
 =for hackers
 Found in file handy.h
 
-=item Newz
+=item Newxz
 
 The XSUB-writer's interface to the C C<malloc> function.  The allocated
-memory is zeroed with C<memzero>.
+memory is zeroed with C<memzero>.  See also C<Newx>.
 
-       void    Newz(int id, void* ptr, int nitems, type)
+       void    Newxz(void* ptr, int nitems, type)
 
 =for hackers
 Found in file handy.h
@@ -1828,7 +1835,7 @@ is a alpha version).  The boolean qv denotes that the version
 should be interpreted as if it had multiple decimals, even if
 it doesn't.
 
-       char*   scan_version(const char *vstr, SV *sv, bool qv)
+       const char*     scan_version(const char *vstr, SV *sv, bool qv)
 
 =for hackers
 Found in file util.c
@@ -2042,7 +2049,7 @@ C<PERL_SCAN_DISALLOW_PREFIX> is set in I<*flags> on entry. If
 C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the binary
 number may use '_' characters to separate digits.
 
-       UV      grok_bin(const char* start, STRLEN* len, I32* flags, NV *result)
+       UV      grok_bin(const char* start, STRLEN* len_p, I32* flags, NV *result)
 
 =for hackers
 Found in file numeric.c
@@ -2070,7 +2077,7 @@ C<PERL_SCAN_DISALLOW_PREFIX> is set in I<*flags> on entry. If
 C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the hex
 number may use '_' characters to separate digits.
 
-       UV      grok_hex(const char* start, STRLEN* len, I32* flags, NV *result)
+       UV      grok_hex(const char* start, STRLEN* len_p, I32* flags, NV *result)
 
 =for hackers
 Found in file numeric.c
@@ -2130,7 +2137,7 @@ is NULL).
 If C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> then the octal
 number may use '_' characters to separate digits.
 
-       UV      grok_oct(const char* start, STRLEN* len, I32* flags, NV *result)
+       UV      grok_oct(const char* start, STRLEN* len_p, I32* flags, NV *result)
 
 =for hackers
 Found in file numeric.c
@@ -2441,8 +2448,7 @@ Found in file pp.h
 
 =item POPp
 
-Pops a string off the stack. Deprecated. New code should provide
-a STRLEN n_a and use POPpx.
+Pops a string off the stack. Deprecated. New code should use POPpx.
 
        char*   POPp
 
@@ -2452,7 +2458,6 @@ Found in file pp.h
 =item POPpbytex
 
 Pops a string off the stack which must consist of bytes i.e. characters < 256.
-Requires a variable STRLEN n_a in scope.
 
        char*   POPpbytex
 
@@ -2462,7 +2467,6 @@ Found in file pp.h
 =item POPpx
 
 Pops a string off the stack.
-Requires a variable STRLEN n_a in scope.
 
        char*   POPpx
 
@@ -2942,6 +2946,17 @@ macro.
 =for hackers
 Found in file sv.c
 
+=item newSVhek
+
+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)
+
+=for hackers
+Found in file sv.c
+
 =item newSViv
 
 Creates a new SV and copies an integer into it.  The reference count for the
@@ -2997,12 +3012,12 @@ Found in file sv.c
 
 =item newSVpvn_share
 
-Creates a new SV with its SvPVX pointing to a shared string in the string
+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 == HeKEY and
+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)
@@ -3053,7 +3068,8 @@ Found in file sv.h
 
 =item SvCUR_set
 
-Set the length of the string which is in the SV.  See C<SvCUR>.
+Set the current length of the string which is in the SV.  See C<SvCUR>
+and C<SvIV_set>.
 
        void    SvCUR_set(SV* sv, STRLEN len)
 
@@ -3215,6 +3231,18 @@ Like C<SvIV> but doesn't process magic.
 =for hackers
 Found in file sv.h
 
+=item SvIV_set
+
+Set the value of the IV pointer in sv to val.  It is possible to perform
+the same function of this macro with an lvalue assignment to C<SvIVX>.
+With future Perls, however, it will be more efficient to use 
+C<SvIV_set> instead of the lvalue assignment to C<SvIVX>.
+
+       void    SvIV_set(SV* sv, IV val)
+
+=for hackers
+Found in file sv.h
+
 =item SvLEN
 
 Returns the size of the string buffer in the SV, not including any part
@@ -3225,6 +3253,24 @@ attributable to C<SvOOK>.  See C<SvCUR>.
 =for hackers
 Found in file sv.h
 
+=item SvLEN_set
+
+Set the actual length of the string which is in the SV.  See C<SvIV_set>.
+
+       void    SvLEN_set(SV* sv, STRLEN len)
+
+=for hackers
+Found in file sv.h
+
+=item SvMAGIC_set
+
+Set the value of the MAGIC pointer in sv to val.  See C<SvIV_set>.
+
+       void    SvMAGIC_set(SV* sv, MAGIC* val)
+
+=for hackers
+Found in file sv.h
+
 =item SvNIOK
 
 Returns a boolean indicating whether the SV contains a number, integer or
@@ -3330,6 +3376,15 @@ sv only once. Use the more efficient C<SvNV> otherwise.
 =for hackers
 Found in file sv.h
 
+=item SvNV_set
+
+Set the value of the NV pointer in sv to val.  See C<SvIV_set>.
+
+       void    SvNV_set(SV* sv, NV val)
+
+=for hackers
+Found in file sv.h
+
 =item SvOK
 
 Returns a boolean indicating whether the value is an SV. It also tells
@@ -3581,6 +3636,15 @@ Like C<SvPV> but doesn't process magic.
 =for hackers
 Found in file sv.h
 
+=item SvPV_set
+
+Set the value of the PV pointer in sv to val.  See C<SvIV_set>.
+
+       void    SvPV_set(SV* sv, char* val)
+
+=for hackers
+Found in file sv.h
+
 =item SvREFCNT
 
 Returns the value of the object's reference count.
@@ -3644,6 +3708,15 @@ Dereferences an RV to return the SV.
 =for hackers
 Found in file sv.h
 
+=item SvRV_set
+
+Set the value of the RV pointer in sv to val.  See C<SvIV_set>.
+
+       void    SvRV_set(SV* sv, SV* val)
+
+=for hackers
+Found in file sv.h
+
 =item SvSTASH
 
 Returns the stash of the SV.
@@ -3653,6 +3726,15 @@ Returns the stash of the SV.
 =for hackers
 Found in file sv.h
 
+=item SvSTASH_set
+
+Set the value of the STASH pointer in sv to val.  See C<SvIV_set>.
+
+       void    SvSTASH_set(SV* sv, STASH* val)
+
+=for hackers
+Found in file sv.h
+
 =item SvTAINT
 
 Taints an SV if tainting is enabled.
@@ -3800,6 +3882,15 @@ Like C<SvUV> but doesn't process magic.
 =for hackers
 Found in file sv.h
 
+=item SvUV_set
+
+Set the value of the UV pointer in sv to val.  See C<SvIV_set>.
+
+       void    SvUV_set(SV* sv, UV val)
+
+=for hackers
+Found in file sv.h
+
 =item SvVOK
 
 Returns a boolean indicating whether the SV contains a v-string.
@@ -4113,10 +4204,10 @@ Efficient removal of characters from the beginning of the string buffer.
 SvPOK(sv) must be true and the C<ptr> must be a pointer to somewhere inside
 the string buffer.  The C<ptr> becomes the first character of the adjusted
 string. Uses the "OOK hack".
-Beware: after this function returns, C<ptr> and SvPVX(sv) may no longer
+Beware: after this function returns, C<ptr> and SvPVX_const(sv) may no longer
 refer to the same chunk of data.
 
-       void    sv_chop(SV* sv, char* ptr)
+       void    sv_chop(SV* sv, const char* ptr)
 
 =for hackers
 Found in file sv.c
@@ -4789,7 +4880,7 @@ of 1, and the RV will be returned.
 
 Note that C<sv_setref_pv> copies the pointer while this copies the string.
 
-       SV*     sv_setref_pvn(SV* rv, const char* classname, char* pv, STRLEN n)
+       SV*     sv_setref_pvn(SV* rv, const char* classname, const char* pv, STRLEN n)
 
 =for hackers
 Found in file sv.c
@@ -4962,7 +5053,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<SvUPGRADE> macro wrapper. See also C<svtype>.
 
-       bool    sv_upgrade(SV* sv, U32 mt)
+       void    sv_upgrade(SV* sv, U32 mt)
 
 =for hackers
 Found in file sv.c
@@ -5238,6 +5329,8 @@ UTF-8 string, false otherwise.  Note that 'a valid UTF-8 string' does
 not mean 'a string that contains code points above 0x7F encoded in UTF-8'
 because a valid ASCII string is a valid UTF-8 string.
 
+See also is_utf8_string_loclen() and is_utf8_string_loc().
+
        bool    is_utf8_string(const U8 *s, STRLEN len)
 
 =for hackers
@@ -5245,14 +5338,31 @@ Found in file utf8.c
 
 =item is_utf8_string_loc
 
-Like is_ut8_string but store the location of the failure in
-the last argument.
+Like is_ut8_string() but stores the location of the failure (in the
+case of "utf8ness failure") or the location s+len (in the case of
+"utf8ness success") in the C<ep>.
+
+See also is_utf8_string_loclen() and is_utf8_string().
 
        bool    is_utf8_string_loc(const U8 *s, STRLEN len, const U8 **p)
 
 =for hackers
 Found in file utf8.c
 
+=item is_utf8_string_loclen
+
+Like is_ut8_string() but stores the location of the failure (in the
+case of "utf8ness failure") or the location s+len (in the case of
+"utf8ness success") in the C<ep>, and the number of UTF-8
+encoded characters in the C<el>.
+
+See also is_utf8_string_loc() and is_utf8_string().
+
+       bool    is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el)
+
+=for hackers
+Found in file utf8.c
+
 =item pv_uni_display
 
 Build to the scalar dsv a displayable version of the string spv,
@@ -5345,7 +5455,7 @@ Perl_to_utf8_case().
 The "normal" is a string like "ToLower" which means the swash
 %utf8::ToLower.
 
-       UV      to_utf8_case(const U8 *p, U8* ustrp, STRLEN *lenp, SV **swash, const char *normal, const char *special)
+       UV      to_utf8_case(const U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, const char *normal, const char *special)
 
 =for hackers
 Found in file utf8.c
@@ -5419,7 +5529,7 @@ length, in bytes, of that character.
 
 Allows length and flags to be passed to low level routine.
 
-       UV      utf8n_to_uvchr(const U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags)
+       UV      utf8n_to_uvchr(const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
 
 =for hackers
 Found in file utf8.c
@@ -5444,7 +5554,7 @@ the strict UTF-8 encoding (see F<utf8.h>).
 
 Most code should use utf8_to_uvchr() rather than call this directly.
 
-       UV      utf8n_to_uvuni(const U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags)
+       UV      utf8n_to_uvuni(const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
 
 =for hackers
 Found in file utf8.c
@@ -5511,7 +5621,7 @@ length, in bytes, of that character.
 If C<s> does not point to a well-formed UTF-8 character, zero is
 returned and retlen is set, if possible, to -1.
 
-       UV      utf8_to_uvchr(const U8 *s, STRLEN* retlen)
+       UV      utf8_to_uvchr(const U8 *s, STRLEN *retlen)
 
 =for hackers
 Found in file utf8.c
@@ -5528,7 +5638,7 @@ an index into the Unicode semantic tables (e.g. swashes).
 If C<s> does not point to a well-formed UTF-8 character, zero is
 returned and retlen is set, if possible, to -1.
 
-       UV      utf8_to_uvuni(const U8 *s, STRLEN* retlen)
+       UV      utf8_to_uvuni(const U8 *s, STRLEN *retlen)
 
 =for hackers
 Found in file utf8.c