Compatibility fix for E-Slides.

SVN revision: 13382
This commit is contained in:
Kim Woelders 2005-02-15 22:24:03 +00:00
parent 906345c682
commit b9b2a9ec29
1 changed files with 44 additions and 6 deletions

View File

@ -1257,6 +1257,40 @@ IPC_Warp(const char *params, Client * c __UNUSED__)
} }
} }
/*
* Compatibility stuff - DO NOT USE
*/
static int
IPC_Compat(const char *params)
{
int ok = 0;
char param1[128];
const char *p;
int len;
if (!params)
goto done;
len = 0;
param1[0] = '\0';
sscanf(params, "%127s %n", param1, &len);
p = params + len;
ok = 1;
if (!strcmp(param1, "goto_desktop"))
{
if (*p == '?')
IpcPrintf("Current Desktop: %d\n", DesksGetCurrent());
}
else
{
ok = 0;
}
done:
return ok;
}
/* the IPC Array */ /* the IPC Array */
/* the format of an IPC member of the IPC array is as follows: /* the format of an IPC member of the IPC array is as follows:
@ -1504,8 +1538,7 @@ IPC_GetList(int *pnum)
int int
HandleIPC(const char *params, Client * c) HandleIPC(const char *params, Client * c)
{ {
int i; int i, num, ok;
int num;
char w[FILEPATH_LEN_MAX]; char w[FILEPATH_LEN_MAX];
const IpcItem **lst, *ipc; const IpcItem **lst, *ipc;
@ -1518,6 +1551,7 @@ HandleIPC(const char *params, Client * c)
word(params, 1, w); word(params, 1, w);
ok = 0;
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
ipc = lst[i]; ipc = lst[i];
@ -1530,12 +1564,16 @@ HandleIPC(const char *params, Client * c)
else else
ipc->func(NULL, c); ipc->func(NULL, c);
IpcPrintFlush(c); ok = 1;
CommsFlush(c); break;
return 1;
} }
return 0; if (!ok)
ok = IPC_Compat(params);
IpcPrintFlush(c);
CommsFlush(c);
return ok;
} }
int int