From 912a8f45cbe9300b7425702f85bb0af6b3026d2a Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 14 Nov 2008 16:31:01 +0000 Subject: Strip command line input functions git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@37 0d43b9a7-5ab2-4d7b-af9d-f64450cef757 --- cleanbench.c | 393 ----------------------------------------------------------- cleanbench.h | 10 -- 2 files changed, 403 deletions(-) diff --git a/cleanbench.c b/cleanbench.c index cf627e7..3a9a6a0 100644 --- a/cleanbench.c +++ b/cleanbench.c @@ -122,18 +122,6 @@ global_nnetstruct.adjust=0; global_lustruct.adjust=0; -/* -** Handle any command-line arguments. -*/ -if(argc>1) - for(i=1;i]\n",progname); - printf(" -v = verbose\n"); - printf(" -c = input parameters thru command file \n"); - exit(0); -} - - -/***************** -** read_comfile ** -****************** -** Read the command file. Set global parameters as -** specified. This routine assumes that the command file -** is already open. -*/ -static void read_comfile(FILE *cfile) -{ -char inbuf[40]; -char *eptr; /* Offset to "=" sign */ -int i; /* Index */ - -/* -** Sit in a big loop, reading a line from the file at each -** pass. Terminate on EOF. -*/ -while(fgets(inbuf,39,cfile)!=(char *)NULL) -{ - /* Overwrite the CR character */ - if(strlen(inbuf)>0) - inbuf[strlen(inbuf)-1]='\0'; - - /* - ** Parse up to the "=" sign. If we don't find an - ** "=", then flag an error. - */ - if((eptr=strchr(inbuf,(int)'='))==(char *)NULL) - { printf("**COMMAND FILE ERROR at LINE:\n %s\n", - inbuf); - goto skipswitch; /* A GOTO!!!! */ - } - - /* - ** Insert a null where the "=" was, then convert - ** the substring to uppercase. That will enable - ** us to perform the match. - */ - *eptr++='\0'; - strtoupper((char *)&inbuf[0]); - i=MAXPARAM; - do { - if(strcmp(inbuf,paramnames[i])==0) - break; - } while(--i>=0); - - if(i<0) - { printf("**COMMAND FILE ERROR -- UNKNOWN PARAM: %s", - inbuf); - goto skipswitch; - } - - /* - ** Advance eptr to the next field...which should be - ** the value assigned to the parameter. - */ - switch(i) - { - case PF_GMTICKS: /* GLOBALMINTICKS */ - global_min_ticks=(unsigned long)atol(eptr); - break; - - case PF_MINSECONDS: /* MINSECONDS */ - global_min_seconds=(unsigned long)atol(eptr); - set_request_secs(); - break; - - case PF_ALLSTATS: /* ALLSTATS */ - global_allstats=getflag(eptr); - break; - - case PF_OUTFILE: /* OUTFILE */ - strcpy(global_ofile_name,eptr); - global_ofile=fopen(global_ofile_name,"a"); - /* - ** Open the output file. - */ - if(global_ofile==(FILE *)NULL) - { printf("**Error opening output file: %s\n", - global_ofile_name); - exit(1); - } - write_to_file=-1; - break; - - case PF_CUSTOMRUN: /* CUSTOMRUN */ - global_custrun=getflag(eptr); - for(i=0;i