This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document the SvIOK_.*UV().
[perl5.git] / sv.h
diff --git a/sv.h b/sv.h
index b77a9d3..b91cc5f 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -442,6 +442,15 @@ Unsets the IV status of an SV.
 =for apidoc Am|void|SvIOK_only|SV* sv
 Tells an SV that it is an integer and disables all other OK bits.
 
+=for apidoc Am|void|SvIOK_only_UV|SV* sv
+Tells and SV that it is an unsigned integer and disables all other OK bits.
+
+=for apidoc Am|void|SvIOK_UV|SV* sv
+Returns a boolean indicating whether the SV contains an unsigned integer.
+
+=for apidoc Am|void|SvIOK_notUV|SV* sv
+Returns a boolean indicating whether the SV contains an signed integer.
+
 =for apidoc Am|bool|SvNOK|SV* sv
 Returns a boolean indicating whether the SV contains a double.
 
@@ -505,7 +514,8 @@ string.
 Returns the length of the string which is in the SV.  See C<SvLEN>.
 
 =for apidoc Am|STRLEN|SvLEN|SV* sv
-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>.
 
 =for apidoc Am|char*|SvEND|SV* sv
 Returns a pointer to the last character in the string which is in the SV.
@@ -611,6 +621,8 @@ Set the length of the string which is in the SV.  See C<SvCUR>.
 #define SvAMAGIC_on(sv)                (SvFLAGS(sv) |= SVf_AMAGIC)
 #define SvAMAGIC_off(sv)       (SvFLAGS(sv) &= ~SVf_AMAGIC)
 
+#define SvGAMAGIC(sv)           (SvFLAGS(sv) & (SVs_GMG|SVf_AMAGIC)) 
+
 /*
 #define Gv_AMG(stash) \
         (HV_AMAGICmb(stash) && \
@@ -733,18 +745,15 @@ Set the length of the string which is in the SV.  See C<SvCUR>.
 #define IoTYPE(sv)     ((XPVIO*)  SvANY(sv))->xio_type
 #define IoFLAGS(sv)    ((XPVIO*)  SvANY(sv))->xio_flags
 
-/*
-IoTYPE(sv) is a single character saying what type of I/O connection
-this is:
-    |        pipe
-    -        stdin or stdout
-    <        read-only
-    >        write-only
-    a        append
-    +        read and write
-    s        socket
-    space    closed
-*/
+/* IoTYPE(sv) is a single character telling the type of I/O connection. */
+#define IoTYPE_RDONLY  '<'
+#define IoTYPE_WRONLY  '>'
+#define IoTYPE_RDWR    '+'
+#define IoTYPE_APPEND  'a'
+#define IoTYPE_PIPE    '|'
+#define IoTYPE_STD     '-'     /* stdin or stdout */
+#define IoTYPE_SOCKET  's'
+#define IoTYPE_CLOSED  ' '
 
 /*
 =for apidoc Am|bool|SvTAINTED|SV* sv
@@ -1022,13 +1031,6 @@ indicated number of bytes (remember to reserve space for an extra trailing
 NUL character).  Calls C<sv_grow> to perform the expansion if necessary. 
 Returns a pointer to the character buffer.
 
-=for apidoc Am|void|SvLOCK|SV* sv
-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
-
-=for apidoc Am|void|SvUNLOCK|SV* sv
-Release the internal mutex for an SV.
-
 =cut
 */
 
@@ -1064,9 +1066,6 @@ Release the internal mutex for an SV.
                SvSetSV_nosteal_and(dst,src,SvSETMAGIC(dst))
 
 #ifdef DEBUGGING
-
-#define SvLOCK(sv)     MUTEX_LOCK(&PL_sv_lock_mutex)
-#define SvUNLOCK(sv)   MUTEX_UNLOCK(&PL_sv_lock_mutex)
 #define SvPEEK(sv) sv_peek(sv)
 #else
 #define SvPEEK(sv) ""