BuffInp.c



INBUFFER OpenBufferedFile(char *filename, int maxstr)

Inputs

char *filename File name
int maxstr Max string length in file for buffering

Returns

INBUFFER * Pointer to a buffered file

Description

Open a file for buffered input. This allows probe-ahead to look at the contents of the next line without removing it from the input stream.

Created: 28.02.94 Last Modified: 03.03.94


BOOL ReadBufferedFile(INBUFFER *bfp, char *string, int length)

Inputs

INBUFFER *bfp Pointer to a buffered file structure
int length Size of output string

Outputs

char *string Output string read from file

Returns

BOOL TRUE: Successful read FALSE: End of file (or error)

Description

Reads a line from a buffered file (like fgets()). Blank lines in the file will be skipped.

Created: 28.02.94 Last Modified: 10.03.94


BOOL ProbeBufferedFile(INBUFFER *bfp, char *string, int length)

Inputs

INBUFFER *bfp Pointer to a buffered file structure
int length Size of output string

Outputs

char *string Output string read from file

Returns

BOOL TRUE: Successful read FALSE: End of file (or error)

Description

Read the next line from a buffered file without removing it from the input stream. Repeated calls will thus return the same string. The next call to ReadBufferedFile will also output the same string, but will remove the line from the input stream. Blank lines in the file will be skipped.

Created: 28.02.94 Last Modified: 10.03.94