From 6bf117656574521545694a1a4e5169755077631e Mon Sep 17 00:00:00 2001 From: fcolin Date: Wed, 19 Apr 2006 08:28:14 +0000 Subject: correction de probleme potentiel en multithread ( Ada rejeu ) ajout d'un warning en cas de client bloquant si la varaiable d'env IVY_DEBUG_SEND est positionne --- src/ivyprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ivyprobe.c') diff --git a/src/ivyprobe.c b/src/ivyprobe.c index 10a3b00..4bcc167 100644 --- a/src/ivyprobe.c +++ b/src/ivyprobe.c @@ -398,7 +398,7 @@ int main(int argc, char *argv[]) #endif #ifdef IVYMAINLOOP - IvyMainLoop (0); + IvyMainLoop (0,0); #endif return 0; } -- cgit v1.1 From 32ad3909b0de5402cf92dba6aa196d1608af0e65 Mon Sep 17 00:00:00 2001 From: fcolin Date: Wed, 19 Apr 2006 10:07:24 +0000 Subject: add doc printf for commande bincall in ivyprobe --- src/ivyprobe.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ivyprobe.c') diff --git a/src/ivyprobe.c b/src/ivyprobe.c index 4bcc167..6c3313b 100644 --- a/src/ivyprobe.c +++ b/src/ivyprobe.c @@ -222,6 +222,8 @@ void HandleStdin (Channel channel, HANDLE fd, void *data) 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 - show binds \n"); + printf(" .who - who is on the bus\n"); } else if (strcmp(cmd, "bindcall") == 0) { if (!fbindcallback) { -- cgit v1.1 From d20808b04feb328272a35ee2b03f4ae19db23fbe Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 20 Apr 2006 15:51:37 +0000 Subject: cleanup DEBUG code --- src/ivyprobe.c | 64 +++++++++++++++++++++++++--------------------------------- 1 file changed, 27 insertions(+), 37 deletions(-) (limited to 'src/ivyprobe.c') diff --git a/src/ivyprobe.c b/src/ivyprobe.c index 6c3313b..10d0667 100644 --- a/src/ivyprobe.c +++ b/src/ivyprobe.c @@ -45,11 +45,11 @@ extern char *optarg; extern int optind; #endif -#ifndef USE_PCRE_REGEX -#include -#else +#ifdef USE_PCRE_REGEX #define OVECSIZE 60 /* must be multiple of 3, for regexp return */ #include +#else +#include #endif @@ -79,22 +79,12 @@ 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 ) { - 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); -} void Callback (IvyClientPtr app, void *user_data, int argc, char *argv[]) { @@ -153,8 +143,8 @@ void HandleStdin (Channel channel, HANDLE fd, void *data) } } else if (strcmp(cmd, "dieall-yes-i-am-sure") == 0) { - arg = IvyGetApplicationList(); - arg = strtok (arg, " \n"); + arg = IvyGetApplicationList("#"); + arg = strtok (arg, "#"); while (arg) { app = IvyGetApplication (arg); if (app) @@ -167,15 +157,7 @@ void HandleStdin (Channel channel, HANDLE fd, void *data) } else if (strcmp(cmd, "bind") == 0) { arg = strtok (NULL, "'"); if (arg) { -#ifndef USE_PCRE_REGEX - regex_t reg; - int err; - Chop(arg); - if (err=regcomp(®,arg,REG_ICASE|REG_EXTENDED)!=0) { - char errbuf[4096]; - regerror (err, ®, errbuf, 4096); - printf("Error compiling '%s', %s, not bound\n", arg, errbuf); -#else +#ifdef USE_PCRE_REGEX pcre *regexp; const char *errbuf; int erroffset; @@ -183,6 +165,14 @@ void HandleStdin (Channel channel, HANDLE fd, void *data) regexp = pcre_compile(arg, 0,&errbuf,&erroffset,NULL); if (regexp==NULL) { printf("Error compiling '%s', %s, not bound\n", arg, errbuf); +#else + regex_t reg; + int err; + Chop(arg); + if (err=regcomp(®,arg,REG_ICASE|REG_EXTENDED)!=0) { + char errbuf[4096]; + regerror (err, ®, errbuf, 4096); + printf("Error compiling '%s', %s, not bound\n", arg, errbuf); #endif } else { IvyBindMsg (Callback, NULL, Chop(arg)); @@ -211,26 +201,26 @@ void HandleStdin (Channel channel, HANDLE fd, void *data) } } else if (strcmp(cmd, "who") == 0) { - printf("Apps: %s\n", IvyGetApplicationList()); + printf("Apps: %s\n", IvyGetApplicationList(",")); } 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(" .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 - show binds \n"); + printf(" .where appname - on which host is appname\n"); + printf(" .bind 'regexp' - add a msg to receive\n"); + printf(" .showbind - show bindings \n"); printf(" .who - who is on the bus\n"); - } else if (strcmp(cmd, "bindcall") == 0) { + } else if (strcmp(cmd, "showbind") == 0) { if (!fbindcallback) { - IvySetBindCallback(BindCallback, NULL); + IvySetBindCallback(IvyDefaultBindCallback, NULL); fbindcallback=1; } else { - IvyDelBindCallback(); + IvySetBindCallback(NULL, NULL); fbindcallback=0; } } else if (strcmp(cmd, "quit") == 0) { @@ -334,7 +324,7 @@ int main(int argc, char *argv[]) timer_test = 1; break; case 's': - IvySetBindCallback(BindCallback, NULL); + IvySetBindCallback(IvyDefaultBindCallback, NULL); fbindcallback=1; break; default: -- cgit v1.1 From 2cf893c0c34d50a68a27e1704b38f2facc10c9bc Mon Sep 17 00:00:00 2001 From: fcolin Date: Fri, 21 Apr 2006 15:51:55 +0000 Subject: suppression de l'indirection sur les fonction channel et renomage ! --- src/ivyprobe.c | 76 +++++++++++++--------------------------------------------- 1 file changed, 17 insertions(+), 59 deletions(-) (limited to 'src/ivyprobe.c') diff --git a/src/ivyprobe.c b/src/ivyprobe.c index 10d0667..58f55e3 100644 --- a/src/ivyprobe.c +++ b/src/ivyprobe.c @@ -34,6 +34,7 @@ #include #ifdef WIN32 #include +#include "getopt.h" #ifdef __MINGW32__ #include #include @@ -45,13 +46,6 @@ extern char *optarg; extern int optind; #endif -#ifdef USE_PCRE_REGEX -#define OVECSIZE 60 /* must be multiple of 3, for regexp return */ -#include -#else -#include -#endif - #endif #ifdef XTMAINLOOP @@ -68,6 +62,8 @@ extern int optind; #include "ivyloop.h" #endif #include "ivysocket.h" +#include "ivychannel.h" +#include "ivybind.h" /* to test regexp before passing to BinMsg */ #include "ivy.h" #include "timer.h" #ifdef XTMAINLOOP @@ -97,7 +93,7 @@ void Callback (IvyClientPtr app, void *user_data, int argc, char *argv[]) char * Chop(char *arg) { - int len; + size_t len; if (arg==NULL) return arg; len=strlen(arg)-1; if ((*(arg+len))=='\n') *(arg+len)=0; @@ -115,19 +111,9 @@ void HandleStdin (Channel channel, HANDLE fd, void *data) int err; line = fgets(buf, 4096, stdin); if (!line) { -#ifdef XTMAINLOOP - IvyXtChannelClose (channel); -#endif -#ifdef GLIBMAINLOOP - IvyGlibChannelClose(channel); -#endif -#ifdef GLUTMAINLOOP - IvyGlutChannelClose(channel); -#endif -#ifdef IVYMAINLOOP - IvyChannelClose (channel); + + IvyChannelRemove (channel); IvyStop(); -#endif return; } if (*line == '.') { @@ -156,26 +142,17 @@ void HandleStdin (Channel channel, HANDLE fd, void *data) } else if (strcmp(cmd, "bind") == 0) { arg = strtok (NULL, "'"); + Chop(arg); if (arg) { -#ifdef USE_PCRE_REGEX - pcre *regexp; + IvyBinding bind; const char *errbuf; int erroffset; - Chop(arg); - regexp = pcre_compile(arg, 0,&errbuf,&erroffset,NULL); - if (regexp==NULL) { - printf("Error compiling '%s', %s, not bound\n", arg, errbuf); -#else - regex_t reg; - int err; - Chop(arg); - if (err=regcomp(®,arg,REG_ICASE|REG_EXTENDED)!=0) { - char errbuf[4096]; - regerror (err, ®, errbuf, 4096); - printf("Error compiling '%s', %s, not bound\n", arg, errbuf); -#endif + bind = IvyBindingCompile(arg, & erroffset, & errbuf); + if (bind==NULL) { + printf("Error compiling '%s', %s, not bound\n", arg, errbuf); } else { - IvyBindMsg (Callback, NULL, Chop(arg)); + IvyBindingFree( bind ); + IvyBindMsg (Callback, NULL, arg); } } @@ -250,18 +227,10 @@ void ApplicationCallback (IvyClientPtr app, void *user_data, IvyApplicationEvent while (*msgList ) printf("%s subscribes to '%s'\n",appname,*msgList++); /* printf("Application(%s): End Messages\n",appname);*/ +#ifndef WIN32 +/* Stdin not compatible with select , select only accept socket */ if (app_count == wait_count) -#ifdef XTMAINLOOP - IvyXtChannelSetUp (0, NULL, NULL, HandleStdin); -#endif -#ifdef GLIBMAINLLOP - IvyGlibChannelSetUp( 0, NULL, NULL, HandleStdin); -#endif -#ifdef GLUTMAINLLOP - IvyGlutChannelSetUp( 0, NULL, NULL, HandleStdin); -#endif -#ifdef IVYMAINLOOP - IvyChannelSetUp (0, NULL, NULL, HandleStdin); + IvyChannelSetUp (0, NULL, NULL, HandleStdin); #endif break; @@ -277,7 +246,7 @@ void ApplicationCallback (IvyClientPtr app, void *user_data, IvyApplicationEvent } -#ifndef XTMAINLOOP +#ifdef IVYMAINLOOP void TimerCall(TimerId id, void *user_data, unsigned long delta) { printf("Timer callback: %d delta %lu ms\n", (int)user_data, delta); @@ -351,21 +320,10 @@ int main(int argc, char *argv[]) IvyBindMsg (Callback, NULL, argv[optind]); if (wait_count == 0) -#ifdef XTMAINLOOP - IvyXtChannelSetUp (0, NULL, NULL, HandleStdin); -#endif -#ifdef GLIBMAINLOOP - IvyGlibChannelSetUp (0, NULL, NULL, HandleStdin); -#endif -#ifdef GLUTMAINLOOP - IvyGlutChannelSetUp (0, NULL, NULL, HandleStdin); -#endif -#ifdef IVYMAINLOOP #ifndef WIN32 /* Stdin not compatible with select , select only accept socket */ IvyChannelSetUp (0, NULL, NULL, HandleStdin); #endif -#endif IvyStart (bus); -- cgit v1.1 From 1e48ff652b95379376044b0a7187e1c75fb76d42 Mon Sep 17 00:00:00 2001 From: fcolin Date: Fri, 21 Apr 2006 16:34:15 +0000 Subject: cleanup sur channel et main loop --- src/ivyprobe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ivyprobe.c') diff --git a/src/ivyprobe.c b/src/ivyprobe.c index 58f55e3..0ef674a 100644 --- a/src/ivyprobe.c +++ b/src/ivyprobe.c @@ -230,7 +230,7 @@ void ApplicationCallback (IvyClientPtr app, void *user_data, IvyApplicationEvent #ifndef WIN32 /* Stdin not compatible with select , select only accept socket */ if (app_count == wait_count) - IvyChannelSetUp (0, NULL, NULL, HandleStdin); + IvyChannelAdd (0, NULL, NULL, HandleStdin); #endif break; @@ -322,7 +322,7 @@ int main(int argc, char *argv[]) if (wait_count == 0) #ifndef WIN32 /* Stdin not compatible with select , select only accept socket */ - IvyChannelSetUp (0, NULL, NULL, HandleStdin); + IvyChannelAdd (0, NULL, NULL, HandleStdin); #endif IvyStart (bus); -- cgit v1.1 From 4cdbde3775be5c961d11bb5497d1c97e07c429b2 Mon Sep 17 00:00:00 2001 From: fcolin Date: Fri, 16 Jun 2006 14:36:22 +0000 Subject: correction d'un BUG dans IvyGetMessages ( si nb > 200 ) ajout d'un argument -f a ivyprobe pour passer des regexps dans un fichier --- src/ivyprobe.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/ivyprobe.c') diff --git a/src/ivyprobe.c b/src/ivyprobe.c index 0ef674a..40790f6 100644 --- a/src/ivyprobe.c +++ b/src/ivyprobe.c @@ -263,18 +263,43 @@ display(void) } #endif +void BindMsgOfFile( const char * regex_file ) +{ + char line[4096]; + size_t size; + FILE* file; + file = fopen( regex_file, "r" ); + if ( !file ) { + perror( "Regexp file open "); + return; + } + while( !feof( file ) ) + { + if ( fgets( line, sizeof(line), file ) ) + { + size = strlen(line); + if ( size > 1 ) + { + line[size-1] = '\0'; /* supress \n */ + IvyBindMsg (Callback, NULL, line); + } + } + } +} + int main(int argc, char *argv[]) { int c; int timer_test = 0; char busbuf [1024] = ""; const char* bus = 0; + const char* regex_file = 0; char agentnamebuf [1024] = ""; const char* agentname = DEFAULT_IVYPROBE_NAME; char agentready [1024] = ""; const char* helpmsg = "[options] [regexps]\n\t-b bus\tdefines the Ivy bus to which to connect to, defaults to 127:2010\n\t-t\ttriggers the timer test\n\t-n name\tchanges the name of the agent, defaults to IVYPROBE\n\t-v\tprints the ivy relase number\n\nregexp is a Perl5 compatible regular expression (see ivyprobe(1) and pcrepattern(3) for more info\nuse .help within ivyprobe\n\t-s bindcall\tactive the interception of regexp's subscribing or unscribing\n"; - while ((c = getopt(argc, argv, "vn:d:b:w:t:s")) != EOF) + while ((c = getopt(argc, argv, "vn:d:b:w:t:sf:")) != EOF) switch (c) { case 'b': strcpy (busbuf, optarg); @@ -283,6 +308,9 @@ int main(int argc, char *argv[]) case 'w': wait_count = atoi(optarg) ; break; + case 'f': + regex_file = optarg ; + break; case 'n': strcpy(agentnamebuf, optarg); agentname=agentnamebuf; @@ -316,6 +344,8 @@ int main(int argc, char *argv[]) #endif IvyInit (agentname, agentready, ApplicationCallback,NULL,NULL,NULL); IvyBindDirectMsg( DirectCallback,NULL); + if ( regex_file ) + BindMsgOfFile( regex_file ); for (; optind < argc; optind++) IvyBindMsg (Callback, NULL, argv[optind]); -- cgit v1.1 From 19735bb3c818f78d5ce53d1482b0bd62f63d76e8 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 22 Jun 2006 10:47:46 +0000 Subject: Ajout d'un warning si la variable IVY_DEBUG_FILTER est postionne et que le message n'est pas emit , on controle la table des filtres ajout d'un flag -c a ivyprobe pour la gestion des filtres de regexps --- src/ivyprobe.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 4 deletions(-) (limited to 'src/ivyprobe.c') diff --git a/src/ivyprobe.c b/src/ivyprobe.c index 40790f6..536447e 100644 --- a/src/ivyprobe.c +++ b/src/ivyprobe.c @@ -74,6 +74,9 @@ XtAppContext cntx; int app_count = 0; int wait_count = 0; int fbindcallback = 0; +int filter_count = 0; +const char *filter[4096]; +char *classes; void DirectCallback(IvyClientPtr app, void *user_data, int id, char *msg ) { @@ -223,9 +226,11 @@ void ApplicationCallback (IvyClientPtr app, void *user_data, IvyApplicationEvent app_count++; printf("%s connected from %s\n", appname, host); /* printf("Application(%s): Begin Messages\n", appname);*/ +/* double usage with -s flag remove it msgList = IvyGetApplicationMessages (app); while (*msgList ) printf("%s subscribes to '%s'\n",appname,*msgList++); +*/ /* printf("Application(%s): End Messages\n",appname);*/ #ifndef WIN32 /* Stdin not compatible with select , select only accept socket */ @@ -244,6 +249,28 @@ void ApplicationCallback (IvyClientPtr app, void *user_data, IvyApplicationEvent break; } } +void IvyPrintBindCallback( IvyClientPtr app, void *user_data, int id, char* regexp, IvyBindEvent event) +{ + switch ( event ) { + case IvyAddBind: + if ( fbindcallback ) + printf("Application: %s on %s add regexp %d : %s\n", + IvyGetApplicationName( app ), IvyGetApplicationHost(app), id, regexp); + break; + case IvyRemoveBind: + if ( fbindcallback ) + printf("Application: %s on %s remove regexp %d :%s\n", + IvyGetApplicationName( app ), IvyGetApplicationHost(app), id, regexp); + break; + case IvyFilterBind: + printf("Application: %s on %s as been filtred regexp %d :%s\n", + IvyGetApplicationName( app ), IvyGetApplicationHost(app), id, regexp); + break; + default: + printf("Application: %s unkown event %d\n",IvyGetApplicationName( app ), event); + break; + } +} #ifdef IVYMAINLOOP @@ -286,7 +313,17 @@ void BindMsgOfFile( const char * regex_file ) } } } - +void BuildFilterRegexp() +{ + char *word=strtok( classes, "," ); + while ( word != NULL && (filter_count < 4096 )) + { + filter[filter_count++] = word; + word = strtok( NULL, ","); + } + if ( filter_count ) + IvySetFilter( filter_count, filter ); +} int main(int argc, char *argv[]) { int c; @@ -298,8 +335,17 @@ int main(int argc, char *argv[]) const char* agentname = DEFAULT_IVYPROBE_NAME; char agentready [1024] = ""; const char* helpmsg = - "[options] [regexps]\n\t-b bus\tdefines the Ivy bus to which to connect to, defaults to 127:2010\n\t-t\ttriggers the timer test\n\t-n name\tchanges the name of the agent, defaults to IVYPROBE\n\t-v\tprints the ivy relase number\n\nregexp is a Perl5 compatible regular expression (see ivyprobe(1) and pcrepattern(3) for more info\nuse .help within ivyprobe\n\t-s bindcall\tactive the interception of regexp's subscribing or unscribing\n"; - while ((c = getopt(argc, argv, "vn:d:b:w:t:sf:")) != EOF) + "[options] [regexps]\n\t-b bus\tdefines the Ivy bus to which to connect to, defaults to 127:2010\n" + "\t-t\ttriggers the timer test\n" + "\t-n name\tchanges the name of the agent, defaults to IVYPROBE\n" + "\t-v\tprints the ivy relase number\n\n" + "regexp is a Perl5 compatible regular expression (see ivyprobe(1) and pcrepattern(3) for more info\n" + "use .help within ivyprobe\n" + "\t-s bindcall\tactive the interception of regexp's subscribing or unscribing\n" + "\t-f regexfile\tread list of regexp's from file one by line\n" + "\t-c msg1,msg2,msg3,...\tfilter the regexp's not beginning with words\n" + ; + while ((c = getopt(argc, argv, "vn:d:b:w:t:sf:c:")) != EOF) switch (c) { case 'b': strcpy (busbuf, optarg); @@ -321,9 +367,11 @@ int main(int argc, char *argv[]) timer_test = 1; break; case 's': - IvySetBindCallback(IvyDefaultBindCallback, NULL); fbindcallback=1; break; + case 'c': + classes= strdup(optarg); + break; default: printf("usage: %s %s",argv[0],helpmsg); exit(1); @@ -343,7 +391,11 @@ int main(int argc, char *argv[]) glutDisplayFunc(display); #endif IvyInit (agentname, agentready, ApplicationCallback,NULL,NULL,NULL); + IvySetBindCallback(IvyPrintBindCallback, NULL); + IvyBindDirectMsg( DirectCallback,NULL); + if ( classes ) + BuildFilterRegexp(); if ( regex_file ) BindMsgOfFile( regex_file ); for (; optind < argc; optind++) -- cgit v1.1 From 53f1cd3c774bc45c09a1fe90f9d27a5c5feee785 Mon Sep 17 00:00:00 2001 From: fcolin Date: Wed, 28 Jun 2006 09:05:30 +0000 Subject: Modification API Hook sur IvyMainLoop --- src/ivyprobe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ivyprobe.c') diff --git a/src/ivyprobe.c b/src/ivyprobe.c index 536447e..bdf3b9a 100644 --- a/src/ivyprobe.c +++ b/src/ivyprobe.c @@ -217,7 +217,7 @@ void ApplicationCallback (IvyClientPtr app, void *user_data, IvyApplicationEvent { char *appname; char *host; - char **msgList; +/* char **msgList;*/ appname = IvyGetApplicationName (app); host = IvyGetApplicationHost (app); switch (event) { @@ -430,7 +430,7 @@ int main(int argc, char *argv[]) #endif #ifdef IVYMAINLOOP - IvyMainLoop (0,0); + IvyMainLoop (); #endif return 0; } -- cgit v1.1 From e761e4e47ad5da0036d4fec4e70319afacd10fd6 Mon Sep 17 00:00:00 2001 From: bustico Date: Fri, 22 Sep 2006 09:41:53 +0000 Subject: ajout du message IvyChangeMessage pour changer la regexp d'un abonnement déjà établi --- src/ivyprobe.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/ivyprobe.c') diff --git a/src/ivyprobe.c b/src/ivyprobe.c index bdf3b9a..b6d9607 100644 --- a/src/ivyprobe.c +++ b/src/ivyprobe.c @@ -266,6 +266,11 @@ void IvyPrintBindCallback( IvyClientPtr app, void *user_data, int id, char* rege printf("Application: %s on %s as been filtred regexp %d :%s\n", IvyGetApplicationName( app ), IvyGetApplicationHost(app), id, regexp); break; + case IvyChangeBind: + if ( fbindcallback ) + printf("Application: %s on %s change regexp %d : %s\n", + IvyGetApplicationName( app ), IvyGetApplicationHost(app), id, regexp); + break; default: printf("Application: %s unkown event %d\n",IvyGetApplicationName( app ), event); break; @@ -276,8 +281,8 @@ void IvyPrintBindCallback( IvyClientPtr app, void *user_data, int id, char* rege #ifdef IVYMAINLOOP void TimerCall(TimerId id, void *user_data, unsigned long delta) { - printf("Timer callback: %d delta %lu ms\n", (int)user_data, delta); - IvySendMsg ("TEST TIMER %d", (int)user_data); + printf("Timer callback: %ld delta %lu ms\n", (long)user_data, delta); + IvySendMsg ("TEST TIMER %d", (long)user_data); /*if ((int)user_data == 5) TimerModify (id, 2000);*/ } #endif @@ -434,3 +439,4 @@ int main(int argc, char *argv[]) #endif return 0; } + -- cgit v1.1