2 ***********************************************************
3 $SNARK_Header: S N A R K 1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4 $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/recon.c $
5 $LastChangedRevision: 94 $
6 $Date: 2014-07-02 18:53:30 -0400 (Wed, 02 Jul 2014) $
8 ***********************************************************
10 Previously part of :*/
12 /*--------------------------------------------------------------------------
14 Written by Jingsheng Zheng... November 1992
16 Modified by Jolyon Browne... June 1993
17 ----------------------------------------------------------------------------*/
23 #include "experimenter.h"
27 /*--------------------------------------------------------------------------
29 This function echos the information stored in the file specified on
30 line 4 of the SuperSNARK input sequence. This information is sent to the
34 rec_flname - file containing information about the algorithms to be
35 executed. This is the file specified on line 4 of the
36 SuperSNARK input sequence.
37 exp_num - experiment number.
42 ----------------------------------------------------------------------------*/
44 void recon(char* rec_flname, int exp_num, int run_num)
46 char string[MAXLINESIZE];
49 if ((recfl = fopen(rec_flname, "r")) == NULL)
51 errorc("error in opening file", rec_flname);
54 while ((fgets(string, sizeof(string), recfl)) != NULL)
56 while (isSkip(string)) //it's a comment line,
57 { //echo it to output and read next line
58 if (isComment(string))
59 fprintf(pstream, "%s", string);
60 if (fgets(string, sizeof(string), recfl) == NULL)
63 if (strncasecmp(string, "exec", 4) == 0)
65 fprintf(pstream, "%s", string);
66 if ((fgets(string, sizeof(string), recfl)) != NULL)
68 while (isSkip(string)) //it's a comment line,
69 { //echo it to output and read next line
70 if (isComment(string))
71 fprintf(pstream, "%s", string);
72 if (fgets(string, sizeof(string), recfl) == NULL)
75 string[strlen(string) - 1] = '\0';
77 fprintf(pstream, "%s experiment= %d run= %d\n", string, exp_num, run_num);
81 fprintf(pstream, "%s", string);