--- imach/src/imach.c 2015/08/18 13:32:00 1.194 +++ imach/src/imach.c 2015/08/18 23:17:52 1.196 @@ -1,6 +1,17 @@ -/* $Id: imach.c,v 1.194 2015/08/18 13:32:00 brouard Exp $ +/* $Id: imach.c,v 1.196 2015/08/18 23:17:52 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.196 2015/08/18 23:17:52 brouard + Summary: 0.98q5 + + Revision 1.195 2015/08/18 16:28:39 brouard + Summary: Adding a hack for testing purpose + + After reading the title, ftol and model lines, if the comment line has + a q, starting with #q, the answer at the end of the run is quit. It + permits to run test files in batch with ctest. The former workaround was + $ echo q | imach foo.imach + Revision 1.194 2015/08/18 13:32:00 brouard Summary: Adding error when the covariance matrix doesn't contain the exact number of lines required by the model line. @@ -700,11 +711,12 @@ typedef struct { #define ODIRSEPARATOR '\\' #endif -/* $Id: imach.c,v 1.194 2015/08/18 13:32:00 brouard Exp $ */ +/* $Id: imach.c,v 1.196 2015/08/18 23:17:52 brouard Exp $ */ /* $State: Exp $ */ - -char version[]="Imach version 0.98q5, August 2015,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015"; -char fullversion[]="$Revision: 1.194 $ $Date: 2015/08/18 13:32:00 $"; +#include "version.h" +char version[]=__IMACH_VERSION__; +char copyright[]="August 2015,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015"; +char fullversion[]="$Revision: 1.196 $ $Date: 2015/08/18 23:17:52 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -2898,7 +2910,7 @@ void lubksb(double **a, int n, int *indx void pstamp(FILE *fichier) { - fprintf(fichier,"# %s.%s\n#%s\n#%s\n# %s", optionfilefiname,optionfilext,version,fullversion,strstart); + fprintf(fichier,"# %s.%s\n#IMaCh version %s, %s\n#%s\n# %s", optionfilefiname,optionfilext,version,copyright, fullversion, strstart); } /************ Frequencies ********************/ @@ -5440,8 +5452,8 @@ int readdata(char datafile[], int firsto if((fic=fopen(datafile,"r"))==NULL) { - printf("Problem while opening datafile: %s\n", datafile);return 1; - fprintf(ficlog,"Problem while opening datafile: %s\n", datafile);return 1; + printf("Problem while opening datafile: %s\n", datafile);fflush(stdout); + fprintf(ficlog,"Problem while opening datafile: %s\n", datafile);fflush(ficlog);return 1; } i=1; @@ -6289,7 +6301,7 @@ int main(int argc, char *argv[]) char pathr[MAXLINE], pathimach[MAXLINE]; char *tok, *val; /* pathtot */ int firstobs=1, lastobs=10; - int c, h , cpt; + int c, h , cpt, c2; int jl=0; int i1, j1, jk, stepsize=0; int count=0; @@ -6365,7 +6377,7 @@ int main(int argc, char *argv[]) getcwd(pathcd, size); #endif syscompilerinfo(0); - printf("\n%s\n%s",version,fullversion); + printf("\nIMaCh version %s, %s\n%s",version, copyright, fullversion); if(argc <=1){ printf("\nEnter the parameter file name: "); fgets(pathr,FILENAMELENGTH,stdin); @@ -6505,6 +6517,10 @@ int main(int argc, char *argv[]) ungetc(c,ficpar); fgets(line, MAXLINE, ficpar); numlinepar++; + if(line[1]=='q'){ /* This #q will quit imach (the answer is q) */ + z[0]=line[1]; + } + /* printf("****line [1] = %c \n",line[1]); */ fputs(line, stdout); //puts(line); fputs(line,ficparo); @@ -7849,7 +7865,7 @@ Please run with mle=-1 to get a correct } end: while (z[0] != 'q') { - printf("\nType q for exiting: "); + printf("\nType q for exiting: "); fflush(stdout); scanf("%s",z); } }