Mopup for #6204.
[p5sagit/p5-mst-13.2.git] / pod / perlapi.pod
index 897fcdc..9b3d20a 100644 (file)
@@ -45,8 +45,8 @@ Returns the SV at the specified index in the array.  The C<key> is the
 index.  If C<lval> is set then the fetch will be part of a store.  Check
 that the return value is non-null before dereferencing it to a C<SV*>.
 
-See L<Understanding the Magic of Tied Hashes and Arrays> for more information
-on how to use this function on tied arrays. 
+See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for
+more information on how to use this function on tied arrays. 
 
        SV**    av_fetch(AV* ar, I32 key, I32 lval)
 
@@ -95,7 +95,7 @@ that the caller is responsible for suitably incrementing the reference
 count of C<val> before the call, and decrementing it if the function
 returned NULL.
 
-See L<Understanding the Magic of Tied Hashes and Arrays> for
+See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for
 more information on how to use this function on tied arrays.
 
        SV**    av_store(AV* ar, I32 key, SV* val)
@@ -165,9 +165,16 @@ the type.  May fail on overlapping copies.  See also C<Move>.
 
 =item croak
 
-This is the XSUB-writer's interface to Perl's C<die> function.  Use this
-function the same way you use the C C<printf> function.  See
-C<warn>.
+This is the XSUB-writer's interface to Perl's C<die> function.
+Normally use this function the same way you use the C C<printf>
+function.  See C<warn>.
+
+If you want to throw an exception object, assign the object to
+C<$@> and then pass C<Nullch> to croak():
+
+   errsv = get_sv("@", TRUE);
+   sv_setsv(errsv, exception_object);
+   croak(Nullch);
 
        void    croak(const char* pat, ...)
 
@@ -237,7 +244,7 @@ NOTE: the perl_ form of this function is deprecated.
 =item EXTEND
 
 Used to extend the argument stack for an XSUB's return values. Once
-used, guarrantees that there is room for at least C<nitems> to be pushed
+used, guarantees that there is room for at least C<nitems> to be pushed
 onto the stack.
 
        void    EXTEND(SP, int nitems)
@@ -341,7 +348,7 @@ up caching info for this glob.  Similarly for all the searched stashes.
 
 This function grants C<"SUPER"> token as a postfix of the stash name. The
 GV returned from C<gv_fetchmeth> may be a method cache entry, which is not
-visible to Perl code.  So when calling C<perl_call_sv>, you should not use
+visible to Perl code.  So when calling C<call_sv>, you should not use
 the GV directly; instead, you should use the method's CV, which can be
 obtained from the GV with the C<GvCV> macro. 
 
@@ -349,7 +356,7 @@ obtained from the GV with the C<GvCV> macro.
 
 =item gv_fetchmethod
 
-See L<gv_fetchmethod_autoload.
+See L<gv_fetchmethod_autoload>.
 
        GV*     gv_fetchmethod(HV* stash, const char* name)
 
@@ -375,23 +382,23 @@ created via a side effect to do this.
 These functions have the same side-effects and as C<gv_fetchmeth> with
 C<level==0>.  C<name> should be writable if contains C<':'> or C<'
 ''>. The warning against passing the GV returned by C<gv_fetchmeth> to
-C<perl_call_sv> apply equally to these functions. 
+C<call_sv> apply equally to these functions. 
 
        GV*     gv_fetchmethod_autoload(HV* stash, const char* name, I32 autoload)
 
 =item gv_stashpv
 
-Returns a pointer to the stash for a specified package.  If C<create> is
-set then the package will be created if it does not already exist.  If
-C<create> is not set and the package does not exist then NULL is
-returned.
+Returns a pointer to the stash for a specified package.  C<name> should
+be a valid UTF-8 string.  If C<create> is set then the package will be
+created if it does not already exist.  If C<create> is not set and the
+package does not exist then NULL is returned.
 
        HV*     gv_stashpv(const char* name, I32 create)
 
 =item gv_stashsv
 
-Returns a pointer to the stash for a specified package.  See
-C<gv_stashpv>.
+Returns a pointer to the stash for a specified package, which must be a
+valid UTF-8 string.  See C<gv_stashpv>.
 
        HV*     gv_stashsv(SV* sv, I32 create)
 
