perlfunc.pod patch re flock via fcntl
[p5sagit/p5-mst-13.2.git] / pod / perlapi.pod
index 6665191..397f52b 100644 (file)
@@ -329,7 +329,7 @@ L<perlsub/"Constant Functions">.
        SV*     cv_const_sv(CV* cv)
 
 =for hackers
-Found in file opmini.c
+Found in file op.c
 
 =item dAX
 
@@ -575,7 +575,7 @@ returns UV_MAX, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,
 and writes the value to I<*result> (or the value is discarded if I<result>
 is NULL).
 
-The hex number may optinally be prefixed with "0b" or "b" unless
+The hex number may optionally be prefixed with "0b" or "b" unless
 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.
@@ -601,7 +601,7 @@ returns UV_MAX, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,
 and writes the value to I<*result> (or the value is discarded if I<result>
 is NULL).
 
-The hex number may optinally be prefixed with "0x" or "x" unless
+The hex number may optionally be prefixed with "0x" or "x" unless
 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.
@@ -794,7 +794,7 @@ Found in file cop.h
 =item HEf_SVKEY
 
 This flag, used in the length slot of hash entries and magic structures,
-specifies the structure contains a C<SV*> pointer where a C<char*> pointer
+specifies the structure contains an C<SV*> pointer where a C<char*> pointer
 is to be expected. (For information only--not to be used).
 
 =for hackers
@@ -958,7 +958,7 @@ Found in file hv.c
 Returns the SV which corresponds to the specified key in the hash.  The
 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*>.
+dereferencing it to an C<SV*>.
 
 See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
 information on how to use this function on tied hashes.
@@ -1108,6 +1108,22 @@ Undefines the hash.
 =for hackers
 Found in file hv.c
 
+=item ibcmp_utf8
+
+Return true if the strings s1 and s2 differ case-insensitively, false
+if not (if they are equal case-insensitively).  If u1 is true, the
+string s1 is assumed to be in UTF-8-encoded Unicode.  If u2 is true,
+the string s2 is assumed to be in UTF-8-encoded Unicode.
+
+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, bool ua, I32 len1, const char* b, bool ub, I32 len2)
+
+=for hackers
+Found in file utf8.c
+
 =item isALNUM
 
 Returns a boolean indicating whether the C C<char> is an ASCII alphanumeric
@@ -1234,7 +1250,7 @@ method, similar to C<use Foo::Bar VERSION LIST>.
        void    load_module(U32 flags, SV* name, SV* ver, ...)
 
 =for hackers
-Found in file opmini.c
+Found in file op.c
 
 =item looks_like_number
 
@@ -1373,7 +1389,7 @@ eligible for inlining at compile-time.
        CV*     newCONSTSUB(HV* stash, char* name, SV* sv)
 
 =for hackers
-Found in file opmini.c
+Found in file op.c
 
 =item newHV
 
@@ -1533,7 +1549,7 @@ Found in file sv.c
 Used by C<xsubpp> to hook up XSUBs as Perl subs.
 
 =for hackers
-Found in file opmini.c
+Found in file op.c
 
 =item newXSproto
 
@@ -1553,6 +1569,24 @@ memory is zeroed with C<memzero>.
 =for hackers
 Found in file handy.h
 
+=item new_vstring
+
+Returns a pointer to the next character after the parsed
+vstring, as well as updating the passed in sv.
+ *
+Function must be called like
+       
+        sv = NEWSV(92,5);
+       s = new_vstring(s,sv);
+
+The sv must already be large enough to store the vstring
+passed in.
+
+       char*   new_vstring(char *vstr, SV *sv)
+
+=for hackers
+Found in file util.c
+
 =item Nullav
 
 Null AV pointer.
@@ -1849,6 +1883,19 @@ See C<PUSHMARK> and L<perlcall> for other uses.
 =for hackers
 Found in file pp.h
 
