2 * AxWin3 Interface Library
3 * - By John Hodge (thePowersGang)
6 * - Entrypoint and setup
8 #include <axwin3/axwin.h>
9 #include "include/internal.h"
10 #include "include/ipc.h"
14 int giAxWin3_MainLoopExit;
17 int SoMain(void *Base, int argc, const char *argv[], const char **envp)
19 // TODO: Parse the environment for the AXWIN3_SERVER variable
20 //gsAxWin3_int_ServerDesc = getenv("AXWIN3_SERVER");
21 gsAxWin3_int_ServerDesc = "pipe:/Devices/ipcpipe/axwin";
25 int AxWin3_MainLoop(void)
27 tAxWin_IPCMessage *msg;
29 giAxWin3_MainLoopExit = 0;
31 while(!giAxWin3_MainLoopExit)
33 msg = AxWin3_int_GetIPCMessage(0, NULL);
36 _SysDebug("AxWin3_MainLoop - Message (Type=%i, Window=%i, Len=%i)",
37 msg->ID, msg->Window, msg->Size);
39 AxWin3_int_HandleMessage( msg );
41 return giAxWin3_MainLoopExit;
44 void AxWin3_StopMainLoop(int Reason)
46 giAxWin3_MainLoopExit = Reason;
49 void AxWin3_MessageSelect(int nFD, fd_set *FDs)
51 tAxWin_IPCMessage *msg;
52 msg = AxWin3_int_GetIPCMessage(nFD, FDs);
54 AxWin3_int_HandleMessage( msg );