*/
#include <common.h>
#include <acess/sys.h>
+#include <stdlib.h>
+#include <stdio.h>
// === IMPORTS ===
extern void WM_Update(void);
int giTerminalFD = -1;
int giMouseFD = -1;
-
+
+#define __INSTALL_ROOT "/Acess/Apps/AxWin/3.0"
+
+const char *gsInstallRoot = __INSTALL_ROOT;
// === CODE ===
/**
*/
int main(int argc, char *argv[])
{
+ int server_tid = gettid();
+
ParseCommandline(argc, argv);
if( gsTerminalDevice == NULL ) {
// WM_Update();
+ // Spawn interface root
+ if( clone(CLONE_VM, 0) == 0 )
+ {
+ static char csInterfaceApp[] = __INSTALL_ROOT"/AxWinUI";
+ char server_info[] = "AXWIN3_SERVER=00000";
+ char *envp[] = {server_info, NULL};
+ char *argv[] = {csInterfaceApp, NULL};
+ sprintf(server_info, "AXWIN3_SERVER=%i", server_tid);
+ execve(csInterfaceApp, argv, envp);
+ }
+
// Main Loop
for(;;)
{
IPC_FillSelect(&nfds, &fds);
nfds ++;
- select(nfds, &fds, NULL, NULL, NULL);
+ if( select(nfds, &fds, NULL, NULL, NULL) == -1 ) {
+ _SysDebug("ERROR: select() returned -1");
+ return -1;
+ }
Input_HandleSelect(&fds);
IPC_HandleSelect(&fds);
*/
#include <axwin3/axwin.h>
#include "include/ipc.h"
+#include "include/internal.h"
// === CODE ===
int SoMain(void *Base, int argc, const char *argv[], const char **envp)
{
- // TODO: Parse the environment for the AXWIN3_PID variable
+ // TODO: Parse the environment for the AXWIN3_SERVER variable
+ gsAxWin3_int_ServerDesc = getenv("AXWIN3_SERVER");
return 0;
}
// === CODE ===
void AxWin3_Connect(const char *ServerDesc)
{
+ _SysDebug("ServerDesc = %s", ServerDesc);
if( !ServerDesc )
{
ServerDesc = gsAxWin3_int_ServerDesc;
}
+ _SysDebug("ServerDesc = %s", ServerDesc);
if( !ServerDesc )
{
// TODO: Error out
switch(giConnectionType)
{
case CONNTYPE_SENDMESSAGE:
+ if(SysGetMessage(NULL, NULL) == 0)
+ sleep();
while(SysGetMessage(NULL, NULL))
{
pid_t tid;