123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- #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)
- 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 )
- {
- (void) unregister_library(gLibId);
- NXMutexFree(gLibLock);
- }
- int _NonAppCheckUnload( void )
- {
- return 0;
- }
|