summaryrefslogtreecommitdiff
path: root/netware/start.c
diff options
context:
space:
mode:
Diffstat (limited to 'netware/start.c')
-rw-r--r--netware/start.c73
1 files changed, 33 insertions, 40 deletions
diff --git a/netware/start.c b/netware/start.c
index dcb1643a52..903aef6ed2 100644
--- a/netware/start.c
+++ b/netware/start.c
@@ -21,14 +21,14 @@
#include <netware.h>
#include <nks/synch.h>
-void *gLibHandle = (void *) NULL;
+void *gLibHandle = (void *) NULL;
rtag_t gAllocTag = (rtag_t) NULL;
NXMutex_t *gLibLock = (NXMutex_t *) NULL;
-int gLibId=0;
+int gLibId = 0;
+
int DisposeLibraryData( void *data)
{
-
return 0;
}
@@ -61,26 +61,22 @@ int _NonAppStart
#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;
-// }
-
+/* 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)
- {
+ if (gLibId == -1) {
OutputToScreen(errorScreen, "Unable to register library with kernel.\n");
return -1;
}
@@ -88,9 +84,7 @@ int _NonAppStart
gLibHandle = NLMHandle;
gLibLock = NXMutexAlloc(0, 0, &liblock);
-
- if (!gLibLock)
- {
+ if (!gLibLock) {
OutputToScreen(errorScreen, "Unable to allocate library data lock.\n");
return -1;
}
@@ -101,26 +95,25 @@ int _NonAppStart
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.
-*/
+/* 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.
-*/
+/* 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;
}