Bioplib
Protein Structure C Library
|
Read from a file a line at a time, allowing one to probe ahead and look at the contants of the next line without removing it from the input stream. More...
#include <stdlib.h>
#include <string.h>
#include "macros.h"
#include "BuffInp.h"
#include "WindIO.h"
Go to the source code of this file.
Functions | |
INBUFFER * | blOpenBufferedFile (char *filename, int maxstr) |
BOOL | blReadBufferedFile (INBUFFER *bfp, char *string, int length) |
BOOL | blProbeBufferedFile (INBUFFER *bfp, char *string, int length) |
Read from a file a line at a time, allowing one to probe ahead and look at the contants of the next line without removing it from the input stream.
This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.
The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.
The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.
Definition in file BuffInp.c.
INBUFFER* blOpenBufferedFile | ( | char * | filename, |
int | maxstr | ||
) |
[in] | *filename | File name |
[in] | maxstr | Max string length in file for buffering |
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.
[in] | *bfp | Pointer to a buffered file structure |
[in] | length | Size of output string |
[out] | *string | Output string read from file |
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.
[in] | *bfp | Pointer to a buffered file structure |
[in] | length | Size of output string |
[out] | *string | Output string read from file |
Reads a line from a buffered file (like fgets()). Blank lines in the file will be skipped.