[svn:parrot] r38112 - branches/packfile_revamp/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Wed Apr 15 12:07:35 UTC 2009


Author: bacek
Date: Wed Apr 15 12:07:35 2009
New Revision: 38112
URL: https://trac.parrot.org/parrot/changeset/38112

Log:
Initial naive implementation setters for PackfileAnnotationKeys

Modified:
   branches/packfile_revamp/src/pmc/packfileannotationkeys.pmc

Modified: branches/packfile_revamp/src/pmc/packfileannotationkeys.pmc
==============================================================================
--- branches/packfile_revamp/src/pmc/packfileannotationkeys.pmc	Wed Apr 15 12:07:10 2009	(r38111)
+++ branches/packfile_revamp/src/pmc/packfileannotationkeys.pmc	Wed Apr 15 12:07:35 2009	(r38112)
@@ -142,7 +142,17 @@
 
 */
     VTABLE void set_string_keyed_int(INTVAL index, STRING *value)  {
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, "Not implemented yet.");
+        Parrot_PackfileAnnotationKeys_attributes *attrs =
+                PARROT_PACKFILEANNOTATIONKEYS(SELF);
+        PMC    *const_table = fetch_const_table(interp, SELF);
+        INTVAL  i;
+
+        /* Store constant into ConstantTable. Don't check for duplicates for now. */
+        i = VTABLE_elements(interp, const_table);
+        VTABLE_set_string_keyed_int(interp, const_table, i, value);
+
+        /* And store C<i> in names */
+        VTABLE_set_integer_keyed_int(interp, attrs->names, index, i);
     }
 
 
@@ -176,7 +186,9 @@
 
 */
     VTABLE void set_integer_keyed_int(INTVAL index, INTVAL value)  {
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED, "Not implemented yet.");
+        Parrot_PackfileAnnotationKeys_attributes *attrs =
+                PARROT_PACKFILEANNOTATIONKEYS(SELF);
+        VTABLE_set_integer_keyed_int(interp, attrs->types, index, value);
     }
 
 /*


More information about the parrot-commits mailing list