[svn:ponie] rev 325 - in trunk: perl src/pmc

[email protected] 10 Jul 2005 10:39:31 -0000
Newsgroups perl.ponie.changes
Message-ID <[email protected]>
Author: nicholas
Date: Sun Jul 10 03:39:31 2005
New Revision: 325

Modified:
   trunk/perl/sv.c
   trunk/perl/sv.h
   trunk/src/pmc/perl5cargo_cult.pmc
   trunk/src/pmc/ponie.h
Log:
Rename the get PV options.
Add a structure to pass in pointers to set.
Add the first set case.


Modified: trunk/perl/sv.c
==============================================================================
--- trunk/perl/sv.c	(original)
+++ trunk/perl/sv.c	Sun Jul 10 03:39:31 2005
@@ -2357,8 +2357,8 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv,
     struct Ponie_pvlen getlen;
     Parrot_PMC_set_pointer_intkey(PL_Parrot, MUMBLE(sv),
 				  (flags & SV_GMAGIC)
-				  ? Ponie_P_SV_PV
-				  : Ponie_P_SV_PV_NO_GMAGIC,
+				  ? Ponie_P_SV_2PV
+				  : Ponie_P_SV_2PV_NO_GMAGIC,
 				  &getlen);
     if (lp)
 	*lp = getlen.len;

Modified: trunk/perl/sv.h
==============================================================================
--- trunk/perl/sv.h	(original)
+++ trunk/perl/sv.h	Sun Jul 10 03:39:31 2005
@@ -251,8 +251,10 @@ typedef enum {
   Ponie_P_NEWSVRV,		/* newSVrv */
   Ponie_P_REPLACE,		/* Special things for sv_replace */
   Ponie_P_PINE_FOR_FJORDS,	/* Free all internal storage and play dead */
-  Ponie_P_SV_PV,		/* Get the pvx and len.  */
-  Ponie_P_SV_PV_NO_GMAGIC,	/* Get the pvx and len, but don't call GMAGIC */
+  Ponie_P_SV_2PV,		/* Get the pvx and len.  */
+  Ponie_P_SV_2PV_NO_GMAGIC,	/* Get the pvx and len, but don't call GMAGIC */
+  Ponie_P_SV_PVN,		/* Set the pvx and len.  */
+  Ponie_P_SV_PVN_NO_SMAGIC,	/* Set the pvx and len, but don't call SMAGIC */
   Ponie_P_MAX
 } Ponie_pointers;
 

Modified: trunk/src/pmc/perl5cargo_cult.pmc
==============================================================================
--- trunk/src/pmc/perl5cargo_cult.pmc	(original)
+++ trunk/src/pmc/perl5cargo_cult.pmc	Sun Jul 10 03:39:31 2005
@@ -699,20 +699,26 @@ pmclass Perl5cargo_cult dynpmc {
         case Ponie_P_GET_UPGRADE:
             Perl_croak(aTHX_ "Can't upgrade that kind of scalar");
             break;
-        case Ponie_P_SV_PV:
+        case Ponie_P_SV_2PV:
             {
                 struct Ponie_pvlen *output = (struct Ponie_pvlen *) value;
                 output->pv = Perl_sv_2pv_backend(aTHX_ MUMBLE(SELF),
                                                  &(output->len), SV_GMAGIC);
             }
             break;
-        case Ponie_P_SV_PV_NO_GMAGIC:
+        case Ponie_P_SV_2PV_NO_GMAGIC:
             {
                 struct Ponie_pvlen *output = (struct Ponie_pvlen *) value;
                 output->pv = Perl_sv_2pv_backend(aTHX_ MUMBLE(SELF),
                                                  &(output->len), 0);
             }
             break;
+        case Ponie_P_SV_PVN_NO_SMAGIC:
+            {
+                struct Ponie_cpvlen *input = (struct Ponie_cpvlen *) value;
+                Perl_sv_setpvn_backend(aTHX_ MUMBLE(SELF), input->pv,
+                                       input->len, 0);
+            }
         case Ponie_P_PINE_FOR_FJORDS:
             {
                 --PL_sv_count;

Modified: trunk/src/pmc/ponie.h
==============================================================================
--- trunk/src/pmc/ponie.h	(original)
+++ trunk/src/pmc/ponie.h	Sun Jul 10 03:39:31 2005
@@ -44,6 +44,13 @@ struct Ponie_pvlen {
     STRLEN len;
 };
 
+/* A structure to pass in 2 values for sv_setpvn  */
+
+struct Ponie_cpvlen {
+    const char *pv;
+    STRLEN len;
+};
+
 void Ponie_freescalar_common(SV *sv);
 void Ponie_freescalar_common_magic(SV *sv);