summaryrefslogtreecommitdiff
path: root/cv.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-09-05 22:07:18 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-09-05 22:07:18 +0000
commitcd06dffe59d60ee6a2fdd7c81f8cef42c7026b36 (patch)
treebf5d5d4e9d1c11e7d63fd97ce74470e8bedc88d3 /cv.h
parenta2126434f8dd8eabb11a2219137816815758ea93 (diff)
downloadperl-cd06dffe59d60ee6a2fdd7c81f8cef42c7026b36.tar.gz
initial implementation of lvalue subroutines (slightly fixed
version of patch suggested by Ilya Zakharevich, which in turn is based on the one suggested by Tuomas J. Lukka <lukka@iki.fi>) p4raw-id: //depot/perl@4081
Diffstat (limited to 'cv.h')
-rw-r--r--cv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/cv.h b/cv.h
index 704270871c..67d4a8ef6e 100644
--- a/cv.h
+++ b/cv.h
@@ -62,6 +62,7 @@ struct xpvcv {
(esp. useful for special XSUBs) */
#define CVf_METHOD 0x0040 /* CV is explicitly marked as a method */
#define CVf_LOCKED 0x0080 /* CV locks itself or first arg on entry */
+#define CVf_LVALUE 0x0100 /* CV return value can be used as lvalue */
#define CvCLONE(cv) (CvFLAGS(cv) & CVf_CLONE)
#define CvCLONE_on(cv) (CvFLAGS(cv) |= CVf_CLONE)
@@ -97,6 +98,10 @@ struct xpvcv {
#define CvLOCKED_on(cv) (CvFLAGS(cv) |= CVf_LOCKED)
#define CvLOCKED_off(cv) (CvFLAGS(cv) &= ~CVf_LOCKED)
+#define CvLVALUE(cv) (CvFLAGS(cv) & CVf_LVALUE)
+#define CvLVALUE_on(cv) (CvFLAGS(cv) |= CVf_LVALUE)
+#define CvLVALUE_off(cv) (CvFLAGS(cv) &= ~CVf_LVALUE)
+
#define CvEVAL(cv) (CvUNIQUE(cv) && !SvFAKE(cv))
#define CvEVAL_on(cv) (CvUNIQUE_on(cv),SvFAKE_off(cv))
#define CvEVAL_off(cv) CvUNIQUE_off(cv)