summaryrefslogtreecommitdiff
path: root/src/ivyperf.c
diff options
context:
space:
mode:
authorfcolin2005-08-10 09:52:18 +0000
committerfcolin2005-08-10 09:52:18 +0000
commitc271c5a2383450c2a39e126ebef38d8dd2e2f8e6 (patch)
tree46eaf3e4a9fc79a47bfd9e8942cef981908f304f /src/ivyperf.c
parentb0954d7461dc709cd1a43097c260c8e8b0183cee (diff)
downloadivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.zip
ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.tar.gz
ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.tar.bz2
ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.tar.xz
remplacement argc argv par IvyArgument
Diffstat (limited to 'src/ivyperf.c')
-rwxr-xr-xsrc/ivyperf.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/ivyperf.c b/src/ivyperf.c
index 11e9522..f0ad069 100755
--- a/src/ivyperf.c
+++ b/src/ivyperf.c
@@ -52,18 +52,33 @@ static double currentTime()
return current;
}
-void Reply (IvyClientPtr app, void *user_data, int argc, char *argv[])
+void Reply (IvyClientPtr app, void *user_data, IvyArgument args)
{
- IvySendMsg ("pong ts=%s tr=%f", *argv, currentTime());
+ IvyArgument arg;
+ int len;
+ void* val;
+ arg = IvyArgumentGetChildrens( args );
+ IvyArgumentGetValue( args , &len, &val);
+ IvySendMsg ("pong ts=%.*s tr=%f", len, val, currentTime());
}
-void Pong (IvyClientPtr app, void *user_data, int argc, char *argv[])
+void Pong (IvyClientPtr app, void *user_data, IvyArgument args)
{
- double current = currentTime();
- double ts = atof( *argv++ );
- double tr = atof( *argv++ );
- double roundtrip1 = tr-ts;
- double roundtrip2 = current - tr;
- double roundtrip3 = current - ts;
+ double current, ts, tr, roundtrip1, roundtrip2, roundtrip3;
+ IvyArgument arg;
+ int len;
+ void* val;
+ /* TODO bug atof non limite a la longeur de la valeur !!!*/
+
+ current = currentTime();
+ arg = IvyArgumentGetChildrens( args );
+ IvyArgumentGetValue( args , &len, &val);
+ ts = atof( val );
+ arg = IvyArgumentGetNextChild( arg );
+ IvyArgumentGetValue( args , &len, &val);
+ tr = atof( val );
+ roundtrip1 = tr-ts;
+ roundtrip2 = current - tr;
+ roundtrip3 = current - ts;
fprintf(stderr,"roundtrip %f %f %f \n", roundtrip1, roundtrip2, roundtrip3 );
}