summaryrefslogtreecommitdiff
path: root/src/ivyprobe.c
diff options
context:
space:
mode:
authorfcolin2005-08-12 14:56:38 +0000
committerfcolin2005-08-12 14:56:38 +0000
commitf625f6e00c1d5d1194ce3db62e59ccc47fdf2386 (patch)
tree83514d0f7d22ca4c942605030161bb9e1b4e87fb /src/ivyprobe.c
parentecc347876655ccb547f5bd6389f07dc1e99c548c (diff)
downloadivy-c-f625f6e00c1d5d1194ce3db62e59ccc47fdf2386.zip
ivy-c-f625f6e00c1d5d1194ce3db62e59ccc47fdf2386.tar.gz
ivy-c-f625f6e00c1d5d1194ce3db62e59ccc47fdf2386.tar.bz2
ivy-c-f625f6e00c1d5d1194ce3db62e59ccc47fdf2386.tar.xz
Implementation binding simple sans regexp
Diffstat (limited to 'src/ivyprobe.c')
-rw-r--r--src/ivyprobe.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/ivyprobe.c b/src/ivyprobe.c
index c163577..bea1625 100644
--- a/src/ivyprobe.c
+++ b/src/ivyprobe.c
@@ -118,6 +118,7 @@ void HandleStdin (Channel channel, IVY_HANDLE fd, void *data)
char *cmd;
char *arg;
char *choparg;
+ char **applist;
int id;
IvyClientPtr app;
int err;
@@ -135,7 +136,7 @@ void HandleStdin (Channel channel, IVY_HANDLE fd, void *data)
cmd = strtok (line, ".: \n");
if (strcmp (cmd, "die") == 0) {
- arg = strtok (NULL, " \n");
+ arg = strtok (NULL, "\n"); /* no space separator appname can containt space*/
if (arg) {
app = IvyGetApplication (arg);
if (app)
@@ -144,15 +145,14 @@ void HandleStdin (Channel channel, IVY_HANDLE fd, void *data)
}
} else if (strcmp(cmd, "dieall-yes-i-am-sure") == 0) {
- arg = IvyGetApplicationList();
- arg = strtok (arg, " \n");
- while (arg) {
- app = IvyGetApplication (arg);
+ applist = IvyGetApplicationList();
+ while (*applist) {
+ app = IvyGetApplication (*applist);
if (app)
IvySendDieMsg (app);
else
- printf ("No Application %s!!!\n",arg);
- arg = strtok (NULL, " ");
+ printf ("No Application %s!!!\n",*applist);
+ applist++;
}
} else if (strcmp(cmd, "bind") == 0) {
@@ -181,7 +181,14 @@ void HandleStdin (Channel channel, IVY_HANDLE fd, void *data)
}
}
- } else if (strcmp(cmd, "where") == 0) {
+ }
+ else if (strcmp(cmd, "bindsimple") == 0) {
+ arg = strtok (NULL, "'");
+ if (arg) {
+ IvyBindSimpleMsg (Callback, NULL, Chop(arg));
+ }
+ }
+ else if (strcmp(cmd, "where") == 0) {
arg = strtok (NULL, " \n");
if (arg) {
app = IvyGetApplication (arg);
@@ -204,7 +211,11 @@ void HandleStdin (Channel channel, IVY_HANDLE fd, void *data)
}
} else if (strcmp(cmd, "who") == 0) {
- printf("Apps: %s\n", IvyGetApplicationList());
+ applist = IvyGetApplicationList();
+ while (*applist) {
+ printf ("Application '%s'\n",*applist);
+ applist++;
+ }
} else if (strcmp(cmd, "help") == 0) {
fprintf(stderr,"Commands list:\n");
@@ -214,7 +225,8 @@ void HandleStdin (Channel channel, IVY_HANDLE fd, void *data)
printf(" .dieall-yes-i-am-sure - send die msg to all applis\n");
printf(" .direct appname id 'arg' - send direct msg to appname\n");
printf(" .where appname - on which host is appname\n");
- printf(" .bind 'regexp' - add a msg to receive\n");
+ printf(" .bind 'regexp' - add a msg to receive using regexp\n");
+ printf(" .bindsimple 'expr' - add a msg to receive using simple msg format tag param param\n");
printf(" .bindcall - toogle callback to binding\n");
printf(" .who - who is on the bus\n");
} else if (strcmp(cmd, "bindcall") == 0) {