--- imach/src/imach.c 2006/01/19 16:20:37 1.107 +++ imach/src/imach.c 2006/01/19 18:05:42 1.108 @@ -1,6 +1,10 @@ -/* $Id: imach.c,v 1.107 2006/01/19 16:20:37 brouard Exp $ +/* $Id: imach.c,v 1.108 2006/01/19 18:05:42 lievre Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.108 2006/01/19 18:05:42 lievre + Gnuplot problem appeared... + To be fixed + Revision 1.107 2006/01/19 16:20:37 brouard Test existence of gnuplot in imach path @@ -243,11 +247,11 @@ extern int errno; /* #define _(String) gettext (String) */ #define MAXLINE 256 + #define GNUPLOTPROGRAM "gnuplot" /*#define GNUPLOTPROGRAM "..\\gp37mgw\\wgnuplot"*/ #define FILENAMELENGTH 132 -/*#define DEBUG*/ -/*#define windows*/ + #define GLOCK_ERROR_NOPATH -1 /* empty path */ #define GLOCK_ERROR_GETCWD -2 /* cannot get cwd */ @@ -273,11 +277,11 @@ extern int errno; #define ODIRSEPARATOR '/' #endif -/* $Id: imach.c,v 1.107 2006/01/19 16:20:37 brouard Exp $ */ +/* $Id: imach.c,v 1.108 2006/01/19 18:05:42 lievre Exp $ */ /* $State: Exp $ */ char version[]="Imach version 0.98a, January 2006, INED-EUROREVES "; -char fullversion[]="$Revision: 1.107 $ $Date: 2006/01/19 16:20:37 $"; +char fullversion[]="$Revision: 1.108 $ $Date: 2006/01/19 18:05:42 $"; int erreur, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ int nvar; int cptcovn=0, cptcovage=0, cptcoveff=0,cptcov; @@ -4664,8 +4668,7 @@ int main(int argc, char *argv[]) } } else if(s[m][i] !=9){ /* Standard case, age in fractional - years but with the precision of a - month */ + years but with the precision of a month */ agev[m][i]=(mint[m][i]/12.+1./24.+anint[m][i])-(moisnais[i]/12.+1./24.+annais[i]); if((int)mint[m][i]==99 || (int)anint[m][i]==9999) agev[m][i]=1; @@ -5550,23 +5553,34 @@ lsurv=vector(1,AGESUP); chdir(path); #ifndef UNIX - strcpy(plotcmd,"\""); + /* strcpy(plotcmd,"\""); */ #endif - strcat(plotcmd,pathimach); + strcpy(plotcmd,pathimach); /*strcat(plotcmd,CHARSEPARATOR);*/ strcat(plotcmd,GNUPLOTPROGRAM); #ifndef UNIX - strcat(plotcmd,"\""); + strcat(plotcmd,".exe"); + /* strcat(plotcmd,"\"");*/ #endif if(stat(plotcmd,&info)){ printf("Error gnuplot program not found: %s\n",plotcmd);fflush(stdout); } + +#ifndef UNIX + strcpy(plotcmd,"\""); +#endif + strcat(plotcmd,pathimach); + strcat(plotcmd,GNUPLOTPROGRAM); +#ifndef UNIX + strcat(plotcmd,".exe"); + strcat(plotcmd,"\""); +#endif strcat(plotcmd," "); strcat(plotcmd,optionfilegnuplot); printf("Starting graphs with: %s",plotcmd);fflush(stdout); if((outcmd=system(plotcmd)) != 0){ - printf(" Problem with gnuplot\n"); + printf("\n Problem with gnuplot\n"); } printf(" Wait..."); while (z[0] != 'q') {