--- /dev/null
+# $Id$
+
+PREFIX = C:/Tewi
+
+PLATFORM_IDENT = DOS_WATCOM
+CC = owcc
+AR = wlib
+AR_FLAGS = -q -b -n -fo
+CFLAGS = -b dos4g$(END) -I $(WATCOM)/h -I $(PWD)/watt32/inc -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -fPIC
+LDFLAGS = -b dos4g$(END)
+LIBS = $(PWD)/watt32/lib/wattcpwf.lib
+EXEC = .exe
+STATIC = lib
+LIBSUF = .dll
+OBJ = obj
+MODULE=
Minix Working
UnixWare Working on 7.1.1
OS/2 Working
+DOS Working, missing module support and multi-threading
NeXTSTEP Working, missing module support
PlayStation Portable Working, missing module support
TODO: Get multi-threading working (maybe)
Minix Working
UnixWare Working on 7.1.1
OS/2 Working
+DOS Working, missing module support and multi-threading
NeXTSTEP Working, missing module support
PlayStation Portable Working, missing module support
TODO: Get multi-threading working (maybe)
#include <unistd.h>
#endif
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
#ifdef USE_WINSOCK1
#include <winsock.h>
#else
#include <tcpustd.h>
#endif
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
#ifdef USE_WINSOCK1
#include <winsock.h>
#else
#include <types.h>
#endif
+#ifdef __DOS__
+#include <tcp.h>
+#endif
+
#include <cm_log.h>
#include <cm_string.h>
#include "tw_server.h"
#include "tw_version.h"
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
#include <windows.h>
#elif defined(__NETWARE__)
#endif
int startup(int argc, char** argv);
-#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) || defined(__BORLANDC__)
+#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__)) || defined(__BORLANDC__)
char* get_registry(const char* main, const char* sub) {
DWORD bufsize = 512;
HKEY handle;
int startup(int argc, char** argv) {
int i;
char* r;
-#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) || defined(__BORLANDC__)
+#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__)) || defined(__BORLANDC__)
char* confpath = cm_strdup(PREFIX "/etc/tewi.conf");
char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir");
if(regpath != NULL) {
STDERR_LOG("Could not read the config\n");
return 1;
}
+#ifdef __DOS__
+ sock_init();
+#endif
if(tw_server_init() != 0) {
STDERR_LOG("Could not initialize the server\n");
return 1;
#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
signal(SIGCHLD, SIG_IGN);
signal(SIGPIPE, SIG_IGN);
-#elif !defined(BUILD_GUI) && !defined(__OS2__) && !defined(__NETWARE__)
+#elif !defined(BUILD_GUI) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__)
SetConsoleTitle(tw_server);
#endif
return -1;
extern struct tw_config config;
-#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(__NeXT__)
+#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(__NeXT__) || defined(__DOS__)
void* tw_module_load(const char* path) { return NULL; }
void* tw_module_symbol(void* mod, const char* sym) { return NULL; }
#include <tcpustd.h>
#endif
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
#ifndef NO_GETNAMEINFO
#include <ws2tcpip.h>
#include <wspiapi.h>
#define htons(x) x
#include "strptime.h"
typedef int socklen_t;
+#elif defined(__DOS__)
+#include <netinet/tcp.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/select.h>
+
+#include "strptime.h"
#else
#ifdef USE_POLL
#ifdef __PPU__
int tw_server_init(void) {
int i;
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
WSADATA wsa;
#ifdef USE_WINSOCK1
WSAStartup(MAKEWORD(1, 1), &wsa);
close_socket(sock);
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
#ifdef __NETWARE__
+#elif defined(__DOS__)
#else
_endthread();
#endif
thread_id thread;
#elif defined(__NETWARE__)
int thread;
+#elif defined(__DOS__)
#else
HANDLE handle;
#endif
_beginthread(tw_server_pass, 0, 0, e);
#elif defined(__NETWARE__)
tw_server_pass(e);
+#elif defined(__DOS__)
+ tw_server_pass(e);
#else
_beginthread(tw_server_pass, 0, e);
#endif
bp = NULL;
continue;
}
-#if defined(_WIN32) || defined(__OS2__) || defined(__NeXT__)
+#if defined(_WIN32) || defined(__OS2__) || defined(__NeXT__) || defined(__DOS__)
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__NeXT__)
if (1)
#else
#include <time.h>
-#if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) || defined(__OS2__) || defined(__NETWARE__) || defined(__NeXT__)
+#if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) || defined(__OS2__) || defined(__NETWARE__) || defined(__NeXT__) || defined(__DOS__)
char* strptime(const char *buf, const char *fmt, struct tm *tm);
#endif
#include <sys/types.h>
#endif
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
#ifdef USE_WINSOCK1
#include <winsock.h>
#else
"NeXT"
#elif defined(__NETWARE__)
"NetWare"
+#elif defined(__DOS__)
+ "DOS"
#elif defined(__MINGW32__)
"Windows-MinGW32"
#elif defined(_MSC_VER)
#define NO_IPV6
#endif
+#if defined(__WATCOMC__) && defined(__DOS__) && !defined(NO_IPV6)
+#define NO_IPV6
+#endif
+
#if defined(__NeXT__) && !defined(NO_IPV6)
#define NO_IPV6
#endif