From a1eb3a36064e13c725c6d8f6301b43a431783afd Mon Sep 17 00:00:00 2001 From: jestin Date: Fri, 25 Jun 2004 18:27:39 +0000 Subject: 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 --- src/ivyprobe.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/ivyprobe.c') 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 + * Yannick Jestin * - * $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]); -- cgit v1.1