3 * Copyright (c) 1991-1997, 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.
10 /* This structure much match the beginning of XPVFM */
13 char * xpv_pv; /* pointer to malloced string */
14 STRLEN xpv_cur; /* length of xp_pv as a C string */
15 STRLEN xpv_len; /* allocated size */
16 IV xof_off; /* integer value */
17 double xnv_nv; /* numeric value, if any */
18 MAGIC* xmg_magic; /* magic for scalar array */
19 HV* xmg_stash; /* class package */
24 void (*xcv_xsub) _((CV*));
28 long xcv_depth; /* >= 2 indicates recursive call */
32 pthread_mutex_t * xcv_mutexp;
33 pthread_cond_t * xcv_condp; /* signalled when owner leaves CV */
34 struct thread * xcv_owner; /* current owner thread */
35 #endif /* USE_THREADS */
39 #define Nullcv Null(CV*)
41 #define CvSTASH(sv) ((XPVCV*)SvANY(sv))->xcv_stash
42 #define CvSTART(sv) ((XPVCV*)SvANY(sv))->xcv_start
43 #define CvROOT(sv) ((XPVCV*)SvANY(sv))->xcv_root
44 #define CvXSUB(sv) ((XPVCV*)SvANY(sv))->xcv_xsub
45 #define CvXSUBANY(sv) ((XPVCV*)SvANY(sv))->xcv_xsubany
46 #define CvGV(sv) ((XPVCV*)SvANY(sv))->xcv_gv
47 #define CvFILEGV(sv) ((XPVCV*)SvANY(sv))->xcv_filegv
48 #define CvDEPTH(sv) ((XPVCV*)SvANY(sv))->xcv_depth
49 #define CvPADLIST(sv) ((XPVCV*)SvANY(sv))->xcv_padlist
50 #define CvOUTSIDE(sv) ((XPVCV*)SvANY(sv))->xcv_outside
52 #define CvMUTEXP(sv) ((XPVCV*)SvANY(sv))->xcv_mutexp
53 #define CvCONDP(sv) ((XPVCV*)SvANY(sv))->xcv_condp
54 #define CvOWNER(sv) ((XPVCV*)SvANY(sv))->xcv_owner
55 #endif /* USE_THREADS */
56 #define CvFLAGS(sv) ((XPVCV*)SvANY(sv))->xcv_flags
58 #define CVf_CLONE 0x01 /* anon CV uses external lexicals */
59 #define CVf_CLONED 0x02 /* a clone of one of those */
60 #define CVf_ANON 0x04 /* CvGV() can't be trusted */
61 #define CVf_OLDSTYLE 0x08
62 #define CVf_UNIQUE 0x10 /* can't be cloned */
63 #define CVf_NODEBUG 0x20 /* no DB::sub indirection for this CV
64 (esp. useful for special XSUBs) */
66 #define CvCLONE(cv) (CvFLAGS(cv) & CVf_CLONE)
67 #define CvCLONE_on(cv) (CvFLAGS(cv) |= CVf_CLONE)
68 #define CvCLONE_off(cv) (CvFLAGS(cv) &= ~CVf_CLONE)
70 #define CvCLONED(cv) (CvFLAGS(cv) & CVf_CLONED)
71 #define CvCLONED_on(cv) (CvFLAGS(cv) |= CVf_CLONED)
72 #define CvCLONED_off(cv) (CvFLAGS(cv) &= ~CVf_CLONED)
74 #define CvANON(cv) (CvFLAGS(cv) & CVf_ANON)
75 #define CvANON_on(cv) (CvFLAGS(cv) |= CVf_ANON)
76 #define CvANON_off(cv) (CvFLAGS(cv) &= ~CVf_ANON)
78 #define CvOLDSTYLE(cv) (CvFLAGS(cv) & CVf_OLDSTYLE)
79 #define CvOLDSTYLE_on(cv) (CvFLAGS(cv) |= CVf_OLDSTYLE)
80 #define CvOLDSTYLE_off(cv) (CvFLAGS(cv) &= ~CVf_OLDSTYLE)
82 #define CvUNIQUE(cv) (CvFLAGS(cv) & CVf_UNIQUE)
83 #define CvUNIQUE_on(cv) (CvFLAGS(cv) |= CVf_UNIQUE)
84 #define CvUNIQUE_off(cv) (CvFLAGS(cv) &= ~CVf_UNIQUE)
86 #define CvNODEBUG(cv) (CvFLAGS(cv) & CVf_NODEBUG)
87 #define CvNODEBUG_on(cv) (CvFLAGS(cv) |= CVf_NODEBUG)
88 #define CvNODEBUG_off(cv) (CvFLAGS(cv) &= ~CVf_NODEBUG)