+=item pv_uni_display
+
+Build to the scalar dsv a displayable version of the string spv,
+length len, the displayable version being at most pvlim bytes long
+(if longer, the rest is truncated and "..." will be appended).
+The flags argument is currently unused but available for future extensions.
+The pointer to the PV of the dsv is returned.
+
+       char*   pv_uni_display(SV *dsv, U8 *spv, STRLEN len, STRLEN pvlim, UV flags)
+
+=for hackers
+Found in file utf8.c
+
 =item Renew
 
 The XSUB-writer's interface to the C C<realloc> function.
@@ -1980,7 +2027,7 @@ Found in file sharedsv.c
 =item sharedsv_lock
 
 Recursive locks on a sharedsv.
-Locks are dynamicly scoped at the level of the first lock.
+Locks are dynamically scoped at the level of the first lock.
        void    sharedsv_lock(shared_sv* ssv)
 
 =for hackers
@@ -2023,15 +2070,14 @@ Found in file sharedsv.c
 
 =item sortsv
 
-   
 Sort an array. Here is an example:
 
-    sortsv(AvARRAY(av), av_len(av)+1, Perl_sv_cmp_locale); 
+    sortsv(AvARRAY(av), av_len(av)+1, Perl_sv_cmp_locale);
 
-       void    sortsv(SV ** array, size_t num_elts, SVCOMPARE_t f)
+       void    sortsv(SV ** array, size_t num_elts, SVCOMPARE_t cmp)
 
 =for hackers
-Found in file pp_ctl.c
+Found in file pp_sort.c
 
 =item SP
 
@@ -2220,7 +2266,7 @@ Found in file sv.h
 
 =item SvIOK_notUV
 
-Returns a boolean indicating whether the SV contains an signed integer.
+Returns a boolean indicating whether the SV contains a signed integer.
 
        void    SvIOK_notUV(SV* sv)
 
@@ -2282,22 +2328,22 @@ version which guarantees to evaluate sv only once.
 =for hackers
 Found in file sv.h
 
-=item SvIVX
+=item SvIVx
 
-Returns the raw value in the SV's IV slot, without checks or conversions.
-Only use when you are sure SvIOK is true. See also C<SvIV()>.
+Coerces the given SV to an integer and returns it. Guarantees to evaluate
+sv only once. Use the more efficient C<SvIV> otherwise.
 
-       IV      SvIVX(SV* sv)
+       IV      SvIVx(SV* sv)
 
 =for hackers
 Found in file sv.h
 
-=item SvIVx
+=item SvIVX
 
-Coerces the given SV to an integer and returns it. Guarantees to evaluate
-sv only once. Use the more efficent C<SvIV> otherwise.
+Returns the raw value in the SV's IV slot, without checks or conversions.
+Only use when you are sure SvIOK is true. See also C<SvIV()>.
 
-       IV      SvIVx(SV* sv)
+       IV      SvIVX(SV* sv)
 
 =for hackers
 Found in file sv.h
@@ -2400,7 +2446,7 @@ Found in file sv.h
 =item SvNVx
 
 Coerces the given SV to a double and returns it. Guarantees to evaluate
-sv only once. Use the more efficent C<SvNV> otherwise.
+sv only once. Use the more efficient C<SvNV> otherwise.
 
        NV      SvNVx(SV* sv)
 
@@ -2519,7 +2565,7 @@ Found in file sv.h
 =item SvPVbytex
 
 Like C<SvPV>, but converts sv to byte representation first if necessary.
-Guarantees to evalute sv only once; use the more efficient C<SvPVbyte>
+Guarantees to evaluate sv only once; use the more efficient C<SvPVbyte>
 otherwise.
 
 
@@ -2531,7 +2577,7 @@ Found in file sv.h
 =item SvPVbytex_force
 
 Like C<SvPV_force>, but converts sv to byte representation first if necessary.
