30 #include <nks/thread.h>
31 #include <nks/synch.h>
66 const char *loadDirPath,
67 size_t uninitializedDataLength,
69 int (*readRoutineP)(
int conn,
void *fileHandle,
size_t offset,
70 size_t nbytes,
size_t *bytesRead,
void *
buffer ),
71 size_t customDataOffset,
72 size_t customDataSize,
77 NX_LOCK_INFO_ALLOC(liblock,
"Per-Application Data Lock", 0);
80 #pragma unused(cmdLine)
81 #pragma unused(loadDirPath)
82 #pragma unused(uninitializedDataLength)
83 #pragma unused(NLMFileHandle)
84 #pragma unused(readRoutineP)
85 #pragma unused(customDataOffset)
86 #pragma unused(customDataSize)
87 #pragma unused(messageCount)
88 #pragma unused(messages)
97 gAllocTag = AllocateResourceTag(NLMHandle,
98 "<library-name> memory allocations", AllocSignature);
102 OutputToScreen(errorScreen,
"Unable to allocate resource tag for "
103 "library memory allocations.\n");
111 OutputToScreen(errorScreen,
"Unable to register library with kernel.\n");
117 gLibLock = NXMutexAlloc(0, 0, &liblock);
121 OutputToScreen(errorScreen,
"Unable to allocate library data lock.\n");
165 NX_LOCK_INFO_ALLOC(liblock,
"Application Data Lock", 0);
175 app_data = (
libdata_t *) get_app_data(
id);
189 if (!(app_data = (
libdata_t *) get_app_data(
id)))
198 app_data->
lock = NXMutexAlloc(0, 0, &liblock);
203 NXMutexFree(app_data->
lock);
219 err = set_app_data(
gLibId, app_data);
249 && !(err = NXKeyGetValue(key, (
void **) &thread_data))
273 if ((err = NXKeySetValue(key, thread_data)))
287 *threadData = thread_data;
299 void *tenbytes = ((
libdata_t *) data)->tenbytes;
int DisposeLibraryData(void *)
int GetOrSetUpData(int id, libdata_t **data, libthreaddata_t **threaddata)
GLsizei GLsizei GLenum GLenum const GLvoid * data
static WindowRef ValidModeCallbackProc inCallback OSStatus err
void DisposeThreadData(void *)
int _NonAppCheckUnload(void)
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
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)