diff options
author | jestin | 2004-06-25 18:26:19 +0000 |
---|---|---|
committer | jestin | 2004-06-25 18:26:19 +0000 |
commit | cfc602e2408bf90cce7be62f3f1e940cd5af7172 (patch) | |
tree | f3b3078f308ff676acfee099aa3c0a4268e15b9a /examples/testUnbind.c | |
parent | 43eaf35871578ea498e20ed4f945cce14f8f3032 (diff) | |
download | ivy-c-cfc602e2408bf90cce7be62f3f1e940cd5af7172.zip ivy-c-cfc602e2408bf90cce7be62f3f1e940cd5af7172.tar.gz ivy-c-cfc602e2408bf90cce7be62f3f1e940cd5af7172.tar.bz2 ivy-c-cfc602e2408bf90cce7be62f3f1e940cd5af7172.tar.xz |
j'ajoute des exemples de code dans le CVS. il faudra les intégrer à la doc...
Diffstat (limited to 'examples/testUnbind.c')
-rw-r--r-- | examples/testUnbind.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/testUnbind.c b/examples/testUnbind.c new file mode 100644 index 0000000..16a4a8a --- /dev/null +++ b/examples/testUnbind.c @@ -0,0 +1,35 @@ +/* + * Ivy unbind Test + * + * Copyright (C) 1997-2004 + * Centre d'Études de la Navigation Aérienne + * + * Authors: Yannick Jestin <jestin@cena.fr> + * + * Please refer to file ../src/version.h for the + * copyright notice regarding this software + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ivyloop.h> +#include <ivy.h> +#define REGEXP "^ub" + +void Callback (IvyClientPtr app, void *user_data, int argc, char *argv[]) { + MsgRcvPtr *ptr = (MsgRcvPtr *) user_data; + printf ("%s sent unbind message, unbinding to %s\n", + IvyGetApplicationName(app),REGEXP); + IvyUnbindMsg(*ptr); +} + +int main(int argc, char *argv[]) { + MsgRcvPtr ptr; + IvyInit("TestUnbind","TestUnbind Ready",NULL,NULL,NULL,NULL); + ptr=IvyBindMsg(Callback,&ptr,REGEXP); + printf("bound to %s\n",REGEXP); + IvyStart(NULL); + IvyMainLoop(0); + return 0; +} |