[svn:mod_parrot] r268 - in mod_parrot/trunk: . include src

[email protected]
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Thu Dec 13 13:37:33 2007
New Revision: 268

Removed:
   mod_parrot/trunk/src/constants.c
Modified:
   mod_parrot/trunk/Makefile.in
   mod_parrot/trunk/include/mod_parrot.h
   mod_parrot/trunk/src/context.c

Log:
remove shared constant support, as it was breaking things


Modified: mod_parrot/trunk/Makefile.in
==============================================================================
--- mod_parrot/trunk/Makefile.in	(original)
+++ mod_parrot/trunk/Makefile.in	Thu Dec 13 13:37:33 2007
@@ -27,16 +27,14 @@
 	$(SRC_DIR)/parrot_util.c \
 	$(SRC_DIR)/modparrot_config.c \
 	$(SRC_DIR)/nci.c \
-	$(SRC_DIR)/context.c \
-	$(SRC_DIR)/constants.c
+	$(SRC_DIR)/context.c
 
 OBJ_FILES= \
 	$(SRC_DIR)/mod_parrot.lo \
 	$(SRC_DIR)/parrot_util.lo \
 	$(SRC_DIR)/modparrot_config.lo \
 	$(SRC_DIR)/nci.lo \
-	$(SRC_DIR)/context.lo \
-	$(SRC_DIR)/constants.lo
+	$(SRC_DIR)/context.lo
 
 MPLIBS=	lib/Apache/RequestRec \
 	lib/Apache/Constants \

Modified: mod_parrot/trunk/include/mod_parrot.h
==============================================================================
--- mod_parrot/trunk/include/mod_parrot.h	(original)
+++ mod_parrot/trunk/include/mod_parrot.h	Thu Dec 13 13:37:33 2007
@@ -20,12 +20,14 @@
 /* apache handler name */
 #define MODPARROT_MAGIC "parrot-code"
 
+/* default HLL, if we can't determine from the request */
+#define MODPARROT_DEFAULT_HLL "PIR"
+
 /* default path to initialization bytecode */
 #define MODPARROT_DEFAULT_INIT "mod_parrot.pbc"
 
 /* string macros */
 #define MAKE_PARROT_STRING(x) (string_from_cstring(interp, x, strlen(x)))
-#define MODPARROT_CONSTANT(x) (mp_constants[x])
 
 /* context macros */
 #define MODPARROT_CTX_ISLOCKED(x) (x->locked == 1)
@@ -65,8 +67,3 @@
 modparrot_context *get_interp_ctx(Parrot_Interp);
 void set_interp_ctx(Parrot_Interp, modparrot_context *);
 void mp_init_constants(Parrot_Interp);
-
-/* constants */
-#define DECLARE_MP_CONSTANTS extern Parrot_String mp_constants[];
-#define MODPARROT_CONST_CONTEXT_NAMESPACE 0
-#define MODPARROT_CONST_CONTEXT_FUNCTION 1

Modified: mod_parrot/trunk/src/context.c
==============================================================================
--- mod_parrot/trunk/src/context.c	(original)
+++ mod_parrot/trunk/src/context.c	Thu Dec 13 13:37:33 2007
@@ -32,8 +32,6 @@
 #include "mod_parrot.h"
 #include "modparrot_config.h"
 
-DECLARE_MP_CONSTANTS;
-
 /* pool of mod_parrot contexts */
 static apr_array_header_t *mp_ctx_pool = (apr_array_header_t *)NULL;
 
@@ -95,10 +93,12 @@
     typenum = Parrot_PMC_typenum(interp, "UnManagedStruct");
     p = Parrot_PMC_new(interp, typenum);
     Parrot_PMC_set_pointer(interp, p, ctx);
-    Parrot_store_global_s(interp,
-        MODPARROT_CONSTANT(MODPARROT_CONST_CONTEXT_NAMESPACE), 
-        MODPARROT_CONSTANT(MODPARROT_CONST_CONTEXT_FUNCTION),
-        p);
+    Parrot_store_global_s(
+        interp,
+        MAKE_PARROT_STRING("_modparrot"), 
+        MAKE_PARROT_STRING("__context"),
+        p
+    );
 
     ctx->interp = interp;
 }
@@ -108,9 +108,11 @@
     Parrot_PMC p;
     modparrot_context *ctx = (modparrot_context *)NULL;
 
-    p = Parrot_find_global_s(interp, 
-        MODPARROT_CONSTANT(MODPARROT_CONST_CONTEXT_NAMESPACE), 
-        MODPARROT_CONSTANT(MODPARROT_CONST_CONTEXT_FUNCTION));
+    p = Parrot_find_global_s(
+        interp, 
+        MAKE_PARROT_STRING("_modparrot"), 
+        MAKE_PARROT_STRING("__context")
+    );
     if (p) {
         ctx = Parrot_PMC_get_pointer(interp, p);
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.