Skip to content
Newer
Older
100644 120 lines (103 sloc) 3.75 KB
a819349 Changed the licence to the one used by PHP Group
Anantha Kesari H Y authored Sep 11, 2002
1 /*
2 +----------------------------------------------------------------------+
dbeb415 @andigutmans - A belated happy holidays and PHP 5
andigutmans authored Jan 8, 2004
3 | PHP Version 5 |
a819349 Changed the licence to the one used by PHP Group
Anantha Kesari H Y authored Sep 11, 2002
4 +----------------------------------------------------------------------+
d64d9e3 @laruence year++
laruence authored Sep 5, 2012
5 | Copyright (c) 1997-2012 The PHP Group |
a819349 Changed the licence to the one used by PHP Group
Anantha Kesari H Y authored Sep 11, 2002
6 +----------------------------------------------------------------------+
5bd9322 bump year and license version
foobar authored Jan 1, 2006
7 | This source file is subject to version 3.01 of the PHP license, |
a819349 Changed the licence to the one used by PHP Group
Anantha Kesari H Y authored Sep 11, 2002
8 | that is bundled with this package in the file LICENSE, and is |
f68c7ff updating license information in the headers.
James Cox authored Jun 10, 2003
9 | available through the world-wide-web at the following url: |
5bd9322 bump year and license version
foobar authored Jan 1, 2006
10 | http://www.php.net/license/3_01.txt |
a819349 Changed the licence to the one used by PHP Group
Anantha Kesari H Y authored Sep 11, 2002
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Author: Novell, Inc. |
16 +----------------------------------------------------------------------+
17 */
18
19
233e06f File used by extensions like LDAP, MySQL etc.
Anantha Kesari H Y authored Sep 5, 2002
20 #include <library.h>
21 #include <netware.h>
22 #include <nks/synch.h>
23
ad7aa57 A few New files added and some old files modified for NetWare.
Anantha Kesari H Y authored Jan 3, 2003
24 void *gLibHandle = (void *) NULL;
233e06f File used by extensions like LDAP, MySQL etc.
Anantha Kesari H Y authored Sep 5, 2002
25 rtag_t gAllocTag = (rtag_t) NULL;
26 NXMutex_t *gLibLock = (NXMutex_t *) NULL;
ad7aa57 A few New files added and some old files modified for NetWare.
Anantha Kesari H Y authored Jan 3, 2003
27 int gLibId = 0;
28
233e06f File used by extensions like LDAP, MySQL etc.
Anantha Kesari H Y authored Sep 5, 2002
29
30 int DisposeLibraryData( void *data)
31 {
32 return 0;
33 }
34
35
36 int _NonAppStart
37 (
38 void *NLMHandle,
39 void *errorScreen,
40 const char *cmdLine,
41 const char *loadDirPath,
42 size_t uninitializedDataLength,
43 void *NLMFileHandle,
44 int (*readRoutineP)( int conn, void *fileHandle, size_t offset,
45 size_t nbytes, size_t *bytesRead, void *buffer ),
46 size_t customDataOffset,
47 size_t customDataSize,
48 int messageCount,
49 const char **messages
50 )
51 {
52 NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0);
53
54 #pragma unused(cmdLine)
55 #pragma unused(loadDirPath)
56 #pragma unused(uninitializedDataLength)
57 #pragma unused(NLMFileHandle)
58 #pragma unused(readRoutineP)
59 #pragma unused(customDataOffset)
60 #pragma unused(customDataSize)
61 #pragma unused(messageCount)
62 #pragma unused(messages)
63
ad7aa57 A few New files added and some old files modified for NetWare.
Anantha Kesari H Y authored Jan 3, 2003
64 /* Here we process our command line, post errors (to the error screen),
65 * perform initializations and anything else we need to do before being able
66 * to accept calls into us. If we succeed, we return non-zero and the NetWare
67 * Loader will leave us up, otherwise we fail to load and get dumped.
68 */
69 /**
70 gAllocTag = AllocateResourceTag(NLMHandle,
71 "<library-name> memory allocations", AllocSignature);
72 if (!gAllocTag) {
73 OutputToScreen(errorScreen, "Unable to allocate resource tag for "
74 "library memory allocations.\n");
75 return -1;
76 }
77 **/
233e06f File used by extensions like LDAP, MySQL etc.
Anantha Kesari H Y authored Sep 5, 2002
78 gLibId = register_library(DisposeLibraryData);
ad7aa57 A few New files added and some old files modified for NetWare.
Anantha Kesari H Y authored Jan 3, 2003
79 if (gLibId == -1) {
233e06f File used by extensions like LDAP, MySQL etc.
Anantha Kesari H Y authored Sep 5, 2002
80 OutputToScreen(errorScreen, "Unable to register library with kernel.\n");
81 return -1;
82 }
83
84 gLibHandle = NLMHandle;
85
86 gLibLock = NXMutexAlloc(0, 0, &liblock);
ad7aa57 A few New files added and some old files modified for NetWare.
Anantha Kesari H Y authored Jan 3, 2003
87 if (!gLibLock) {
233e06f File used by extensions like LDAP, MySQL etc.
Anantha Kesari H Y authored Sep 5, 2002
88 OutputToScreen(errorScreen, "Unable to allocate library data lock.\n");
89 return -1;
90 }
91
92 return 0;
93 }
94
95
96 void _NonAppStop( void )
97 {
ad7aa57 A few New files added and some old files modified for NetWare.
Anantha Kesari H Y authored Jan 3, 2003
98 /* Here we clean up any resources we allocated. Resource tags is a big part
99 * of what we created, but NetWare doesn't ask us to free those.
100 */
233e06f File used by extensions like LDAP, MySQL etc.
Anantha Kesari H Y authored Sep 5, 2002
101 (void) unregister_library(gLibId);
102 NXMutexFree(gLibLock);
103 }
104
ad7aa57 A few New files added and some old files modified for NetWare.
Anantha Kesari H Y authored Jan 3, 2003
105
233e06f File used by extensions like LDAP, MySQL etc.
Anantha Kesari H Y authored Sep 5, 2002
106 int _NonAppCheckUnload( void )
107 {
ad7aa57 A few New files added and some old files modified for NetWare.
Anantha Kesari H Y authored Jan 3, 2003
108 /* This function cannot be the first in the file for if the file is linked
109 * first, then the check-unload function's offset will be nlmname.nlm+0
110 * which is how to tell that there isn't one. When the check function is
111 * first in the linked objects, it is ambiguous. For this reason, we will
112 * put it inside this file after the stop function.
113 *
114 * Here we check to see if it's alright to ourselves to be unloaded. If not,
115 * we return a non-zero value. Right now, there isn't any reason not to allow
116 * it.
117 */
233e06f File used by extensions like LDAP, MySQL etc.
Anantha Kesari H Y authored Sep 5, 2002
118 return 0;
119 }
Something went wrong with that request. Please try again.