rev 177 - in trunk: include/prothon modules/Dict modules/File modules/Float modules/List modules/Re modules/String modules/Tuple src

SVN User <[email protected]>
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: bcollins
Date: 2004-03-28 07:57:46 -0500 (Sun, 28 Mar 2004)
New Revision: 177

Modified:
   trunk/include/prothon/prothon_dll.h
   trunk/modules/Dict/Dict.c
   trunk/modules/File/File.c
   trunk/modules/Float/Float.c
   trunk/modules/List/List.c
   trunk/modules/Re/Re.c
   trunk/modules/String/String.c
   trunk/modules/Tuple/Tuple.c
   trunk/src/interp.c
Log:
Redo the dll_export so that the module export symbol is
modname##_dll_entry. On MacOSX we could only load one module, and then
we started getting symbol clashes for _dll_entry, ist and prservices.

What does this mean? Means that the module name must remain the same as
it was compiled. What's wrong with that? Nothing, I think it's a good
sanity check, and creates consistency.


Modified: trunk/include/prothon/prothon_dll.h
===================================================================
--- trunk/include/prothon/prothon_dll.h	2004-03-28 09:20:40 UTC (rev 176)
+++ trunk/include/prothon/prothon_dll.h	2004-03-28 12:57:46 UTC (rev 177)
@@ -123,16 +123,16 @@
 extern isp ist;
 extern pr_services_t *services;
 
-#define install_module()				\
-isp ist;						\
-pr_services_t *services;				\
-static void pr_module_install(void);			\
-PR_DECLARE_EXPORT(void) dll_entry(pr_services_t* srvcs)	\
-{							\
-	services = srvcs;				\
-	ist = get_ist();				\
-	pr_module_install();				\
-}							\
+#define install_module(modname)						\
+static isp ist;								\
+static pr_services_t *services;						\
+static void pr_module_install(void);					\
+PR_DECLARE_EXPORT(void) modname##_dll_entry(pr_services_t* srvcs)	\
+{									\
+	services = srvcs;						\
+	ist = get_ist();						\
+	pr_module_install();						\
+}									\
 static void pr_module_install(void)
 
 #define get_ist				(*services->get_ist)

Modified: trunk/modules/Dict/Dict.c
===================================================================
--- trunk/modules/Dict/Dict.c	2004-03-28 09:20:40 UTC (rev 176)
+++ trunk/modules/Dict/Dict.c	2004-03-28 12:57:46 UTC (rev 177)
@@ -58,5 +58,5 @@
 
 #define DICT_PROTO_OBJ   OBJ(DICT_PROTO)
 
-install_module(){
+install_module(Dict){
 }

Modified: trunk/modules/File/File.c
===================================================================
--- trunk/modules/File/File.c	2004-03-28 09:20:40 UTC (rev 176)
+++ trunk/modules/File/File.c	2004-03-28 12:57:46 UTC (rev 177)
@@ -579,7 +579,7 @@
 	return parms[1];
 }
 
-install_module(){
+install_module(File) {
 	FILE_PROTO = new_object(NULL);
 	DIR_PROTO  = new_object(NULL);
 	set_attr(ist, OBJ(OBJECT),	sym(ist, "File"), FILE_PROTO);

Modified: trunk/modules/Float/Float.c
===================================================================
--- trunk/modules/Float/Float.c	2004-03-28 09:20:40 UTC (rev 176)
+++ trunk/modules/Float/Float.c	2004-03-28 12:57:46 UTC (rev 177)
@@ -313,7 +313,7 @@
 }
 
 
-install_module(){
+install_module(Float) {
 	FLOAT_PROTO_OBJ__bool__init();
 	FLOAT_PROTO_OBJ__hash__init();
 	FLOAT_PROTO_OBJ__abs__init();

Modified: trunk/modules/List/List.c
===================================================================
--- trunk/modules/List/List.c	2004-03-28 09:20:40 UTC (rev 176)
+++ trunk/modules/List/List.c	2004-03-28 12:57:46 UTC (rev 177)
@@ -234,7 +234,7 @@
 	return self;
 }
 
-install_module(){
+install_module(List) {
 	LIST_PROTO_OBJ__add__init();
 	LIST_PROTO_OBJ__mul__init();
 	LIST_PROTO_OBJappend_BANGinit();

Modified: trunk/modules/Re/Re.c
===================================================================
--- trunk/modules/Re/Re.c	2004-03-28 09:20:40 UTC (rev 176)
+++ trunk/modules/Re/Re.c	2004-03-28 12:57:46 UTC (rev 177)
@@ -619,7 +619,7 @@
 	return res;
 }
 
-install_module() {
+install_module(Re) {
 	RE_MODULE	= new_object(NULL);
 	RE_PROTO	= new_object(NULL);
 	MATCH_PROTO	= new_object(NULL);

Modified: trunk/modules/String/String.c
===================================================================
--- trunk/modules/String/String.c	2004-03-28 09:20:40 UTC (rev 176)
+++ trunk/modules/String/String.c	2004-03-28 12:57:46 UTC (rev 177)
@@ -239,7 +239,7 @@
 	return new_int_obj(pr_strlen(self));
 }
 
-install_module(){
+install_module(String) {
 	STRINGGEN_PROTO = new_object(NULL);
 
 	STR_PROTO_OBJ__eq__init();

Modified: trunk/modules/Tuple/Tuple.c
===================================================================
--- trunk/modules/Tuple/Tuple.c	2004-03-28 09:20:40 UTC (rev 176)
+++ trunk/modules/Tuple/Tuple.c	2004-03-28 12:57:46 UTC (rev 177)
@@ -182,7 +182,7 @@
 }
 
 
-install_module(){
+install_module(Tuple) {
 	TUPLE_PROTO_OBJ__rin__init();
 	TUPLE_PROTO_OBJ__rnotin__init();
 	TUPLE_PROTO_OBJ__add__init();

Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c	2004-03-28 09:20:40 UTC (rev 176)
+++ trunk/src/interp.c	2004-03-28 12:57:46 UTC (rev 177)
@@ -329,7 +329,8 @@
 	if (aprerr != APR_SUCCESS)
 		return FALSE;
 
-	aprerr = apr_dso_sym(&dll_entry, handle, "dll_entry");
+	apr_snprintf(dll_path, sizeof(dll_path), "%s_dll_entry", module_name);
+	aprerr = apr_dso_sym(&dll_entry, handle, dll_path);
 	if (aprerr != APR_SUCCESS) {
 		apr_dso_unload(handle);
 		raise_exception(ist, OBJ(INTERNAL_EXC), "Loadable module `%s': initialization failed",
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.