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 #undef sv_flags /* Convex has this in <signal.h> for sigvec() */
33 /* Using C's structural equivalence to help emulate C++ inheritance here... */
36 void* sv_any; /* pointer to something */
37 U32 sv_refcnt; /* how many references to us */
38 U32 sv_flags; /* what we are */
42 XPVGV* sv_any; /* pointer to something */
43 U32 sv_refcnt; /* how many references to us */
44 U32 sv_flags; /* what we are */
48 XPVCV* sv_any; /* pointer to something */
49 U32 sv_refcnt; /* how many references to us */
50 U32 sv_flags; /* what we are */
54 XPVAV* sv_any; /* pointer to something */
55 U32 sv_refcnt; /* how many references to us */
56 U32 sv_flags; /* what we are */
60 XPVHV* sv_any; /* pointer to something */
61 U32 sv_refcnt; /* how many references to us */
62 U32 sv_flags; /* what we are */
66 XPVIO* sv_any; /* pointer to something */
67 U32 sv_refcnt; /* how many references to us */
68 U32 sv_flags; /* what we are */
71 #define SvANY(sv) (sv)->sv_any
72 #define SvFLAGS(sv) (sv)->sv_flags
74 #define SvREFCNT(sv) (sv)->sv_refcnt
76 #define SvREFCNT_inc(sv) sv_newref((SV*)sv)
77 #define SvREFCNT_dec(sv) sv_free((SV*)sv)
79 #define SvREFCNT_inc(sv) ((Sv = (SV*)(sv)), \
80 (Sv && ++SvREFCNT(Sv)), (SV*)Sv)
81 #define SvREFCNT_dec(sv) sv_free((SV*)sv)
84 #define SVTYPEMASK 0xff
85 #define SvTYPE(sv) ((sv)->sv_flags & SVTYPEMASK)
87 #define SvUPGRADE(sv, mt) (SvTYPE(sv) >= mt || sv_upgrade(sv, mt))
89 #define SVs_PADBUSY 0x00000100 /* reserved for tmp or my already */
90 #define SVs_PADTMP 0x00000200 /* in use as tmp */
91 #define SVs_PADMY 0x00000400 /* in use a "my" variable */
92 #define SVs_TEMP 0x00000800 /* string is stealable? */
93 #define SVs_OBJECT 0x00001000 /* is "blessed" */
94 #define SVs_GMG 0x00002000 /* has magical get method */
95 #define SVs_SMG 0x00004000 /* has magical set method */
96 #define SVs_RMG 0x00008000 /* has random magical methods */
98 #define SVf_IOK 0x00010000 /* has valid public integer value */
99 #define SVf_NOK 0x00020000 /* has valid public numeric value */
100 #define SVf_POK 0x00040000 /* has valid public pointer value */
101 #define SVf_ROK 0x00080000 /* has a valid reference pointer */
103 #define SVf_FAKE 0x00100000 /* glob or lexical is just a copy */
104 #define SVf_OOK 0x00200000 /* has valid offset value */
105 #define SVf_BREAK 0x00400000 /* refcnt is artificially low */
106 #define SVf_READONLY 0x00800000 /* may not be modified */
108 #define SVf_THINKFIRST (SVf_READONLY|SVf_ROK)
110 #define SVp_IOK 0x01000000 /* has valid non-public integer value */
111 #define SVp_NOK 0x02000000 /* has valid non-public numeric value */
112 #define SVp_POK 0x04000000 /* has valid non-public pointer value */
113 #define SVp_SCREAM 0x08000000 /* has been studied? */
115 #define SVf_OK (SVf_IOK|SVf_NOK|SVf_POK|SVf_ROK| \
116 SVp_IOK|SVp_NOK|SVp_POK)
119 #define SVf_AMAGIC 0x10000000 /* has magical overloaded methods */
120 #endif /* OVERLOAD */
124 /* Some private flags. */
126 #define SVpfm_COMPILED 0x80000000
128 #define SVpbm_VALID 0x80000000
129 #define SVpbm_CASEFOLD 0x40000000
130 #define SVpbm_TAIL 0x20000000
132 #define SVphv_SHAREKEYS 0x20000000 /* keys live on shared string table */
135 #define SVpgv_AM 0x40000000
136 /* #define SVpgv_badAM 0x20000000 */
137 #endif /* OVERLOAD */
140 SV * xrv_rv; /* pointer to another SV */
144 char * xpv_pv; /* pointer to malloced string */
145 STRLEN xpv_cur; /* length of xpv_pv as a C string */
146 STRLEN xpv_len; /* allocated size */
150 char * xpv_pv; /* pointer to malloced string */
151 STRLEN xpv_cur; /* length of xpv_pv as a C string */
152 STRLEN xpv_len; /* allocated size */
153 IV xiv_iv; /* integer value or pv offset */
157 char * xpv_pv; /* pointer to malloced string */
158 STRLEN xpv_cur; /* length of xpv_pv as a C string */
159 STRLEN xpv_len; /* allocated size */
160 IV xiv_iv; /* integer value or pv offset */
161 double xnv_nv; /* numeric value, if any */
165 char * xpv_pv; /* pointer to malloced string */
166 STRLEN xpv_cur; /* length of xpv_pv as a C string */
167 STRLEN xpv_len; /* allocated size */
168 IV xiv_iv; /* integer value or pv offset */
169 double xnv_nv; /* numeric value, if any */
170 MAGIC* xmg_magic; /* linked list of magicalness */
171 HV* xmg_stash; /* class package */
175 char * xpv_pv; /* pointer to malloced string */
176 STRLEN xpv_cur; /* length of xpv_pv as a C string */
177 STRLEN xpv_len; /* allocated size */
178 IV xiv_iv; /* integer value or pv offset */
179 double xnv_nv; /* numeric value, if any */
180 MAGIC* xmg_magic; /* linked list of magicalness */
181 HV* xmg_stash; /* class package */
190 char * xpv_pv; /* pointer to malloced string */
191 STRLEN xpv_cur; /* length of xpv_pv as a C string */
192 STRLEN xpv_len; /* allocated size */
193 IV xiv_iv; /* integer value or pv offset */
194 double xnv_nv; /* numeric value, if any */
195 MAGIC* xmg_magic; /* linked list of magicalness */
196 HV* xmg_stash; /* class package */
206 char * xpv_pv; /* pointer to malloced string */
207 STRLEN xpv_cur; /* length of xpv_pv as a C string */
208 STRLEN xpv_len; /* allocated size */
209 IV xiv_iv; /* integer value or pv offset */
210 double xnv_nv; /* numeric value, if any */
211 MAGIC* xmg_magic; /* linked list of magicalness */
212 HV* xmg_stash; /* class package */
214 I32 xbm_useful; /* is this constant pattern being useful? */
215 U16 xbm_previous; /* how many characters in string before rare? */
216 U8 xbm_rare; /* rarest character in string */
220 char * xpv_pv; /* pointer to malloced string */
221 STRLEN xpv_cur; /* length of xpv_pv as a C string */
222 STRLEN xpv_len; /* allocated size */
223 IV xiv_iv; /* integer value or pv offset */
224 double xnv_nv; /* numeric value, if any */
225 MAGIC* xmg_magic; /* linked list of magicalness */
226 HV* xmg_stash; /* class package */
231 void (*xcv_xsub)_((CV*));
235 long xcv_depth; /* >= 2 indicates recursive call */
242 char * xpv_pv; /* pointer to malloced string */
243 STRLEN xpv_cur; /* length of xpv_pv as a C string */
244 STRLEN xpv_len; /* allocated size */
245 IV xiv_iv; /* integer value or pv offset */
246 double xnv_nv; /* numeric value, if any */
247 MAGIC* xmg_magic; /* linked list of magicalness */
248 HV* xmg_stash; /* class package */
250 FILE * xio_ifp; /* ifp and ofp are normally the same */
251 FILE * xio_ofp; /* but sockets need separate streams */
252 DIR * xio_dirp; /* for opendir, readdir, etc */
253 long xio_lines; /* $. */
254 long xio_page; /* $% */
255 long xio_page_len; /* $= */
256 long xio_lines_left; /* $- */
257 char * xio_top_name; /* $^ */
258 GV * xio_top_gv; /* $^ */
259 char * xio_fmt_name; /* $~ */
260 GV * xio_fmt_gv; /* $~ */
261 char * xio_bottom_name;/* $^B */
262 GV * xio_bottom_gv; /* $^B */
263 short xio_subprocess; /* -| or |- */
268 #define IOf_ARGV 1 /* this fp iterates over ARGV */
269 #define IOf_START 2 /* check for null ARGV and substitute '-' */
270 #define IOf_FLUSH 4 /* this fp wants a flush after write op */
271 #define IOf_DIDTOP 8 /* just did top of form */
273 /* The following macros define implementation-independent predicates on SVs. */
275 #define SvNIOK(sv) (SvFLAGS(sv) & (SVf_IOK|SVf_NOK))
276 #define SvNIOKp(sv) (SvFLAGS(sv) & (SVp_IOK|SVp_NOK))
277 #define SvNIOK_off(sv) (SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK| \
280 #define SvOK(sv) (SvFLAGS(sv) & SVf_OK)
283 #define SvOK_off(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC), \
286 #define SvOK_off(sv) (SvFLAGS(sv) &= ~SVf_OK, SvOOK_off(sv))
287 #endif /* OVERLOAD */
289 #define SvOKp(sv) (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK))
290 #define SvIOKp(sv) (SvFLAGS(sv) & SVp_IOK)
291 #define SvIOKp_on(sv) (SvOOK_off(sv), SvFLAGS(sv) |= SVp_IOK)
292 #define SvNOKp(sv) (SvFLAGS(sv) & SVp_NOK)
293 #define SvNOKp_on(sv) (SvFLAGS(sv) |= SVp_NOK)
294 #define SvPOKp(sv) (SvFLAGS(sv) & SVp_POK)
295 #define SvPOKp_on(sv) (SvFLAGS(sv) |= SVp_POK)
297 #define SvIOK(sv) (SvFLAGS(sv) & SVf_IOK)
298 #define SvIOK_on(sv) (SvOOK_off(sv), \
299 SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
300 #define SvIOK_off(sv) (SvFLAGS(sv) &= ~(SVf_IOK|SVp_IOK))
301 #define SvIOK_only(sv) (SvOOK_off(sv), SvOK_off(sv), \
302 SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
304 #define SvNOK(sv) (SvFLAGS(sv) & SVf_NOK)
305 #define SvNOK_on(sv) (SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
306 #define SvNOK_off(sv) (SvFLAGS(sv) &= ~(SVf_NOK|SVp_NOK))
307 #define SvNOK_only(sv) (SvOK_off(sv), \
308 SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
310 #define SvPOK(sv) (SvFLAGS(sv) & SVf_POK)
311 #define SvPOK_on(sv) (SvFLAGS(sv) |= (SVf_POK|SVp_POK))
312 #define SvPOK_off(sv) (SvFLAGS(sv) &= ~(SVf_POK|SVp_POK))
315 #define SvPOK_only(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC), \
316 SvFLAGS(sv) |= (SVf_POK|SVp_POK))
318 #define SvPOK_only(sv) (SvFLAGS(sv) &= ~SVf_OK, \
319 SvFLAGS(sv) |= (SVf_POK|SVp_POK))
320 #endif /* OVERLOAD */
322 #define SvOOK(sv) (SvFLAGS(sv) & SVf_OOK)
323 #define SvOOK_on(sv) (SvIOK_off(sv), SvFLAGS(sv) |= SVf_OOK)
324 #define SvOOK_off(sv) (SvOOK(sv) && sv_backoff(sv))
326 #define SvFAKE(sv) (SvFLAGS(sv) & SVf_FAKE)
327 #define SvFAKE_on(sv) (SvFLAGS(sv) |= SVf_FAKE)
328 #define SvFAKE_off(sv) (SvFLAGS(sv) &= ~SVf_FAKE)
330 #define SvROK(sv) (SvFLAGS(sv) & SVf_ROK)
331 #define SvROK_on(sv) (SvFLAGS(sv) |= SVf_ROK)
334 #define SvROK_off(sv) (SvFLAGS(sv) &= ~(SVf_ROK|SVf_AMAGIC))
336 #define SvROK_off(sv) (SvFLAGS(sv) &= ~SVf_ROK)
337 #endif /* OVERLOAD */
339 #define SvMAGICAL(sv) (SvFLAGS(sv) & (SVs_GMG|SVs_SMG|SVs_RMG))
340 #define SvMAGICAL_on(sv) (SvFLAGS(sv) |= (SVs_GMG|SVs_SMG|SVs_RMG))
341 #define SvMAGICAL_off(sv) (SvFLAGS(sv) &= ~(SVs_GMG|SVs_SMG|SVs_RMG))
343 #define SvGMAGICAL(sv) (SvFLAGS(sv) & SVs_GMG)
344 #define SvGMAGICAL_on(sv) (SvFLAGS(sv) |= SVs_GMG)
345 #define SvGMAGICAL_off(sv) (SvFLAGS(sv) &= ~SVs_GMG)
347 #define SvSMAGICAL(sv) (SvFLAGS(sv) & SVs_SMG)
348 #define SvSMAGICAL_on(sv) (SvFLAGS(sv) |= SVs_SMG)
349 #define SvSMAGICAL_off(sv) (SvFLAGS(sv) &= ~SVs_SMG)
351 #define SvRMAGICAL(sv) (SvFLAGS(sv) & SVs_RMG)
352 #define SvRMAGICAL_on(sv) (SvFLAGS(sv) |= SVs_RMG)
353 #define SvRMAGICAL_off(sv) (SvFLAGS(sv) &= ~SVs_RMG)
356 #define SvAMAGIC(sv) (SvFLAGS(sv) & SVf_AMAGIC)
357 #define SvAMAGIC_on(sv) (SvFLAGS(sv) |= SVf_AMAGIC)
358 #define SvAMAGIC_off(sv) (SvFLAGS(sv) &= ~SVf_AMAGIC)
361 #define Gv_AMG(stash) \
362 (HV_AMAGICmb(stash) && \
363 ((!HV_AMAGICbad(stash) && HV_AMAGIC(stash)) || Gv_AMupdate(stash)))
365 #define Gv_AMG(stash) (amagic_generation && Gv_AMupdate(stash))
366 #endif /* OVERLOAD */
368 #define SvTHINKFIRST(sv) (SvFLAGS(sv) & SVf_THINKFIRST)
370 #define SvPADBUSY(sv) (SvFLAGS(sv) & SVs_PADBUSY)
372 #define SvPADTMP(sv) (SvFLAGS(sv) & SVs_PADTMP)
373 #define SvPADTMP_on(sv) (SvFLAGS(sv) |= SVs_PADTMP|SVs_PADBUSY)
374 #define SvPADTMP_off(sv) (SvFLAGS(sv) &= ~SVs_PADTMP)
376 #define SvPADMY(sv) (SvFLAGS(sv) & SVs_PADMY)
377 #define SvPADMY_on(sv) (SvFLAGS(sv) |= SVs_PADMY|SVs_PADBUSY)
379 #define SvTEMP(sv) (SvFLAGS(sv) & SVs_TEMP)
380 #define SvTEMP_on(sv) (SvFLAGS(sv) |= SVs_TEMP)
381 #define SvTEMP_off(sv) (SvFLAGS(sv) &= ~SVs_TEMP)
383 #define SvOBJECT(sv) (SvFLAGS(sv) & SVs_OBJECT)
384 #define SvOBJECT_on(sv) (SvFLAGS(sv) |= SVs_OBJECT)
385 #define SvOBJECT_off(sv) (SvFLAGS(sv) &= ~SVs_OBJECT)
387 #define SvREADONLY(sv) (SvFLAGS(sv) & SVf_READONLY)
388 #define SvREADONLY_on(sv) (SvFLAGS(sv) |= SVf_READONLY)
389 #define SvREADONLY_off(sv) (SvFLAGS(sv) &= ~SVf_READONLY)
391 #define SvSCREAM(sv) (SvFLAGS(sv) & SVp_SCREAM)
392 #define SvSCREAM_on(sv) (SvFLAGS(sv) |= SVp_SCREAM)
393 #define SvSCREAM_off(sv) (SvFLAGS(sv) &= ~SVp_SCREAM)
395 #define SvCOMPILED(sv) (SvFLAGS(sv) & SVpfm_COMPILED)
396 #define SvCOMPILED_on(sv) (SvFLAGS(sv) |= SVpfm_COMPILED)
397 #define SvCOMPILED_off(sv) (SvFLAGS(sv) &= ~SVpfm_COMPILED)
399 #define SvTAIL(sv) (SvFLAGS(sv) & SVpbm_TAIL)
400 #define SvTAIL_on(sv) (SvFLAGS(sv) |= SVpbm_TAIL)
401 #define SvTAIL_off(sv) (SvFLAGS(sv) &= ~SVpbm_TAIL)
403 #define SvCASEFOLD(sv) (SvFLAGS(sv) & SVpbm_CASEFOLD)
404 #define SvCASEFOLD_on(sv) (SvFLAGS(sv) |= SVpbm_CASEFOLD)
405 #define SvCASEFOLD_off(sv) (SvFLAGS(sv) &= ~SVpbm_CASEFOLD)
407 #define SvVALID(sv) (SvFLAGS(sv) & SVpbm_VALID)
408 #define SvVALID_on(sv) (SvFLAGS(sv) |= SVpbm_VALID)
409 #define SvVALID_off(sv) (SvFLAGS(sv) &= ~SVpbm_VALID)
411 #define SvRV(sv) ((XRV*) SvANY(sv))->xrv_rv
412 #define SvRVx(sv) SvRV(sv)
414 #define SvIVX(sv) ((XPVIV*) SvANY(sv))->xiv_iv
415 #define SvIVXx(sv) SvIVX(sv)
416 #define SvNVX(sv) ((XPVNV*)SvANY(sv))->xnv_nv
417 #define SvNVXx(sv) SvNVX(sv)
418 #define SvPVX(sv) ((XPV*) SvANY(sv))->xpv_pv
419 #define SvPVXx(sv) SvPVX(sv)
420 #define SvCUR(sv) ((XPV*) SvANY(sv))->xpv_cur
421 #define SvLEN(sv) ((XPV*) SvANY(sv))->xpv_len
422 #define SvLENx(sv) SvLEN(sv)
423 #define SvEND(sv)(((XPV*) SvANY(sv))->xpv_pv + ((XPV*)SvANY(sv))->xpv_cur)
424 #define SvENDx(sv) ((Sv = (sv)), SvEND(Sv))
425 #define SvMAGIC(sv) ((XPVMG*) SvANY(sv))->xmg_magic
426 #define SvSTASH(sv) ((XPVMG*) SvANY(sv))->xmg_stash
428 #define SvIV_set(sv, val) \
429 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
430 (((XPVIV*) SvANY(sv))->xiv_iv = val); } STMT_END
431 #define SvNV_set(sv, val) \
432 STMT_START { assert(SvTYPE(sv) == SVt_NV || SvTYPE(sv) >= SVt_PVNV); \
433 (((XPVNV*) SvANY(sv))->xnv_nv = val); } STMT_END
434 #define SvPV_set(sv, val) \
435 STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
436 (((XPV*) SvANY(sv))->xpv_pv = val); } STMT_END
437 #define SvCUR_set(sv, val) \
438 STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
439 (((XPV*) SvANY(sv))->xpv_cur = val); } STMT_END
440 #define SvLEN_set(sv, val) \
441 STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
442 (((XPV*) SvANY(sv))->xpv_len = val); } STMT_END
443 #define SvEND_set(sv, val) \
444 STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
445 (((XPV*) SvANY(sv))->xpv_cur = val - SvPVX(sv)); } STMT_END
447 #define BmRARE(sv) ((XPVBM*) SvANY(sv))->xbm_rare
448 #define BmUSEFUL(sv) ((XPVBM*) SvANY(sv))->xbm_useful
449 #define BmPREVIOUS(sv) ((XPVBM*) SvANY(sv))->xbm_previous
451 #define FmLINES(sv) ((XPVFM*) SvANY(sv))->xfm_lines
453 #define LvTYPE(sv) ((XPVLV*) SvANY(sv))->xlv_type
454 #define LvTARG(sv) ((XPVLV*) SvANY(sv))->xlv_targ
455 #define LvTARGOFF(sv) ((XPVLV*) SvANY(sv))->xlv_targoff
456 #define LvTARGLEN(sv) ((XPVLV*) SvANY(sv))->xlv_targlen
458 #define IoIFP(sv) ((XPVIO*) SvANY(sv))->xio_ifp
459 #define IoOFP(sv) ((XPVIO*) SvANY(sv))->xio_ofp
460 #define IoDIRP(sv) ((XPVIO*) SvANY(sv))->xio_dirp
461 #define IoLINES(sv) ((XPVIO*) SvANY(sv))->xio_lines
462 #define IoPAGE(sv) ((XPVIO*) SvANY(sv))->xio_page
463 #define IoPAGE_LEN(sv) ((XPVIO*) SvANY(sv))->xio_page_len
464 #define IoLINES_LEFT(sv)((XPVIO*) SvANY(sv))->xio_lines_left
465 #define IoTOP_NAME(sv) ((XPVIO*) SvANY(sv))->xio_top_name
466 #define IoTOP_GV(sv) ((XPVIO*) SvANY(sv))->xio_top_gv
467 #define IoFMT_NAME(sv) ((XPVIO*) SvANY(sv))->xio_fmt_name
468 #define IoFMT_GV(sv) ((XPVIO*) SvANY(sv))->xio_fmt_gv
469 #define IoBOTTOM_NAME(sv)((XPVIO*) SvANY(sv))->xio_bottom_name
470 #define IoBOTTOM_GV(sv) ((XPVIO*) SvANY(sv))->xio_bottom_gv
471 #define IoSUBPROCESS(sv)((XPVIO*) SvANY(sv))->xio_subprocess
472 #define IoTYPE(sv) ((XPVIO*) SvANY(sv))->xio_type
473 #define IoFLAGS(sv) ((XPVIO*) SvANY(sv))->xio_flags
475 #define SvTAINT(sv) if (tainting && tainted) sv_magic(sv, Nullsv, 't', Nullch, 0)
480 double SvNV _((SV* sv));
481 #define SvPV_force(sv, lp) sv_pvn_force(sv, &lp)
482 #define SvPV(sv, lp) sv_pvn(sv, &lp)
483 char *sv_pvn _((SV *, STRLEN *));
484 I32 SvTRUE _((SV *));
486 #define SvIVx(sv) SvIV(sv)
487 #define SvNVx(sv) SvNV(sv)
488 #define SvPVx(sv, lp) sv_pvn(sv, &lp)
489 #define SvPVx_force(sv, lp) sv_pvn_force(sv, &lp)
490 #define SvTRUEx(sv) SvTRUE(sv)
492 #else /* !CRIPPLED_CC */
494 #define SvIV(sv) (SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv))
496 #define SvNV(sv) (SvNOK(sv) ? SvNVX(sv) : sv_2nv(sv))
498 #define SvPV(sv, lp) (SvPOK(sv) ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv(sv, &lp))
500 #define SvPV_force(sv, lp) ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force(sv, &lp))
502 #define SvTRUE(sv) ( \
506 ? ((Xpv = (XPV*)SvANY(sv)) && \
507 (*Xpv->xpv_pv > '0' || \
508 Xpv->xpv_cur > 1 || \
509 (Xpv->xpv_cur && *Xpv->xpv_pv != '0')) \
519 #define SvIVx(sv) ((Sv = (sv)), SvIV(Sv))
520 #define SvNVx(sv) ((Sv = (sv)), SvNV(Sv))
521 #define SvPVx(sv, lp) ((Sv = (sv)), SvPV(Sv, lp))
522 #define SvTRUEx(sv) ((Sv = (sv)), SvTRUE(Sv))
524 #endif /* CRIPPLED_CC */
526 /* the following macro updates any magic values this sv is associated with */
528 #define SvSETMAGIC(x) if (SvSMAGICAL(x)) mg_set(x)
530 #define SvSetSV(dst,src) if (dst != src) sv_setsv(dst,src)
532 #define SvPEEK(sv) sv_peek(sv)
534 #define isGV(sv) (SvTYPE(sv) == SVt_PVGV)
537 # define SvGROW(sv,len) (SvLEN(sv) < (len) ? sv_grow(sv,len) : SvPVX(sv))
538 # define Sv_Grow sv_grow
540 /* extra parentheses intentionally NOT placed around "len"! */
541 # define SvGROW(sv,len) ((SvLEN(sv) < (unsigned long)len) \
542 ? sv_grow(sv,(unsigned long)len) : SvPVX(sv))
543 # define Sv_Grow(sv,len) sv_grow(sv,(unsigned long)(len))