summaryrefslogtreecommitdiff
path: root/lib/nwlib.c
diff options
context:
space:
mode:
authorGunter Knauf <gk@gknw.de>2007-06-30 20:02:51 +0000
committerGunter Knauf <gk@gknw.de>2007-06-30 20:02:51 +0000
commit3fc6faf1ae48f15f627ccd4fae92d9c085876d42 (patch)
tree8f29a729090f9713dcb57fc8960ca19d99c5d403 /lib/nwlib.c
parentc8a47bf6621b8d23608d9e09da7296c289a13355 (diff)
downloadcurl-3fc6faf1ae48f15f627ccd4fae92d9c085876d42.tar.gz
enabled building for NetWare CLIB architecture.
Diffstat (limited to 'lib/nwlib.c')
-rw-r--r--lib/nwlib.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/lib/nwlib.c b/lib/nwlib.c
index 846353aba..da155ac90 100644
--- a/lib/nwlib.c
+++ b/lib/nwlib.c
@@ -23,9 +23,12 @@
#ifdef NETWARE /* Novell NetWare */
+#include <stdlib.h>
+
+#ifdef __NOVELL_LIBC__
+/* For native LibC-based NLM we need to register as a real lib. */
#include <errno.h>
#include <string.h>
-#include <stdlib.h>
#include <library.h>
#include <netware.h>
#include <screen.h>
@@ -148,7 +151,7 @@ void _NonAppStop( void )
** we return a non-zero value. Right now, there isn't any reason not to allow
** it.
*/
-int _NonAppCheckUnload( void )
+int _NonAppCheckUnload( void )
{
return 0;
}
@@ -275,10 +278,10 @@ int GetOrSetUpData(int id, libdata_t **appData,
return err;
}
-int DisposeLibraryData( void *data)
+int DisposeLibraryData( void *data )
{
if (data) {
- void *tenbytes = ((libdata_t *) data)->tenbytes;
+ void *tenbytes = ((libdata_t *) data)->tenbytes;
if (tenbytes)
free(tenbytes);
@@ -289,10 +292,10 @@ int DisposeLibraryData( void *data)
return 0;
}
-void DisposeThreadData(void *data)
+void DisposeThreadData( void *data )
{
if (data) {
- void *twentybytes = ((libthreaddata_t *) data)->twentybytes;
+ void *twentybytes = ((libthreaddata_t *) data)->twentybytes;
if (twentybytes)
free(twentybytes);
@@ -301,4 +304,28 @@ void DisposeThreadData(void *data)
}
}
+#else /* __NOVELL_LIBC__ */
+/* For native CLib-based NLM seems we can do a bit more simple. */
+#include <nwthread.h>
+
+/* Make the CLIB Ctx stuff link */
+/*
+#include <stdio.h>
+#include <netdb.h>
+NETDB_DEFINE_CONTEXT
+*/
+
+int main ( void )
+{
+ /* initialize any globals here... */
+
+ /* do this if any global initializing was done
+ SynchronizeStart();
+ */
+ ExitThread (TSR_THREAD, 0);
+ return 0;
+}
+
+#endif /* __NOVELL_LIBC__ */
+
#endif /* NETWARE */