From cfc602e2408bf90cce7be62f3f1e940cd5af7172 Mon Sep 17 00:00:00 2001 From: jestin Date: Fri, 25 Jun 2004 18:26:19 +0000 Subject: j'ajoute des exemples de code dans le CVS. il faudra les intégrer à la doc... --- examples/testUnbind.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/testUnbind.c (limited to 'examples/testUnbind.c') 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 + * + * Please refer to file ../src/version.h for the + * copyright notice regarding this software + */ + +#include +#include +#include +#include +#include +#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; +} -- cgit v1.1