summaryrefslogtreecommitdiff
path: root/src/ivyprobe.c
diff options
context:
space:
mode:
authorjestin2004-06-25 18:27:39 +0000
committerjestin2004-06-25 18:27:39 +0000
commita1eb3a36064e13c725c6d8f6301b43a431783afd (patch)
tree1fea5158059206014f374ba5a5a439d623a43e65 /src/ivyprobe.c
parentcfc602e2408bf90cce7be62f3f1e940cd5af7172 (diff)
downloadivy-c-a1eb3a36064e13c725c6d8f6301b43a431783afd.zip
ivy-c-a1eb3a36064e13c725c6d8f6301b43a431783afd.tar.gz
ivy-c-a1eb3a36064e13c725c6d8f6301b43a431783afd.tar.bz2
ivy-c-a1eb3a36064e13c725c6d8f6301b43a431783afd.tar.xz
le Makefile peut être utilisé sur Solaris, OSX et Linux. Par dégaut, c'est
pour linux. ivy.c corrige un unbindmsg ivyprobe: -n pour le nom de l'agent, -v pour la version de la lib ivytcl: plein de problèmes réglés, d'autres introduits, notamment pour la gestion de la boucle d'évéenents sous windows ... Test.tcl déplacé dans les exemples
Diffstat (limited to 'src/ivyprobe.c')
-rw-r--r--src/ivyprobe.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/ivyprobe.c b/src/ivyprobe.c
index a5a477b..45fe00a 100644
--- a/src/ivyprobe.c
+++ b/src/ivyprobe.c
@@ -1,19 +1,20 @@
/*
* Ivy probe
*
- * Copyright (C) 1997-2000
+ * Copyright (C) 1997-2004
* Centre d'Études de la Navigation Aérienne
*
* Main and only file
*
* Authors: François-Régis Colin <fcolin@cena.fr>
+ * Yannick Jestin <jestin@cena.fr>
*
- * $Id$
- *
* Please refer to file version.h for the
* copyright notice regarding this software
*/
-
+#define DEFAULT_IVYPROBE_NAME "IVYPROBE"
+#define DEFAULT_READY " Ready"
+#include "version.h"
#define IVYMAINLOOP
@@ -271,7 +272,12 @@ int main(int argc, char *argv[])
int timer_test = 0;
char busbuf [1024] = "";
const char* bus = 0;
- while ((c = getopt(argc, argv, "d:b:w:t")) != EOF)
+ 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";
+ while ((c = getopt(argc, argv, "vn:d:b:w:t")) != EOF)
switch (c) {
case 'b':
strcpy (busbuf, optarg);
@@ -280,10 +286,20 @@ int main(int argc, char *argv[])
case 'w':
wait_count = atoi(optarg) ;
break;
+ case 'n':
+ strcpy(agentnamebuf, optarg);
+ agentname=agentnamebuf;
+ case 'v':
+ printf("ivy c library version %d.%d\n",IVYMAJOR_VERSION,IVYMINOR_VERSION);
+ break;
case 't':
timer_test = 1;
break;
+ default:
+ printf("usage: %s %s",argv[0],helpmsg);
+ exit(1);
}
+ sprintf(agentready,"%s Ready",agentname);
/* Mainloop management */
#ifdef XTMAINLOOP
@@ -297,7 +313,7 @@ int main(int argc, char *argv[])
glClearColor(0.49, 0.62, 0.75, 0.0);
glutDisplayFunc(display);
#endif
- IvyInit ("IVYPROBE", "IVYPROBE READY", ApplicationCallback,NULL,NULL,NULL);
+ IvyInit (agentname, agentready, ApplicationCallback,NULL,NULL,NULL);
IvyBindDirectMsg( DirectCallback,NULL);
for (; optind < argc; optind++)
IvyBindMsg (Callback, NULL, argv[optind]);