cvs commit: ponie/src/pmc perl5cargo_cult.pmc

[email protected] (Nicholas Clark) 15 Oct 2004 15:28:35 -0000
Newsgroups perl.ponie.changes
Message-ID <[email protected]>
cvsuser     04/10/15 08:28:35

  Modified:    perl     sv.h
               src/pmc  perl5cargo_cult.pmc
  Log:
  SCREAM, COMPILED, EVALED, TAIL, VALID to PMC
  
  Revision  Changes    Path
  1.41      +19 -19    ponie/perl/sv.h
  
  Index: sv.h
  ===================================================================
  RCS file: /cvs/public/ponie/perl/sv.h,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -w -r1.40 -r1.41
  --- sv.h	15 Oct 2004 15:04:12 -0000	1.40
  +++ sv.h	15 Oct 2004 15:28:35 -0000	1.41
  @@ -751,25 +751,25 @@
   #define SvREADONLY_on(sv)	Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_READONLY, 1)
   #define SvREADONLY_off(sv)	Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_READONLY, 0)
   
  -#define SvSCREAM(sv)		(SvFLAGS(sv) & SVp_SCREAM)
  -#define SvSCREAM_on(sv)		(SvFLAGS(sv) |= SVp_SCREAM)
  -#define SvSCREAM_off(sv)	(SvFLAGS(sv) &= ~SVp_SCREAM)
  -
  -#define SvCOMPILED(sv)		(SvFLAGS(sv) & SVpfm_COMPILED)
  -#define SvCOMPILED_on(sv)	(SvFLAGS(sv) |= SVpfm_COMPILED)
  -#define SvCOMPILED_off(sv)	(SvFLAGS(sv) &= ~SVpfm_COMPILED)
  -
  -#define SvEVALED(sv)		(SvFLAGS(sv) & SVrepl_EVAL)
  -#define SvEVALED_on(sv)		(SvFLAGS(sv) |= SVrepl_EVAL)
  -#define SvEVALED_off(sv)	(SvFLAGS(sv) &= ~SVrepl_EVAL)
  -
  -#define SvTAIL(sv)		(SvFLAGS(sv) & SVpbm_TAIL)
  -#define SvTAIL_on(sv)		(SvFLAGS(sv) |= SVpbm_TAIL)
  -#define SvTAIL_off(sv)		(SvFLAGS(sv) &= ~SVpbm_TAIL)
  -
  -#define SvVALID(sv)		(SvFLAGS(sv) & SVpbm_VALID)
  -#define SvVALID_on(sv)		(SvFLAGS(sv) |= SVpbm_VALID)
  -#define SvVALID_off(sv)		(SvFLAGS(sv) &= ~SVpbm_VALID)
  +#define SvSCREAM(sv)		((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_SCREAM))
  +#define SvSCREAM_on(sv)		Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_SCREAM, 1)
  +#define SvSCREAM_off(sv)	Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_SCREAM, 0)
  +
  +#define SvCOMPILED(sv)		((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_COMPILED))
  +#define SvCOMPILED_on(sv)	Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_COMPILED, 1)
  +#define SvCOMPILED_off(sv)	Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_COMPILED, 0)
  +
  +#define SvEVALED(sv)		((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_EVALED))
  +#define SvEVALED_on(sv)		Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_EVALED, 1)
  +#define SvEVALED_off(sv)	Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_EVALED, 0)
  +
  +#define SvTAIL(sv)		((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_TAIL))
  +#define SvTAIL_on(sv)		Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_TAIL, 1)
  +#define SvTAIL_off(sv)		Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_TAIL, 0)
  +
  +#define SvVALID(sv)		((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_VALID))
  +#define SvVALID_on(sv)		Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_VALID, 1)
  +#define SvVALID_off(sv)		Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_VALID, 0)
   
   #ifdef USE_ITHREADS
   /* The following uses the FAKE flag to show that a regex pointer is infact
  
  
  
  1.31      +61 -1     ponie/src/pmc/perl5cargo_cult.pmc
  
  Index: perl5cargo_cult.pmc
  ===================================================================
  RCS file: /cvs/public/ponie/src/pmc/perl5cargo_cult.pmc,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -w -r1.30 -r1.31
  --- perl5cargo_cult.pmc	15 Oct 2004 15:04:12 -0000	1.30
  +++ perl5cargo_cult.pmc	15 Oct 2004 15:28:35 -0000	1.31
  @@ -1,7 +1,7 @@
   /* Perl5QQQ.pmc -*- c -*-
    *  Copyright: 2001-2004 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: perl5cargo_cult.pmc,v 1.30 2004/10/15 15:04:12 nicholas Exp $
  + *     $Id: perl5cargo_cult.pmc,v 1.31 2004/10/15 15:28:35 nicholas Exp $
    *  Overview:
    *     These are the vtable functions for the Perl5QQQ base class
    *  Data Structure and Algorithms:
  @@ -192,6 +192,21 @@
   	case Ponie_I_SV_READONLY:
   	    return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
   			 & SVf_READONLY;
  +	case Ponie_I_SV_SCREAM:
  +	    return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
  +			 & SVp_SCREAM;
  +	case Ponie_I_SV_COMPILED:
  +	    return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
  +			 & SVpfm_COMPILED;
  +	case Ponie_I_SV_EVALED:
  +	    return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
  +			 & SVrepl_EVAL;
  +	case Ponie_I_SV_TAIL:
  +	    return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
  +			 & SVpbm_TAIL;
  +	case Ponie_I_SV_VALID:
  +	    return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
  +			 & SVpbm_VALID;
   
   	default:
   	    croak ("Out of range or illegal key %d (max is %d) "
  @@ -529,6 +544,51 @@
                       &= ~SVf_READONLY;
               }
   	    return;
  +	case Ponie_I_SV_SCREAM:
  +	    if (value) {
  +		(((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +		    |= SVp_SCREAM;
  +	    } else {
  +                (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +                    &= ~SVp_SCREAM;
  +            }
  +	    return;
  +	case Ponie_I_SV_COMPILED:
  +	    if (value) {
  +		(((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +		    |= SVpfm_COMPILED;
  +	    } else {
  +                (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +                    &= ~SVpfm_COMPILED;
  +            }
  +	    return;
  +	case Ponie_I_SV_EVALED:
  +	    if (value) {
  +		(((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +		    |= SVrepl_EVAL;
  +	    } else {
  +                (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +                    &= ~SVrepl_EVAL;
  +            }
  +	    return;
  +	case Ponie_I_SV_TAIL:
  +	    if (value) {
  +		(((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +		    |= SVpbm_TAIL;
  +	    } else {
  +                (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +                    &= ~SVpbm_TAIL;
  +            }
  +	    return;
  +	case Ponie_I_SV_VALID:
  +	    if (value) {
  +		(((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +		    |= SVpbm_VALID;
  +	    } else {
  +                (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +                    &= ~SVpbm_VALID;
  +            }
  +	    return;
   
   	default:
   	    /* Hush gcc. There is a default.  */;