Changeset 347 in Main for trunk


Ignore:
Timestamp:
Oct 16, 2024, 1:33:28 AM (4 weeks ago)
Author:
Nishi
Message:

does not really work

Location:
trunk/Server
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Server/config.c

    r318 r347  
    1515#endif
    1616
    17 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__WATCOMC__))
     17#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
    1818#ifdef USE_WINSOCK1
    1919#include <winsock.h>
     
    3232#endif
    3333
     34#ifdef __NETWARE__
     35#include <arpa/inet.h>
     36#endif
    3437#include "tw_config.h"
    3538#include "tw_module.h"
  • trunk/Server/http.c

    r338 r347  
    3030#elif defined(__NETWARE__)
    3131#include <sys/socket.h>
     32#include <sys/select.h>
    3233#else
    3334#ifdef USE_POLL
  • trunk/Server/main.c

    r324 r347  
    3838#include <windows.h>
    3939#elif defined(__NETWARE__)
    40 #include <nwconio.h>
    41 #include <nwthread.h>
     40#include <nks/thread.h>
     41#include <screen.h>
    4242#endif
    4343
     
    549549        parg->argc = argc;
    550550        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);
     551        thread_stuff(parg);
    556552        return 0;
    557553}
    558 
    559 #ifdef __NETWARE__
    560 void __WATCOM_Prelude(void){return;}
    561 #endif
    562554
    563555void thread_stuff(void* pargs) {
  • trunk/Server/module.c

    r339 r347  
    3333#include <os2.h>
    3434#elif defined(__NETWARE__)
    35 #include <nwadv.h>
    36 #include <nwthread.h>
     35#include <dlfcn.h>
    3736#else
    3837#include <windows.h>
     
    6059        lib = (void*)mod;
    6160#elif defined(__NETWARE__)
    62         *hnd = FindNLMHandle(path);
    63         lib = (void*)hnd;
     61        lib = dlopen(path, RTLD_LAZY);
    6462#else
    6563        lib = LoadLibraryA(path);
     
    8785        return ret;
    8886#elif defined(__NETWARE__)
    89         return ImportSymbol(*(unsigned int*)mod, sym);
     87        return dlsym(mod, sym);
    9088#else
    9189        return GetProcAddress(mod, sym);
  • trunk/Server/server.c

    r342 r347  
    6565#elif defined(__NETWARE__)
    6666#include <sys/socket.h>
    67 #include <nwthread.h>
    68 #define IPPROTO_TCP 0
    69 #define INADDR_ANY 0
     67#include <arpa/inet.h>
     68#include <sys/select.h>
     69#include <pthread.h>
    7070#define htons(x) x
    7171#include "strptime.h"
     
    107107#endif
    108108
    109 #if defined(__USLC__) || defined(__NeXT__) || defined(__NETWARE__)
     109#if defined(__USLC__) || defined(__NeXT__)
    110110typedef int socklen_t;
    111111#endif
     
    933933                                                tw_http_error(s, sock, 403, name, port, vhost_entry);
    934934                                        } else {
    935                                                 tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
     935#ifdef __NETWARE__
     936                                                tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime.tv_sec, cmtime);
     937#else
     938                                                        tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
     939#endif
    936940                                                fclose(f);
    937941                                        }
     
    961965#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    962966#ifdef __NETWARE__
    963         ExitThread(EXIT_THREAD, 0);
     967        pthread_exit(NULL);
    964968#else
    965969        _endthread();
     
    10721076                                        _beginthread(tw_server_pass, 0, 0, e);
    10731077#elif defined(__NETWARE__)
    1074                                         BeginThread(tw_server_pass, 0, 0, e);
     1078                                        pthread_t thr;
     1079                                        pthread_create(&thr, NULL, (void* (*)(void*))tw_server_pass, e);
     1080                                        pthread_detach(thr);
    10751081#else
    10761082                                        _beginthread(tw_server_pass, 0, e);
  • trunk/Server/tw_config.h

    r328 r347  
    3535#define NO_IPV6
    3636#endif
    37 #endif
    38 
    39 #ifdef __NETWARE__
    40 struct in_addr {
    41         unsigned int s_addr;
    42 };
    43 
    44 struct sockaddr_in {
    45         unsigned short sin_family;
    46         unsigned short sin_port;
    47         struct in_addr sin_addr;
    48         char sin_zero[8];
    49 };
    5037#endif
    5138
Note: See TracChangeset for help on using the changeset viewer.