hyanantha Thu Oct 24 07:12:59 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/ext/standard dl.c
Log:
NetWare related changes/modifications.
Index: php4/ext/standard/dl.c
diff -u php4/ext/standard/dl.c:1.66.2.1 php4/ext/standard/dl.c:1.66.2.2
--- php4/ext/standard/dl.c:1.66.2.1 Mon Mar 25 18:22:05 2002
+++ php4/ext/standard/dl.c Thu Oct 24 07:12:59 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dl.c,v 1.66.2.1 2002/03/25 23:22:05 sniper Exp $ */
+/* $Id: dl.c,v 1.66.2.2 2002/10/24 11:12:59 hyanantha Exp $ */
#include "php.h"
#include "dl.h"
@@ -26,7 +26,7 @@
#include "ext/standard/info.h"
#include "SAPI.h"
-#ifndef PHP_WIN32
+#if !defined(PHP_WIN32) && !defined(NETWARE)
#include "build-defs.h"
#endif
@@ -43,6 +43,13 @@
#include "win32/param.h"
#include "win32/winutil.h"
#define GET_DL_ERROR() php_win_err()
+#elif defined(NETWARE)
+#ifdef NEW_LIBC
+#include <sys/param.h>
+#else
+#include "netware/param.h"
+#endif
+#define GET_DL_ERROR() dlerror()
#else
#include <sys/param.h>
#define GET_DL_ERROR() dlerror()
@@ -141,7 +148,23 @@
efree(libpath);
-
+
+#ifdef NETWARE
+ /* NetWare doesn't support two NLMs exporting same symbol */
+ {
+ char symbol_name[64] = "\0";
+ int module_name_length = Z_STRLEN_P(file) - 4; /* '.nlm' is 4 characters;
+knock it off */
+
+ /* Take the module name (e.g.: 'php_ldap') and append '@get_module' to it */
+ strncpy(symbol_name, Z_STRVAL_P(file), module_name_length);
+ symbol_name[module_name_length] = '\0';
+ strcat(symbol_name, "@");
+ strcat(symbol_name, "get_module");
+
+ get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle,
+symbol_name);
+ }
+ /* NetWare doesn't prepend _ to symbol names. So, that portion of code is also
+not necessary */
+#else
get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle,
"get_module");
/*
@@ -152,6 +175,7 @@
if (!get_module)
get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle,
"_get_module");
+#endif
if (!get_module) {
DL_UNLOAD(handle);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php