-Guarantees to evalute sv only once; use the more efficient C<SvPVbyte_force>
+Guarantees to evaluate sv only once; use the more efficient C<SvPVbyte_force>
 otherwise.
 
        char*   SvPVbytex_force(SV* sv, STRLEN len)
@@ -2552,14 +2598,14 @@ Found in file sv.h
 
 Like C<SvPV_nolen>, but converts sv to byte representation first if necessary.
 
-       char*   SvPVbyte_nolen(SV* sv, STRLEN len)
+       char*   SvPVbyte_nolen(SV* sv)
 
 =for hackers
 Found in file sv.h
 
 =item SvPVutf8
 
-Like C<SvPV>, but converts sv to uft8 first if necessary.
+Like C<SvPV>, but converts sv to utf8 first if necessary.
 
        char*   SvPVutf8(SV* sv, STRLEN len)
 
@@ -2568,8 +2614,8 @@ Found in file sv.h
 
 =item SvPVutf8x
 
-Like C<SvPV>, but converts sv to uft8 first if necessary.
-Guarantees to evalute sv only once; use the more efficient C<SvPVutf8>
+Like C<SvPV>, but converts sv to utf8 first if necessary.
+Guarantees to evaluate sv only once; use the more efficient C<SvPVutf8>
 otherwise.
 
        char*   SvPVutf8x(SV* sv, STRLEN len)
@@ -2579,8 +2625,8 @@ Found in file sv.h
 
 =item SvPVutf8x_force
 
-Like C<SvPV_force>, but converts sv to uft8 first if necessary.
-Guarantees to evalute sv only once; use the more efficient C<SvPVutf8_force>
+Like C<SvPV_force>, but converts sv to utf8 first if necessary.
+Guarantees to evaluate sv only once; use the more efficient C<SvPVutf8_force>
 otherwise.
 
        char*   SvPVutf8x_force(SV* sv, STRLEN len)
@@ -2590,7 +2636,7 @@ Found in file sv.h
 
 =item SvPVutf8_force
 
-Like C<SvPV_force>, but converts sv to uft8 first if necessary.
+Like C<SvPV_force>, but converts sv to utf8 first if necessary.
 
        char*   SvPVutf8_force(SV* sv, STRLEN len)
 
@@ -2599,9 +2645,9 @@ Found in file sv.h
 
 =item SvPVutf8_nolen
 
-Like C<SvPV_nolen>, but converts sv to uft8 first if necessary.
+Like C<SvPV_nolen>, but converts sv to utf8 first if necessary.
 
-       char*   SvPVutf8_nolen(SV* sv, STRLEN len)
+       char*   SvPVutf8_nolen(SV* sv)
 
 =for hackers
 Found in file sv.h
@@ -2950,22 +2996,22 @@ for a version which guarantees to evaluate sv only once.
 =for hackers
 Found in file sv.h
 
-=item SvUVX
+=item SvUVx
 
-Returns the raw value in the SV's UV slot, without checks or conversions.
-Only use when you are sure SvIOK is true. See also C<SvUV()>.
+Coerces the given SV to an unsigned integer and returns it. Guarantees to
+evaluate sv only once. Use the more efficient C<SvUV> otherwise.
 
-       UV      SvUVX(SV* sv)
+       UV      SvUVx(SV* sv)
 
 =for hackers
 Found in file sv.h
 
-=item SvUVx
+=item SvUVX
 
-Coerces the given SV to an unsigned integer and returns it. Guarantees to
-evaluate sv only once. Use the more efficent C<SvUV> otherwise.
+Returns the raw value in the SV's UV slot, without checks or conversions.
+Only use when you are sure SvIOK is true. See also C<SvUV()>.
 
-       UV      SvUVx(SV* sv)
+       UV      SvUVX(SV* sv)
 
 =for hackers
 Found in file sv.h
@@ -3662,6 +3708,24 @@ instead.
 =for hackers
 Found in file sv.c
 
