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/getnxt.cpp $
5 $LastChangedRevision: 80 $
6 $Date: 2014-07-01 21:01:54 -0400 (Tue, 01 Jul 2014) $
8 ***********************************************************
10 GETNXT READS THE NEXT CARD FROM 'FILE' INTO THE ARRAY 'DATA'
11 AND INITIALIZES 'PTR'. SET flag = .true. IF AN ECHO OF INPUT
22 #include "inputfile.h"
24 void InputFile_class::getnxt(BOOLEAN flag, BOOLEAN newline)
28 signed char ch; // changed "char" to "signed char". lajos, Nov 18, 2004
32 // default value of parameter newline is TRUE
34 fprintf(output, "\n");
36 // get line of characrers
37 for (i = 0; i < DATASIZ; i++) // bug 190 - swr - 12/09/05
39 if (((ch = fgetc(infile)) == '\n') || (ch == EOF))
41 data[i] = ch < ' ' ? ' ' : ch; // bug 197 - replace control characters with a space - swr - 1/17/06
46 // END OF FILE CONDITION
48 "\n **** unexpected end of inputfile\n **** program aborted\n");
53 // read the rest of the line if more than DATASIZ characters
54 while ((ch != '\n') && (ch != EOF))
55 ch = fgetc(infile); // added check for EOF. lajos, Nov 18, 2004
57 data[i] = 0; // bug 190 - swr - 12/21/05
59 fprintf(output, "\n <*> %s", &(data[1]));
63 fprintf(output, "\n <#> %s", data);
65 // fil up the rest of the buffer with spaces
66 for (; i < DATASIZ + 1; i++)
67 data[i] = ' '; // bug 190 - swr - 12/09/05
70 data[DATASIZ + 1] = 0; // terminate string - bug 190 - swr - 12/09/05