Changeset 315 in Main for trunk/Server/main.c


Ignore:
Timestamp:
Oct 14, 2024, 7:01:02 PM (5 weeks ago)
Author:
Nishi
Message:

wip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Server/main.c

    r312 r315  
    3535#include "tw_version.h"
    3636
    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__))
    3838#include <windows.h>
     39#elif defined(__NETWARE__)
     40#include <nwconio.h>
     41#include <nwthread.h>
    3942#endif
    4043
     
    9396int startup(int argc, char** argv);
    9497
    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__)
    9699char* get_registry(const char* main, const char* sub) {
    97100        DWORD bufsize = 512;
     
    533536
    534537#if !defined(BUILD_GUI_VALID)
     538void thread_stuff(void* pargs);
     539
     540struct arg_struct {
     541        int argc;
     542        char** argv;
     543};
     544
    535545int main(int argc, char** argv) {
    536546        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
     559void 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
    537564#ifdef SERVICE
    538565        SERVICE_TABLE_ENTRY table[] = {{"Tewi HTTPd", servmain}, {NULL, NULL}};
     
    707734                        ;
    708735#endif
     736#ifdef __NETWARE__
     737                return;
     738#else
    709739                return st;
     740#endif
    710741#endif
    711742        }
     
    715746        sceKernelExitGame();
    716747#endif
     748#ifdef __NETWARE__
     749        return;
     750#else
    717751        return 0;
     752#endif
    718753}
    719754#endif
     
    722757        int i;
    723758        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__)
    725760        char* confpath = cm_strdup(PREFIX "/etc/tewi.conf");
    726761        char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir");
     
    806841        signal(SIGCHLD, SIG_IGN);
    807842        signal(SIGPIPE, SIG_IGN);
    808 #elif !defined(BUILD_GUI) && !defined(__OS2__)
     843#elif !defined(BUILD_GUI) && !defined(__OS2__) && !defined(__NETWARE__)
    809844        SetConsoleTitle(tw_server);
    810845#endif
Note: See TracChangeset for help on using the changeset viewer.