[svn:parrot] r36870 - in trunk: include/parrot src

NotFound at svn.parrot.org NotFound at svn.parrot.org
Wed Feb 18 22:44:11 UTC 2009


Author: NotFound
Date: Wed Feb 18 22:44:11 2009
New Revision: 36870
URL: https://trac.parrot.org/parrot/changeset/36870

Log:
[core] add functions Parrot_get_root_namespace and Parrot_PMC_get_pmc_strkey to extend.h

Modified:
   trunk/include/parrot/extend.h
   trunk/src/extend.c

Modified: trunk/include/parrot/extend.h
==============================================================================
--- trunk/include/parrot/extend.h	Wed Feb 18 21:41:59 2009	(r36869)
+++ trunk/include/parrot/extend.h	Wed Feb 18 22:44:11 2009	(r36870)
@@ -147,6 +147,10 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
+Parrot_PMC Parrot_get_root_namespace(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
 Parrot_String Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum)
         __attribute__nonnull__(1);
 
@@ -239,6 +243,12 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
+Parrot_PMC Parrot_PMC_get_pmc_strkey(PARROT_INTERP,
+    Parrot_PMC pmc,
+    Parrot_String key)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 void * Parrot_PMC_get_pointer_intkey(PARROT_INTERP,
@@ -437,6 +447,8 @@
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_get_pmcreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_get_root_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_get_strreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_get_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -470,6 +482,8 @@
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_PMC_get_pmc_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_PMC_get_pmc_strkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_PMC_get_pointer_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_PMC_get_string_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \

Modified: trunk/src/extend.c
==============================================================================
--- trunk/src/extend.c	Wed Feb 18 21:41:59 2009	(r36869)
+++ trunk/src/extend.c	Wed Feb 18 22:44:11 2009	(r36870)
@@ -168,6 +168,24 @@
 
 /*
 
+=item C<Parrot_PMC Parrot_get_root_namespace>
+
+Return the root namespace
+
+=cut
+
+*/
+
+PARROT_EXPORT
+Parrot_PMC
+Parrot_get_root_namespace(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_get_root_namespace)
+    return interp->root_namespace;
+}
+
+/*
+
 =item C<Parrot_String Parrot_PMC_get_string_intkey>
 
 Return the integer keyed string value of the passed-in PMC
@@ -240,6 +258,29 @@
 
 /*
 
+=item C<Parrot_PMC Parrot_PMC_get_pmc_strkey>
+
+Return the string keyed PMC value of the passed-in PMC
+
+=cut
+
+*/
+
+PARROT_EXPORT
+Parrot_PMC
+Parrot_PMC_get_pmc_strkey(PARROT_INTERP,
+        Parrot_PMC pmc, Parrot_String key)
+{
+    ASSERT_ARGS(Parrot_PMC_get_pmc_strkey)
+    Parrot_PMC retval;
+    PARROT_CALLIN_START(interp);
+    retval = VTABLE_get_pmc_keyed_str(interp, pmc, key);
+    PARROT_CALLIN_END(interp);
+    return retval;
+}
+
+/*
+
 =item C<Parrot_Int Parrot_PMC_get_intval>
 
 Return the signed integer value of the value in the PMC.


More information about the parrot-commits mailing list