@@ -548,7 +555,7 @@ C<klen> is the length of the key.  If C<lval> is set then the fetch will be
 part of a store.  Check that the return value is non-null before
 dereferencing it to a C<SV*>. 
 
-See L<Understanding the Magic of Tied Hashes and Arrays> for more
+See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
 information on how to use this function on tied hashes.
 
        SV**    hv_fetch(HV* tb, const char* key, U32 klen, I32 lval)
@@ -563,7 +570,7 @@ accessing it.  The return value when C<tb> is a tied hash is a pointer to a
 static location, so be sure to make a copy of the structure if you need to
 store it somewhere. 
 
-See L<Understanding the Magic of Tied Hashes and Arrays> for more
+See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
 information on how to use this function on tied hashes.
 
        HE*     hv_fetch_ent(HV* tb, SV* key, I32 lval, U32 hash)
@@ -632,7 +639,7 @@ be dereferenced to get the original C<SV*>.  Note that the caller is
 responsible for suitably incrementing the reference count of C<val> before
 the call, and decrementing it if the function returned NULL.  
 
-See L<Understanding the Magic of Tied Hashes and Arrays> for more
+See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
 information on how to use this function on tied hashes.
 
        SV**    hv_store(HV* tb, const char* key, U32 klen, SV* val, U32 hash)
@@ -649,7 +656,7 @@ described here.  Note that the caller is responsible for suitably
 incrementing the reference count of C<val> before the call, and
 decrementing it if the function returned NULL. 
 
-See L<Understanding the Magic of Tied Hashes and Arrays> for more
+See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
 information on how to use this function on tied hashes.
 
        HE*     hv_store_ent(HV* tb, SV* key, SV* val, U32 hash)
@@ -662,21 +669,21 @@ Undefines the hash.
 
 =item isALNUM
 
-Returns a boolean indicating whether the C C<char> is an ascii alphanumeric
-character or digit.
+Returns a boolean indicating whether the C C<char> is an ASCII alphanumeric
+character (including underscore) or digit.
 
        bool    isALNUM(char ch)
 
 =item isALPHA
 
-Returns a boolean indicating whether the C C<char> is an ascii alphabetic
+Returns a boolean indicating whether the C C<char> is an ASCII alphabetic
 character.
 
        bool    isALPHA(char ch)
 
 =item isDIGIT
 
-Returns a boolean indicating whether the C C<char> is an ascii
+Returns a boolean indicating whether the C C<char> is an ASCII
 digit.
 
        bool    isDIGIT(char ch)
@@ -897,6 +904,13 @@ Creates a new SV which is an exact duplicate of the original SV.
 
        SV*     newSVsv(SV* old)
 
+=item newSVuv
+
+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)
+
 =item newXS
 
 Used by C<xsubpp> to hook up XSUBs as Perl subs.
@@ -1256,7 +1270,7 @@ wrapper for C<strncmp>).
 
 =item StructCopy
 
-This is an architecture-independant macro to copy one structure to another.
+This is an architecture-independent macro to copy one structure to another.
 
        void    StructCopy(type src, type dest, type)
 
@@ -1345,6 +1359,13 @@ Returns the size of the string buffer in the SV.  See C<SvCUR>.
 
        STRLEN  SvLEN(SV* sv)
 
+=item SvLOCK
+
+Aquires an internal mutex for a SV. Used to make sure multiple threads
+don't stomp on the guts of an SV at the same time
+
+       void    SvLOCK(SV* sv)
+
 =item SvNIOK
 
 Returns a boolean indicating whether the SV contains a number, integer or
@@ -1629,6 +1650,12 @@ Type flag for hashes.  See C<svtype>.
 
 Type flag for blessed scalars.  See C<svtype>.
 
+=item SvUNLOCK
+
+Release the internal mutex for an SV.
+
+       void    SvUNLOCK(SV* sv)
+
 =item SvUPGRADE
 
 Used to upgrade an SV to a more complex form.  Uses C<sv_upgrade> to