[srm-cvs] CVS Update: - the 3 billion dollar gamble

From: <kalowsky[@]php.net>
Date: Sat Feb 23 2002 - 19:18:02 CET

Date: Sat Feb 23 19:18:01 CET 2002
User: Dan Kalowsky
Directory: srm/main/src

Log Message:
 [0.07]
 - the 3 billion dollar gamble
 
 
Modified files:
           srm/main/src/srm_modules.c (version: 1.61)
           srm/main/src/srm_modules.h (version: 1.26)

[FILE: /srm/main/src/srm_modules.c]

--- srm/main/src/srm_modules.c:1.60 Sat Feb 23 16:46:47 2002 GMT
+++ srm/main/src/srm_modules.c Sat Feb 23 17:18:01 2002 GMT
@@ -1,4 +1,4 @@
-/* $Id: cvstemp,v 1.60 2002/02/23 17:46:47 derick Exp $ */
+/* $Id: cvstemp,v 1.61 2002/02/23 18:18:01 kalowsky Exp $ */
 
 /* The contents of this file are subject to the Vulcan Logic Public
  * License Version 1.1 (the "License"); you may not use this file
@@ -51,7 +51,23 @@
         NSDestroyObjectFileImage(image);
         return handle;
 }
-#endif
+
+NSSymbol srm_ns_symbol(void *handle, char *symname)
+{
+ NSSymbol symbol;
+ char *symname2 = (char*)malloc(sizeof(char)*strlen(symname)+2);
+ sprintf(symname2, " %s", symname);
+ symbol = NSLookupAndBindSymbol(symname2);
+ free(symname2);
+ return NSAddressOfSymbol(symbol);
+}
+
+const char* srm_ns_error(void)
+{
+ return NULL;
+}
+
+#endif /* SRM_MACOSX */
 
 /*
  * Initialize the module hash
@@ -227,7 +243,7 @@
 /* - Trying to obtain handle to the .so file */
         handle = DL_LOAD (module_name);
         if (!handle) {
- srm_error (ERROR_OPEN_MODULE, "Cannot open module: %s", dlerror());
+ srm_error (ERROR_OPEN_MODULE, "Cannot open module: %s", DL_ERROR);
         }
 
 /* - Obtaining the module_entry symbol */

[FILE: /srm/main/src/srm_modules.h]

--- srm/main/src/srm_modules.h:1.25 Sat Feb 23 16:46:47 2002 GMT
+++ srm/main/src/srm_modules.h Sat Feb 23 17:18:01 2002 GMT
@@ -1,4 +1,4 @@
-/* $Id: cvstemp,v 1.25 2002/02/23 17:46:47 derick Exp $ */
+/* $Id: cvstemp,v 1.26 2002/02/23 18:18:01 kalowsky Exp $ */
 
 /* The contents of this file are subject to the Vulcan Logic Public
  * License Version 1.1 (the "License"); you may not use this file
@@ -122,6 +122,7 @@
 
 # define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
 # define DL_UNLOAD dlclose
+# define DL_ERROR dlerror(void)
 
 # if defined(DLSYM_NEEDS_UNDERSCORE)
 # define DL_FETCH_SYM(h,s) dlsym((h), "_" ## s)
@@ -134,22 +135,18 @@
 
 #if defined(SRM_MACOSX) /* start SRM_MACOSX should really be HAVE_DYLD*/
 
-# define DL_LOAD(libname) srm_ns_load (libname)
+/* functions */
+NSSymbol srm_ns_symbol(void *handle, char* symname);
 NSModule srm_ns_load (char* libname);
+const char* srm_ns_error(void);
 
-# define DL_UNLOAD(handle) NSUnLinkModule(handle,FALSE);
-
-# define DL_FETCH_SYM(handle,symname) NSSymbol symbol; \
- char *symname2=(char*)malloc(sizeof(char)*strlen(symname)+2); \
- sprintf(symname2, "_%s", symname); \
- int defined = NSIsSymbolNameDefined(symname2); \
- if (defined) { \
- symbol = NSLookupAndBindSymbold(symname2); \
- handle = NSAddressOfSymbol(symbol); \
- } \
- free(symname2); \
- return NSAddressOfSymbol(symbol);
+/* defines */
+# define DL_LOAD(libname) srm_ns_load (libname)
+# define DL_UNLOAD(handle) NSUnLinkModule(handle,FALSE);
+# define DL_FETCH_SYM(handle,symname) srm_ns_symbol(handle, symname)
+# define DL_ERROR srm_ns_error()
 
+/* enable module support */
 # define SRM_DLMODULES_SUPPORT 1
 # else /* end SRM_MACOSX, start rest not supported*/
 # define SRM_DLMODULES_SUPPORT 0
Received on Sat Feb 23 19:18:15 2002

This archive was generated by hypermail 2.1.8 : Tue Jan 06 2009 - 10:00:03 CET