Better options for rsync.
[p5sagit/p5-mst-13.2.git] / pod / perlapi.pod
index f274641..3eda765 100644 (file)
@@ -38,6 +38,28 @@ array itself.
 =for hackers
 Found in file av.c
 
+=item av_delete
+
+Deletes the element indexed by C<key> from the array.  Returns the
+deleted element. C<flags> is currently ignored.
+
+       SV*     av_delete(AV* ar, I32 key, I32 flags)
+
+=for hackers
+Found in file av.c
+
+=item av_exists
+
+Returns true if the element indexed by C<key> 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)
+
+=for hackers
+Found in file av.c
+
 =item av_extend
 
 Pre-extend an array.  The C<key> is the index to which the array should be
@@ -62,6 +84,16 @@ more information on how to use this function on tied arrays.
 =for hackers
 Found in file av.c
 
+=item av_fill
+
+Ensure than an array has a given number of elements, equivalent to
+Perl's C<$#array = $fill;>.
+
+       void    av_fill(AV* ar, I32 fill)
+
+=for hackers
+Found in file av.c
+
 =item av_len
 
 Returns the highest index in the array.  Returns -1 if the array is
@@ -153,9 +185,10 @@ Found in file av.c
 =item bytes_to_utf8
 
 Converts a string C<s> of length C<len> from ASCII into UTF8 encoding.
-Returns a pointer to the newly-created string.
+Returns a pointer to the newly-created string, and sets C<len> to
+reflect the new length.
 
-       U8 *    bytes_to_utf8(U8 *s, STRLEN len)
+       U8 *    bytes_to_utf8(U8 *s, STRLEN *len)
 
 =for hackers
 Found in file utf8.c
@@ -445,7 +478,7 @@ Found in file op.h
 =item GIMME_V
 
 The XSUB-writer's equivalent to Perl's C<wantarray>.  Returns C<G_VOID>,
-C<G_SCALAR> or C<G_ARRAY> for void, scalar or array context,
+C<G_SCALAR> or C<G_ARRAY> for void, scalar or list context,
 respectively.
 
        U32     GIMME_V
@@ -546,7 +579,7 @@ Found in file gv.c
 
 =item G_ARRAY
 
-Used to indicate array context.  See C<GIMME_V>, C<GIMME> and
+Used to indicate list context.  See C<GIMME_V>, C<GIMME> and
 L<perlcall>.
 
 =for hackers
@@ -1641,7 +1674,7 @@ Found in file XSUB.h
 
 The XSUB-writer's interface to the C C<free> function.
 
-       void    Safefree(void* src, void* dest, int nitems, type)
+       void    Safefree(void* ptr)
 
 =for hackers
 Found in file handy.h
@@ -1908,23 +1941,14 @@ Found in file sv.h
 
 =item SvLEN
 
-Returns the size of the string buffer in the SV.  See C<SvCUR>.
+Returns the size of the string buffer in the SV, not including any part
+attributable to C<SvOOK>.  See C<SvCUR>.
 
        STRLEN  SvLEN(SV* sv)
 
 =for hackers
 Found in file sv.h
 
-=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)
-
-=for hackers
-Found in file sv.h
-
 =item SvNIOK
 
 Returns a boolean indicating whether the SV contains a number, integer or
@@ -2347,15 +2371,6 @@ Type flag for blessed scalars.  See C<svtype>.
 =for hackers
 Found in file sv.h
 
-=item SvUNLOCK
-
-Release the internal mutex for an SV.
-
-       void    SvUNLOCK(SV* sv)
-
-=for hackers
-Found in file sv.h
-
 =item SvUPGRADE
 
 Used to upgrade an SV to a more complex form.  Uses C<sv_upgrade> to
@@ -2496,6 +2511,16 @@ string.
 =for hackers
 Found in file sv.c
 
+=item sv_clear
+
+Clear an SV, making it empty. Does not free the memory used by the SV
+itself.
+
+       void    sv_clear(SV* sv)
+
+=for hackers
+Found in file sv.c
+
 =item sv_cmp
 
 Compares the strings in two SVs.  Returns -1, 0, or 1 indicating whether the
@@ -2507,6 +2532,16 @@ C<sv2>.
 =for hackers
 Found in file sv.c
 
+=item sv_cmp_locale
+
+Compares the strings in two SVs in a locale-aware manner. See
+L</sv_cmp_locale>
+
+       I32     sv_cmp_locale(SV* sv1, SV* sv2)
+
+=for hackers
+Found in file sv.c
+
 =item sv_dec
 
 Auto-decrement of the value in the SV.
@@ -2537,6 +2572,25 @@ identical.
 =for hackers
 Found in file sv.c
 
