- Timestamp:
- Oct 14, 2024, 7:01:02 PM (5 weeks ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/dir.c
r292 r315 7 7 #include <sys/stat.h> 8 8 #if !defined(_MSC_VER) && !defined(__WATCOMC__) 9 #include <dirent.h> 10 #elif defined(__NETWARE__) 9 11 #include <dirent.h> 10 12 #elif defined(__WATCOMC__) || defined(_MSC_VER) -
trunk/Makefile
r312 r315 45 45 -cp ./Server/tewi $(DESTDIR)$(PREFIX)/bin/ 46 46 -cp ./Server/tewi.exe $(DESTDIR)$(PREFIX)/bin/ 47 -cp ./Server/tewi.nlm $(DESTDIR)$(PREFIX)/bin/ 47 48 -cp ./Module/*.so $(DESTDIR)$(PREFIX)/lib/tewi/ 48 49 -cp ./Module/*.dll $(DESTDIR)$(PREFIX)/lib/tewi/ 50 -cp ./Module/*.nlm $(DESTDIR)$(PREFIX)/lib/tewi/ 49 51 50 52 format: -
trunk/Module/Makefile
r314 r315 13 13 14 14 .$(OBJ)$(LIBSUF): 15 $(CC) $(LDFLAGS) $(SHARED) -o $@ $< ../Common/common.$(STATIC) $(LIBS)15 $(CC) $(LDFLAGS) $(SHARED) -o $@ $< $(LIBEXTRA) ../Common/common.$(STATIC) $(LIBS) 16 16 17 17 .c.$(OBJ): -
trunk/Module/mod_cgi.c
r313 r315 22 22 return TW_MODULE_STOP; 23 23 } 24 25 #ifdef __NETWARE__ 26 int main() { return 0; } 27 #endif -
trunk/Module/mod_example.c
r313 r315 13 13 14 14 int MODULE_DECL mod_request(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res) { return TW_MODULE_ERROR(403); } 15 16 #ifdef __NETWARE__ 17 int main() { return 0; } 18 #endif -
trunk/Module/mod_proxy.c
r314 r315 14 14 15 15 int MODULE_DECL mod_request(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res) { return TW_MODULE_PASS; } 16 17 #ifdef __NETWARE__ 18 int main() { return 0; } 19 #endif -
trunk/README
r313 r315 45 45 Minix Working 46 46 UnixWare Working on 7.1.1 47 OS/2 Mostly working, module is broken. Help required! 47 OS/2 Working 48 NetWare WIP 48 49 PlayStation Portable Working, missing module support 49 50 TODO: Get multi-threading working (maybe) -
trunk/README.tmpl
r314 r315 46 46 UnixWare Working on 7.1.1 47 47 OS/2 Working 48 NetWare WIP 48 NetWare WIP, cannot run fopen somehow 49 49 PlayStation Portable Working, missing module support 50 50 TODO: Get multi-threading working (maybe) -
trunk/Server/Makefile
r255 r315 60 60 61 61 clean: 62 rm -f *.o tewi *.exe *.res *.elf *.sfo *.pbp *.self *.pkg *.obj concat.rc *.tds 62 rm -f *.o tewi *.exe *.res *.elf *.sfo *.pbp *.self *.pkg *.obj concat.rc *.tds *.nlm -
trunk/Server/config.c
r312 r315 10 10 #include <string.h> 11 11 #include <sys/stat.h> 12 #include <errno.h> 12 13 13 14 #if !defined(_MSC_VER) && !defined(__BORLANDC__) … … 125 126 #elif defined(__ps2sdk__) 126 127 strcpy(config.hostname, "ps2"); 128 #elif defined(__NETWARE__) 129 strcpy(config.hostname, "netware"); 127 130 #else 128 131 gethostname(config.hostname, 1024); … … 584 587 } 585 588 } else { 589 printf("%d\n", errno); 586 590 cm_log("Config", "Could not open the file"); 587 591 return 1; -
trunk/Server/http.c
r312 r315 22 22 #endif 23 23 24 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) )24 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) 25 25 #ifdef USE_WINSOCK1 26 26 #include <winsock.h> … … 28 28 #include <winsock2.h> 29 29 #endif 30 #elif defined(__NETWARE__) 31 #include <sys/socket.h> 30 32 #else 31 33 #ifdef USE_POLL -
trunk/Server/main.c
r312 r315 35 35 #include "tw_version.h" 36 36 37 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) )37 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) 38 38 #include <windows.h> 39 #elif defined(__NETWARE__) 40 #include <nwconio.h> 41 #include <nwthread.h> 39 42 #endif 40 43 … … 93 96 int startup(int argc, char** argv); 94 97 95 #if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) ) || defined(__BORLANDC__)98 #if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) || defined(__BORLANDC__) 96 99 char* get_registry(const char* main, const char* sub) { 97 100 DWORD bufsize = 512; … … 533 536 534 537 #if !defined(BUILD_GUI_VALID) 538 void thread_stuff(void* pargs); 539 540 struct arg_struct { 541 int argc; 542 char** argv; 543 }; 544 535 545 int main(int argc, char** argv) { 536 546 int st; 547 #ifdef __NETWARE__ 548 struct arg_struct* parg = malloc(sizeof(*parg)); 549 parg->argc = argc; 550 parg->argv = argv; 551 DestroyScreen(GetCurrentScreen()); 552 SetCurrentScreen(CreateScreen("Tewi Console", 0)); 553 BeginThread(thread_stuff, NULL, 0, parg); 554 ThreadSwitch(); 555 ExitThread(EXIT_THREAD, 0); 556 return 0; 557 } 558 559 void thread_stuff(void* pargs) { 560 int st; 561 int argc = ((struct arg_struct*)pargs)->argc; 562 char** argv = ((struct arg_struct*)pargs)->argv; 563 #endif 537 564 #ifdef SERVICE 538 565 SERVICE_TABLE_ENTRY table[] = {{"Tewi HTTPd", servmain}, {NULL, NULL}}; … … 707 734 ; 708 735 #endif 736 #ifdef __NETWARE__ 737 return; 738 #else 709 739 return st; 740 #endif 710 741 #endif 711 742 } … … 715 746 sceKernelExitGame(); 716 747 #endif 748 #ifdef __NETWARE__ 749 return; 750 #else 717 751 return 0; 752 #endif 718 753 } 719 754 #endif … … 722 757 int i; 723 758 char* r; 724 #if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) ) || defined(__BORLANDC__)759 #if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) || defined(__BORLANDC__) 725 760 char* confpath = cm_strdup(PREFIX "/etc/tewi.conf"); 726 761 char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir"); … … 806 841 signal(SIGCHLD, SIG_IGN); 807 842 signal(SIGPIPE, SIG_IGN); 808 #elif !defined(BUILD_GUI) && !defined(__OS2__) 843 #elif !defined(BUILD_GUI) && !defined(__OS2__) && !defined(__NETWARE__) 809 844 SetConsoleTitle(tw_server); 810 845 #endif -
trunk/Server/module.c
r313 r315 32 32 #define INCL_DOSERRORS 33 33 #include <os2.h> 34 #elif defined(__NETWARE__) 35 #include <nwadv.h> 36 #include <nwthread.h> 34 37 #else 35 38 #include <windows.h> … … 46 49 #ifdef __OS2__ 47 50 HMODULE mod; 51 #elif defined(__NETWARE__) 52 unsigned int* hnd = malloc(sizeof(*hnd)); 48 53 #endif 49 54 chdir(config.server_root); 50 55 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 51 56 #ifdef __OS2__ 52 if(DosLoadModule(tmp, 512, path, &mod) != NO_ERROR) {57 if(DosLoadModule(tmp, 512, path, &mod) != NO_ERROR) { 53 58 return NULL; 54 59 } 55 60 lib = (void*)mod; 61 #elif defined(__NETWARE__) 62 *hnd = FindNLMHandle(path); 63 lib = (void*)hnd; 56 64 #else 57 65 lib = LoadLibraryA(path); … … 73 81 void* ret; 74 82 APIRET rc; 75 if((rc = DosQueryProcAddr((HMODULE)mod, 0, sym, (PFN*)&ret)) != NO_ERROR) {83 if((rc = DosQueryProcAddr((HMODULE)mod, 0, sym, (PFN*)&ret)) != NO_ERROR) { 76 84 cm_log("Module", "OS/2 error %d", (int)rc); 77 85 return NULL; 78 86 } 79 87 return ret; 88 #elif defined(__NETWARE__) 89 return ImportSymbol(*(unsigned int*)mod, sym); 80 90 #else 81 91 return GetProcAddress(mod, sym); -
trunk/Server/server.c
r314 r315 48 48 #endif 49 49 50 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) )50 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) 51 51 #ifndef NO_GETNAMEINFO 52 52 #include <ws2tcpip.h> … … 63 63 #include "strptime.h" 64 64 typedef int socklen_t; 65 #elif defined(__NETWARE__) 66 #include <sys/socket.h> 67 #include <nwthread.h> 68 69 typedef int socklen_t; 70 #define IPPROTO_TCP 0 71 #define INADDR_ANY 0 72 #define htons(x) x 73 #include "strptime.h" 65 74 #else 66 75 #ifdef USE_POLL … … 137 146 #ifdef __OS2__ 138 147 soclose(sock); 148 #elif defined(__NETWARE__) 149 shutdown(sock, 2); 139 150 #elif defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 140 151 closesocket(sock); … … 146 157 int tw_server_init(void) { 147 158 int i; 148 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) )159 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) 149 160 WSADATA wsa; 150 161 #ifdef USE_WINSOCK1 … … 522 533 struct sockaddr* sa = (struct sockaddr*)&addr; 523 534 getnameinfo(sa, sizeof(addr), address, 512, NULL, 0, NI_NUMERICHOST); 524 #else 525 addrstr = inet_ntoa(addr.sin_addr); 526 strcpy(address, addrstr); 527 address[strlen(addrstr)] = 0; 535 #elif defined(__NETWARE__) 536 address[0] = 0; 537 #else 538 addrstr = inet_ntoa(addr.sin_addr); 539 strcpy(address, addrstr); 540 address[strlen(addrstr)] = 0; 528 541 #endif 529 542 #ifdef FREE_PTR … … 632 645 tw_mod_request_t mod_req = (tw_mod_request_t)tw_module_symbol(config.modules[i], "MOD_REQUEST"); 633 646 #else 634 tw_mod_request_t mod_req = (tw_mod_request_t)tw_module_symbol(config.modules[i], "mod_request");647 tw_mod_request_t mod_req = (tw_mod_request_t)tw_module_symbol(config.modules[i], "mod_request"); 635 648 #endif 636 649 if(mod_req != NULL) { … … 941 954 close_socket(sock); 942 955 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 956 #ifdef __NETWARE__ 957 ExitThread(EXIT_THREAD, 0); 958 #else 943 959 _endthread(); 960 #endif 944 961 #elif defined(__HAIKU__) 945 962 exit_thread(0); … … 959 976 #ifdef __HAIKU__ 960 977 thread_id thread; 978 #elif defined(__NETWARE__) 979 int thread; 961 980 #else 962 981 HANDLE handle; … … 1046 1065 #ifdef __OS2__ 1047 1066 _beginthread(tw_server_pass, 0, 0, e); 1067 #elif defined(__NETWARE__) 1068 BeginThread(tw_server_pass, 0, 0, e); 1048 1069 #else 1049 1070 _beginthread(tw_server_pass, 0, e); -
trunk/Server/strptime.c
r312 r315 38 38 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 39 39 40 #include <stdlib.h> 40 41 #include <ctype.h> 41 42 #include <string.h> … … 44 45 45 46 #ifdef __WATCOMC__ 47 #ifndef __NETWARE__ 46 48 #include <strings.h> 49 #endif 47 50 #endif 48 51 … … 117 120 #endif 118 121 119 #if def __BORLANDC__122 #if defined(__BORLANDC__) || defined(__NETWARE__) 120 123 char* cm_strdup(const char* str); 124 125 #ifdef __NETWARE__ 126 #define strncasecmp _strnicmp 127 #endif 121 128 122 129 int _strnicmp(const char* _a, const char* _b, int len){ … … 124 131 char* b = cm_strdup(_b); 125 132 int i; 126 char*r;133 int r; 127 134 for(i = 0; a[i] != 0; i++){ 128 135 a[i] = tolower(a[i]); … … 429 436 430 437 #ifndef TIME_MAX 431 #if defined(_MSC_VER) || defined(__BORLANDC__) 438 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__NETWARE__) 432 439 #define TIME_MAX INT32_MAX 433 440 #else -
trunk/Server/strptime.h
r312 r315 8 8 #include <time.h> 9 9 10 #if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) || defined(__OS2__) 10 #if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) || defined(__OS2__) || defined(__NETWARE__) 11 11 char* strptime(const char *buf, const char *fmt, struct tm *tm); 12 12 #endif -
trunk/Server/tw_config.h
r312 r315 15 15 #include <stdbool.h> 16 16 17 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) )17 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) 18 18 #ifdef USE_WINSOCK1 19 19 #include <winsock.h> … … 26 26 #include <net/net.h> 27 27 #endif 28 #if !defined(__OS2__) 28 #if !defined(__OS2__) && !defined(__NETWARE__) 29 29 #include <netinet/in.h> 30 30 #endif … … 32 32 #define NO_IPV6 33 33 #endif 34 #endif 35 36 #ifdef __NETWARE__ 37 struct in_addr { 38 unsigned int s_addr; 39 }; 40 41 struct sockaddr_in { 42 unsigned short sin_family; 43 unsigned short sin_port; 44 struct in_addr sin_addr; 45 char sin_zero[8]; 46 }; 34 47 #endif 35 48 -
trunk/Server/tw_module.h
r314 r315 16 16 #include <os2.h> 17 17 #define MODULE_DECL __export APIENTRY 18 #elif defined(__WATCOMC__) 19 #define MODULE_DECL __export 18 20 #else 19 21 #define MODULE_DECL … … 47 49 #define TW_CONFIG_ERROR _TW_CONFIG_ERROR 48 50 49 typedef int (MODULE_DECL *tw_mod_init_t)(struct tw_config* config, struct tw_tool* tools);50 typedef int (MODULE_DECL *tw_mod_request_t)(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res);51 typedef int (MODULE_DECL *tw_mod_config_t)(struct tw_tool* tools, char** argv, int argc);51 typedef int(MODULE_DECL* tw_mod_init_t)(struct tw_config* config, struct tw_tool* tools); 52 typedef int(MODULE_DECL* tw_mod_request_t)(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res); 53 typedef int(MODULE_DECL* tw_mod_config_t)(struct tw_tool* tools, char** argv, int argc); 52 54 53 55 #ifdef SOURCE -
trunk/config.h.tmpl
r312 r315 20 20 #endif 21 21 22 #if (defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) )) && defined(BUILD_GUI) && !defined(SERVICE)22 #if (defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))) && defined(BUILD_GUI) && !defined(SERVICE) 23 23 #define BUILD_GUI_VALID 24 24 #endif … … 73 73 #endif 74 74 75 #if defined(__WATCOMC__) && defined(__NETWARE__) && !defined(NO_IPV6) 76 #define NO_IPV6 77 #endif 78 75 79 #endif 76 80
Note:
See TracChangeset
for help on using the changeset viewer.