#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
#include <windows.h>
#elif defined(__NETWARE__)
-#include <nwconio.h>
-#include <nwthread.h>
+#include <nks/thread.h>
+#include <screen.h>
#endif
#ifdef _PSP
struct arg_struct* parg = malloc(sizeof(*parg));
parg->argc = argc;
parg->argv = argv;
- DestroyScreen(GetCurrentScreen());
- SetCurrentScreen(CreateScreen("Tewi Console", 0));
- BeginThread(thread_stuff, NULL, 0, parg);
- ThreadSwitch();
- ExitThread(EXIT_THREAD, 0);
+ thread_stuff(parg);
return 0;
}
-#ifdef __NETWARE__
-void __WATCOM_Prelude(void){return;}
-#endif
-
void thread_stuff(void* pargs) {
int st;
int argc = ((struct arg_struct*)pargs)->argc;
#define INCL_DOSERRORS
#include <os2.h>
#elif defined(__NETWARE__)
-#include <nwadv.h>
-#include <nwthread.h>
+#include <dlfcn.h>
#else
#include <windows.h>
#include <direct.h>
}
lib = (void*)mod;
#elif defined(__NETWARE__)
- *hnd = FindNLMHandle(path);
- lib = (void*)hnd;
+ lib = dlopen(path, RTLD_LAZY);
#else
lib = LoadLibraryA(path);
#endif
}
return ret;
#elif defined(__NETWARE__)
- return ImportSymbol(*(unsigned int*)mod, sym);
+ return dlsym(mod, sym);
#else
return GetProcAddress(mod, sym);
#endif
typedef int socklen_t;
#elif defined(__NETWARE__)
#include <sys/socket.h>
-#include <nwthread.h>
-#define IPPROTO_TCP 0
-#define INADDR_ANY 0
+#include <arpa/inet.h>
+#include <sys/select.h>
+#include <pthread.h>
#define htons(x) x
#include "strptime.h"
#else
#include <sys/time.h>
#endif
-#if defined(__USLC__) || defined(__NeXT__) || defined(__NETWARE__)
+#if defined(__USLC__) || defined(__NeXT__)
typedef int socklen_t;
#endif
if(f == NULL) {
tw_http_error(s, sock, 403, name, port, vhost_entry);
} else {
- tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
+#ifdef __NETWARE__
+ tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime.tv_sec, cmtime);
+#else
+ tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
+#endif
fclose(f);
}
}
close_socket(sock);
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
#ifdef __NETWARE__
- ExitThread(EXIT_THREAD, 0);
+ pthread_exit(NULL);
#else
_endthread();
#endif
#ifdef __OS2__
_beginthread(tw_server_pass, 0, 0, e);
#elif defined(__NETWARE__)
- BeginThread(tw_server_pass, 0, 0, e);
+ pthread_t thr;
+ pthread_create(&thr, NULL, (void* (*)(void*))tw_server_pass, e);
+ pthread_detach(thr);
#else
_beginthread(tw_server_pass, 0, e);
#endif