summaryrefslogtreecommitdiff
path: root/netware
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /netware
downloadphp2-master.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'netware')
-rw-r--r--netware/sendmail_nw.h19
-rw-r--r--netware/start.c119
2 files changed, 138 insertions, 0 deletions
diff --git a/netware/sendmail_nw.h b/netware/sendmail_nw.h
new file mode 100644
index 0000000..b88f8e1
--- /dev/null
+++ b/netware/sendmail_nw.h
@@ -0,0 +1,19 @@
+
+#define closesocket close
+#define LPCSTR char *
+#define LPSTR char*
+#define FAR
+#ifdef USE_WINSOCK
+#include <novsock2.h>
+#else
+#include <sys/socket.h> /* For struct sockaddr, 'PF_INET' and 'AF_INET' */
+#include <netinet/in.h> /* For struct sockaddr_in */
+#include <netdb.h> /* For struct hostent */
+#endif /* USE_WINSOCK */
+
+typedef int SOCKET; /* Borrowed from winsock\novsock2.h */
+typedef struct sockaddr_in SOCKADDR_IN;
+typedef struct sockaddr * LPSOCKADDR;
+typedef struct hostent * LPHOSTENT;
+
+#define INVALID_SOCKET (SOCKET)(~0) /* Borrowed from winsock\novsock2.h */
diff --git a/netware/start.c b/netware/start.c
new file mode 100644
index 0000000..2765ffb
--- /dev/null
+++ b/netware/start.c
@@ -0,0 +1,119 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2013 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Novell, Inc. |
+ +----------------------------------------------------------------------+
+ */
+
+
+#include <library.h>
+#include <netware.h>
+#include <nks/synch.h>
+
+void *gLibHandle = (void *) NULL;
+rtag_t gAllocTag = (rtag_t) NULL;
+NXMutex_t *gLibLock = (NXMutex_t *) NULL;
+int gLibId = 0;
+
+
+int DisposeLibraryData( void *data)
+{
+ return 0;
+}
+
+
+int _NonAppStart
+(
+ void *NLMHandle,
+ void *errorScreen,
+ const char *cmdLine,
+ const char *loadDirPath,
+ size_t uninitializedDataLength,
+ void *NLMFileHandle,
+ int (*readRoutineP)( int conn, void *fileHandle, size_t offset,
+ size_t nbytes, size_t *bytesRead, void *buffer ),
+ size_t customDataOffset,
+ size_t customDataSize,
+ int messageCount,
+ const char **messages
+)
+{
+ NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0);
+
+#pragma unused(cmdLine)
+#pragma unused(loadDirPath)
+#pragma unused(uninitializedDataLength)
+#pragma unused(NLMFileHandle)
+#pragma unused(readRoutineP)
+#pragma unused(customDataOffset)
+#pragma unused(customDataSize)
+#pragma unused(messageCount)
+#pragma unused(messages)
+
+/* Here we process our command line, post errors (to the error screen),
+ * perform initializations and anything else we need to do before being able
+ * to accept calls into us. If we succeed, we return non-zero and the NetWare
+ * Loader will leave us up, otherwise we fail to load and get dumped.
+ */
+/**
+ gAllocTag = AllocateResourceTag(NLMHandle,
+ "<library-name> memory allocations", AllocSignature);
+ if (!gAllocTag) {
+ OutputToScreen(errorScreen, "Unable to allocate resource tag for "
+ "library memory allocations.\n");
+ return -1;
+ }
+**/
+ gLibId = register_library(DisposeLibraryData);
+ if (gLibId == -1) {
+ OutputToScreen(errorScreen, "Unable to register library with kernel.\n");
+ return -1;
+ }
+
+ gLibHandle = NLMHandle;
+
+ gLibLock = NXMutexAlloc(0, 0, &liblock);
+ if (!gLibLock) {
+ OutputToScreen(errorScreen, "Unable to allocate library data lock.\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+
+void _NonAppStop( void )
+{
+/* Here we clean up any resources we allocated. Resource tags is a big part
+ * of what we created, but NetWare doesn't ask us to free those.
+ */
+ (void) unregister_library(gLibId);
+ NXMutexFree(gLibLock);
+}
+
+
+int _NonAppCheckUnload( void )
+{
+/* This function cannot be the first in the file for if the file is linked
+ * first, then the check-unload function's offset will be nlmname.nlm+0
+ * which is how to tell that there isn't one. When the check function is
+ * first in the linked objects, it is ambiguous. For this reason, we will
+ * put it inside this file after the stop function.
+ *
+ * Here we check to see if it's alright to ourselves to be unloaded. If not,
+ * we return a non-zero value. Right now, there isn't any reason not to allow
+ * it.
+ */
+ return 0;
+}