diff options
author | fcolin | 2006-04-19 16:53:10 +0000 |
---|---|---|
committer | fcolin | 2006-04-19 16:53:10 +0000 |
commit | 97ba3631720cd0393b547894b7d2fafc5e361a5e (patch) | |
tree | c6a20c267c103f0a944b17eec0518f838f08e076 | |
parent | 5165be98a850bad1c2371f8ae8fa1e4cc8b76a15 (diff) | |
download | ivy-c-97ba3631720cd0393b547894b7d2fafc5e361a5e.zip ivy-c-97ba3631720cd0393b547894b7d2fafc5e361a5e.tar.gz ivy-c-97ba3631720cd0393b547894b7d2fafc5e361a5e.tar.bz2 ivy-c-97ba3631720cd0393b547894b7d2fafc5e361a5e.tar.xz |
correction Filtred Binding + test avec ivyperf
-rw-r--r-- | src/ivy.c | 2 | ||||
-rwxr-xr-x | src/ivyperf.c | 21 |
2 files changed, 21 insertions, 2 deletions
@@ -402,7 +402,7 @@ static void Receive( Client client, void *data, char *line ) #endif //DEBUG if ( application_bind_callback ) { - (*application_bind_callback)( clnt, application_bind_data, id, snd->str_regexp, IvyFilterBind ); + (*application_bind_callback)( clnt, application_bind_data, id, arg, IvyFilterBind ); } return; } diff --git a/src/ivyperf.c b/src/ivyperf.c index 999fb69..283771c 100755 --- a/src/ivyperf.c +++ b/src/ivyperf.c @@ -39,6 +39,8 @@ extern int optind; #include "ivyloop.h" #define MILLISEC 1000.0 +char *mymessages[] = { "ping", "pong" }; + static double currentTime() { double current; @@ -73,7 +75,23 @@ void TimerCall(TimerId id, void *user_data, unsigned long delta) if ( count == 0 ) fprintf(stderr, "." ); } +void binCB( IvyClientPtr app, void *user_data, int id, char* regexp, IvyBindEvent event ) +{ + char *app_name = IvyGetApplicationName( app ); + switch ( event ) + { + case IvyAddBind: + printf("Application:%s bind '%s' ADDED\n", app_name, regexp ); + break; + case IvyRemoveBind: + printf("Application:%s bind '%s' REMOVED\n", app_name, regexp ); + break; + case IvyFilterBind: + printf("Application:%s bind '%s' FILTRED\n", app_name, regexp ); + break; + } +} int main(int argc, char *argv[]) { long time=200; @@ -82,7 +100,8 @@ int main(int argc, char *argv[]) if ( argc > 1 ) time = atol( argv[1] ); IvyInit ("IvyPerf", "IvyPerf ready", NULL,NULL,NULL,NULL); - + IvyClasses( sizeof( mymessages )/ sizeof( char *),mymessages ); + IvySetBindCallback( binCB, 0 ), IvyBindMsg (Reply, NULL, "^ping ts=(.*)"); IvyBindMsg (Pong, NULL, "^pong ts=(.*) tr=(.*)"); |