+=item sv_recode_to_utf8
+
+The encoding is assumed to be an Encode object, on entry the PV
+of the sv is assumed to be octets in that encoding, and the sv
+will be converted into Unicode (and UTF-8).
+
+If the sv already is UTF-8 (or if it is not POK), or if the encoding
+is not a reference, nothing is done to the sv.  If the encoding is not
+an C<Encode::XS> Encoding object, bad things will happen.
+(See F<lib/encoding.pm> and L<Encode>).
+
+The PV of the sv is returned.
+
+       char*   sv_recode_to_utf8(SV* sv, SV *encoding)
+
+=for hackers
+Found in file sv.c
+
 =item sv_reftype
 
 Returns a string describing what the SV is a reference to.
@@ -4000,6 +4064,19 @@ instead use an in-line version.
 =for hackers
 Found in file sv.c
 
+=item sv_uni_display
+
+Build to the scalar dsv a displayable version of the scalar sv,
+he displayable version being at most pvlim bytes long
+(if longer, the rest is truncated and "..." will be appended).
+The flags argument is currently unused but available for future extensions.
+The pointer to the PV of the dsv is returned.
+
+       char*   sv_uni_display(SV *dsv, SV *ssv, STRLEN pvlim, UV flags)
+
+=for hackers
+Found in file utf8.c
+
 =item sv_unmagic
 
 Removes all magic of type C<type> from an SV.
@@ -4211,6 +4288,31 @@ Converts the specified character to uppercase.
 =for hackers
 Found in file handy.h
 
+=item to_utf8_case
+
+The "p" contains the pointer to the UTF-8 string encoding
+the character that is being converted.
+
+The "ustrp" is a pointer to the character buffer to put the
+conversion result to.  The "lenp" is a pointer to the length
+of the result.
+
+The "swash" is a pointer to the swash to use.
+
+The "normal" is a string like "ToLower" which means the swash
+$utf8::ToLower, which is stored in lib/unicore/To/Lower.pl,
+and loaded by SWASHGET, using lib/utf8_heavy.pl.
+
+The "special" is a string like "utf8::ToSpecLower", which means
+the hash %utf8::ToSpecLower, which is stored in the same file,
+lib/unicore/To/Lower.pl, and also loaded by SWASHGET.  The access
+to the hash is by Perl_to_utf8_case().
+
+       UV      to_utf8_case(U8 *p, U8* ustrp, STRLEN *lenp, SV **swash, char *normal, char *special)
+
+=for hackers
+Found in file utf8.c
+
 =item utf8n_to_uvchr
 
 Returns the native character value of the first character in the string C<s>
@@ -4351,20 +4453,28 @@ is the recommended wide native character-aware way of saying
 =for hackers
 Found in file utf8.c
 
-=item uvuni_to_utf8
+=item uvuni_to_utf8_flags
 
 Adds the UTF8 representation of the Unicode codepoint C<uv> to the end
 of the string C<d>; C<d> should be have at least C<UTF8_MAXLEN+1> free
 bytes available. The return value is the pointer to the byte after the
 end of the new character. In other words,
 
+    d = uvuni_to_utf8_flags(d, uv, flags);
+
+or, in most cases,
+
     d = uvuni_to_utf8(d, uv);
 
+(which is equivalent to)
+
+    d = uvuni_to_utf8_flags(d, uv, 0);
+
 is the recommended Unicode-aware way of saying
 
     *(d++) = uv;
 
-       U8*     uvuni_to_utf8(U8 *d, UV uv)
+       U8*     uvuni_to_utf8_flags(U8 *d, UV uv, UV flags)
 
 =for hackers
 Found in file utf8.c
@@ -4478,7 +4588,7 @@ Found in file XSUB.h
 
 =item XSRETURN_NV
 
-Return an double from an XSUB immediately.  Uses C<XST_mNV>.
+Return a double from an XSUB immediately.  Uses C<XST_mNV>.
 
        void    XSRETURN_NV(NV nv)