summaryrefslogtreecommitdiff
path: root/src/ivyprobe.c
diff options
context:
space:
mode:
authorfcolin2005-06-02 15:22:31 +0000
committerfcolin2005-06-02 15:22:31 +0000
commit5d37f485f4105ebc02541eaf8065ee1c67e20f23 (patch)
tree70b2db28b85c57175d15f636230673f4cad50e8e /src/ivyprobe.c
parentfb9ff051afa822f2d99c167d4ac1a1ca0920b24c (diff)
downloadivy-c-5d37f485f4105ebc02541eaf8065ee1c67e20f23.zip
ivy-c-5d37f485f4105ebc02541eaf8065ee1c67e20f23.tar.gz
ivy-c-5d37f485f4105ebc02541eaf8065ee1c67e20f23.tar.bz2
ivy-c-5d37f485f4105ebc02541eaf8065ee1c67e20f23.tar.xz
modify callback of binding id is private part of implementation not exported to API !
Diffstat (limited to 'src/ivyprobe.c')
-rw-r--r--src/ivyprobe.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/ivyprobe.c b/src/ivyprobe.c
index fd4e0cb..1da9ebc 100644
--- a/src/ivyprobe.c
+++ b/src/ivyprobe.c
@@ -70,21 +70,19 @@ int app_count = 0;
int wait_count = 0;
int fbindcallback = 0;
-void DirectCallback(IvyClientPtr app, void *user_data, int id, char *msg ) {
+void DirectCallback(IvyClientPtr app, void *user_data, int id, char *msg )
+{
printf("%s sent a direct message, id=%d, message=%s\n",
IvyGetApplicationName(app),id,msg);
}
-void BindCallback(IvyClientPtr app, void *user_data, int id, char *regexp, IvyBindEvent event ) {
+void BindCallback(IvyClientPtr app, void *user_data, IvyBindEvent event, char *regexp )
+{
char *sevent;
- if (event==IvyAddBind){
- sevent="added";
- }
- else{
- sevent="removed";
- }
- printf("%s has modified his binding, id=%d, regexp=%s is %s\n",
- IvyGetApplicationName(app),id,regexp,sevent);
+ sevent= event==IvyAddBind ? "added" :"removed";
+
+ printf("%s has modified his binding, regexp=%s is %s\n",
+ IvyGetApplicationName(app),regexp,sevent);
}
void Callback (IvyClientPtr app, void *user_data, int argc, char *argv[])
@@ -195,20 +193,21 @@ void HandleStdin (Channel channel, HANDLE fd, void *data)
} else if (strcmp(cmd, "help") == 0) {
fprintf(stderr,"Commands list:\n");
- printf(" .help - this help\n");
- printf(" .quit - terminate this application\n");
- printf(" .die appname - send die msg to appname\n");
- 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(" .who - who is on the bus\n");
+ printf(" .help - this help\n");
+ printf(" .quit - terminate this application\n");
+ printf(" .die appname - send die msg to appname\n");
+ 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(" .bindcall - add callback to binding\n");
+ printf(" .who - who is on the bus\n");
} else if (strcmp(cmd, "bindcall") == 0) {
if (!fbindcallback) {
IvySetBindCallback(BindCallback, NULL);
fbindcallback=1;
} else {
- IvyDelBindCallback();
+ IvySetBindCallback(NULL, NULL);
fbindcallback=0;
}
} else if (strcmp(cmd, "quit") == 0) {