* $Id$\r
***************************************************************************/\r
\r
-/* This file is only used in the NetWare build */\r
-\r
#include <errno.h>\r
#include <string.h>\r
#include <stdlib.h>\r
int y;\r
int z;\r
void *tenbytes;\r
- NXKey_t perthreadkey; // if -1, no key obtained...\r
+ NXKey_t perthreadkey; /* if -1, no key obtained... */\r
NXMutex_t *lock;\r
} libdata_t;\r
\r
rtag_t gAllocTag = (rtag_t) NULL;\r
NXMutex_t *gLibLock = (NXMutex_t *) NULL;\r
\r
-\r
-\r
-// internal library function prototypes...\r
+/* internal library function prototypes... */\r
int DisposeLibraryData ( void * );\r
void DisposeThreadData ( void * );\r
int GetOrSetUpData ( int id, libdata_t **data, libthreaddata_t **threaddata );\r
return 0;\r
}\r
\r
-void _NonAppStop( void )\r
-{\r
/*\r
** Here we clean up any resources we allocated. Resource tags is a big part\r
** of what we created, but NetWare doesn't ask us to free those.\r
*/\r
+void _NonAppStop( void )\r
+{\r
(void) unregister_library(gLibId);\r
NXMutexFree(gLibLock);\r
}\r
\r
-int _NonAppCheckUnload( void )\r
-{\r
/*\r
** This function cannot be the first in the file for if the file is linked\r
** first, then the check-unload function's offset will be nlmname.nlm+0\r
** we return a non-zero value. Right now, there isn't any reason not to allow\r
** it.\r
*/\r
+int _NonAppCheckUnload( void )\r
+{\r
return 0;\r
}\r
\r
libdata_t *app_data;\r
libthreaddata_t *thread_data;\r
NXKey_t key;\r
-// NXMutex_t *lock;\r
NX_LOCK_INFO_ALLOC(liblock, "Application Data Lock", 0);\r
\r
err = 0;\r
}\r
else\r
{\r
- // create key for thread-specific data...\r
+ /* create key for thread-specific data... */\r
err = NXKeyCreate(DisposeThreadData, (void *) NULL, &key);\r
\r
- if (err) // (no more keys left?)\r
+ if (err) /* (no more keys left?) */\r
key = -1;\r
\r
app_data->perthreadkey = key;\r
{\r
key = app_data->perthreadkey;\r
\r
- if ( key != -1 // couldn't create a key? no thread data\r
+ if ( key != -1 /* couldn't create a key? no thread data */\r
&& !(err = NXKeyGetValue(key, (void **) &thread_data))\r
&& !thread_data)\r
{\r
free(data);\r
}\r
}\r
+\r
+\r