+=item sv_free
+
+Free the memory used by an SV.
+
+       void    sv_free(SV* sv)
+
+=for hackers
+Found in file sv.c
+
+=item sv_gets
+
+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)
+
+=for hackers
+Found in file sv.c
+
 =item sv_grow
 
 Expands the character buffer in the SV.  This will use C<sv_unref> and will
@@ -2598,6 +2652,16 @@ Returns the length of the string in the SV.  See also C<SvCUR>.
 =for hackers
 Found in file sv.c
 
+=item sv_len_utf8
+
+Returns the number of characters in the string in an SV, counting wide
+UTF8 bytes as a single character.
+
+       STRLEN  sv_len_utf8(SV* sv)
+
+=for hackers
+Found in file sv.c
+
 =item sv_magic
 
 Adds magic to an SV.
@@ -2626,6 +2690,52 @@ Creates a new SV which is mortal.  The reference count of the SV is set to 1.
 =for hackers
 Found in file sv.c
 
+=item sv_pvn_force
+
+Get a sensible string out of the SV somehow.
+
+       char*   sv_pvn_force(SV* sv, STRLEN* lp)
+
+=for hackers
+Found in file sv.c
+
+=item sv_pvutf8n_force
+
+Get a sensible UTF8-encoded string out of the SV somehow. See
+L</sv_pvn_force>.
+
+       char*   sv_pvutf8n_force(SV* sv, STRLEN* lp)
+
+=for hackers
+Found in file sv.c
+
+=item sv_reftype
+
+Returns a string describing what the SV is a reference to.
+
+       char*   sv_reftype(SV* sv, int ob)
+
+=for hackers
+Found in file sv.c
+
+=item sv_replace
+
+Make the first argument a copy of the second, then delete the original.
+
+       void    sv_replace(SV* sv, SV* nsv)
+
+=for hackers
+Found in file sv.c
+
+=item sv_rvweaken
+
+Weaken a reference.
+
+       SV*     sv_rvweaken(SV *sv)
+
+=for hackers
+Found in file sv.c
+
 =item sv_setiv
 
 Copies an integer into the given SV.  Does not handle 'set' magic.  See
@@ -2841,6 +2951,24 @@ Like C<sv_setuv>, but also handles 'set' magic.
 =for hackers
 Found in file sv.c
 
+=item sv_true
+
+Returns true if the SV has a true value by Perl's rules.
+
+       I32     sv_true(SV *sv)
+
+=for hackers
+Found in file sv.c
+
+=item sv_unmagic
+
+Removes magic from an SV.
+
+       int     sv_unmagic(SV* sv, int type)
+
+=for hackers
+Found in file sv.c
+
 =item sv_unref
 
 Unsets the RV status of the SV, and decrements the reference count of
@@ -2886,6 +3014,43 @@ Like C<sv_usepvn>, but also handles 'set' magic.
 =for hackers
 Found in file sv.c
 
+=item sv_utf8_downgrade
+
+Attempt to convert the PV of an SV from UTF8-encoded to byte encoding.
+This may not be possible if the PV contains non-byte encoding characters;
+if this is the case, either returns false or, if C<fail_ok> is not
+true, croaks.
+
+NOTE: this function is experimental and may change or be
+removed without notice.
+
+       bool    sv_utf8_downgrade(SV *sv, bool fail_ok)
+
+=for hackers
+Found in file sv.c
+
+=item sv_utf8_encode
+
+Convert the PV of an SV to UTF8-encoded, but then turn off the C<SvUTF8>
+flag so that it looks like bytes again. Nothing calls this. 
+
+NOTE: this function is experimental and may change or be
+removed without notice.
+
+       void    sv_utf8_encode(SV *sv)
+
+=for hackers
+Found in file sv.c
+
+=item sv_utf8_upgrade
+
+Convert the PV of an SV to its UTF8-encoded form.
+
+       void    sv_utf8_upgrade(SV *sv)
+
+=for hackers
+Found in file sv.c
+
 =item sv_vcatpvfn
 
 Processes its arguments like C<vsprintf> and appends the formatted output
@@ -2938,10 +3103,21 @@ Converts the specified character to uppercase.
 =for hackers
 Found in file handy.h
 
+=item U8 *s
+
+Returns true if first C<len> bytes of the given string form valid a UTF8
+string, false otherwise.
+
+       bool_utf8_string        U8 *s(STRLEN len)
+
+=for hackers
+Found in file utf8.c
+
 =item utf8_to_bytes
 
 Converts a string C<s> of length C<len> from UTF8 into ASCII encoding.
 Unlike C<bytes_to_utf8>, this over-writes the original string.
+Returns zero on failure after converting as much as possible.
 
        U8 *    utf8_to_bytes(U8 *s, STRLEN len)