3 * Copyright (c) 1991-1994, Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
11 char * xpv_pv; /* pointer to malloced string */
12 STRLEN xpv_cur; /* length of xp_pv as a C string */
13 STRLEN xpv_len; /* allocated size */
14 IV xof_off; /* integer value */
15 double xnv_nv; /* numeric value, if any */
16 MAGIC* xmg_magic; /* magic for scalar array */
17 HV* xmg_stash; /* class package */
22 void (*xcv_xsub) _((CV*));
26 long xcv_depth; /* >= 2 indicates recursive call */
30 pthread_mutex_t * xcv_mutexp;
31 pthread_cond_t * xcv_condp; /* signalled when owner leaves CV */
32 struct thread * xcv_owner; /* current owner thread */
33 #endif /* USE_THREADS */
37 #define Nullcv Null(CV*)
39 #define CvSTASH(sv) ((XPVCV*)SvANY(sv))->xcv_stash
40 #define CvSTART(sv) ((XPVCV*)SvANY(sv))->xcv_start
41 #define CvROOT(sv) ((XPVCV*)SvANY(sv))->xcv_root
42 #define CvXSUB(sv) ((XPVCV*)SvANY(sv))->xcv_xsub
43 #define CvXSUBANY(sv) ((XPVCV*)SvANY(sv))->xcv_xsubany
44 #define CvGV(sv) ((XPVCV*)SvANY(sv))->xcv_gv
45 #define CvFILEGV(sv) ((XPVCV*)SvANY(sv))->xcv_filegv
46 #define CvDEPTH(sv) ((XPVCV*)SvANY(sv))->xcv_depth
47 #define CvPADLIST(sv) ((XPVCV*)SvANY(sv))->xcv_padlist
48 #define CvOUTSIDE(sv) ((XPVCV*)SvANY(sv))->xcv_outside
50 #define CvMUTEXP(sv) ((XPVCV*)SvANY(sv))->xcv_mutexp
51 #define CvCONDP(sv) ((XPVCV*)SvANY(sv))->xcv_condp
52 #define CvOWNER(sv) ((XPVCV*)SvANY(sv))->xcv_owner
53 #endif /* USE_THREADS */
54 #define CvFLAGS(sv) ((XPVCV*)SvANY(sv))->xcv_flags
56 #define CVf_CLONE 0x01 /* anon CV uses external lexicals */
57 #define CVf_CLONED 0x02 /* a clone of one of those */
58 #define CVf_ANON 0x04 /* CvGV() can't be trusted */
59 #define CVf_OLDSTYLE 0x08
61 #define CvCLONE(cv) (CvFLAGS(cv) & CVf_CLONE)
62 #define CvCLONE_on(cv) (CvFLAGS(cv) |= CVf_CLONE)
63 #define CvCLONE_off(cv) (CvFLAGS(cv) &= ~CVf_CLONE)
65 #define CvCLONED(cv) (CvFLAGS(cv) & CVf_CLONED)
66 #define CvCLONED_on(cv) (CvFLAGS(cv) |= CVf_CLONED)
67 #define CvCLONED_off(cv) (CvFLAGS(cv) &= ~CVf_CLONED)
69 #define CvANON(cv) (CvFLAGS(cv) & CVf_ANON)
70 #define CvANON_on(cv) (CvFLAGS(cv) |= CVf_ANON)
71 #define CvANON_off(cv) (CvFLAGS(cv) &= ~CVf_ANON)
73 #define CvOLDSTYLE(cv) (CvFLAGS(cv) & CVf_OLDSTYLE)
74 #define CvOLDSTYLE_on(cv) (CvFLAGS(cv) |= CVf_OLDSTYLE)
75 #define CvOLDSTYLE_off(cv) (CvFLAGS(cv) &= ~CVf_OLDSTYLE)