ffgetc(3)

LIBRARY
#include <xtend/fast-file.h>
-lxtend

SYNOPSIS

int     ffgetc(ffile_t *stream)

ARGUMENTS
stream  Pointer to an ffile_t object

DESCRIPTION
ffgetc() and the macro equivalent FFGETC() read a single character from a ffile_t stream opened by ffopen(3). The ffile_t system is simpler than and several times as fast as FILE on typical systems. It is intended for processing large files character-by-character, where low-level block I/O is not convenient, but FILE I/O causes a bottleneck.

RETURN VALUES
The character read, or EOF if no more data are available

EXAMPLES
ffile_t *stream;
int     ch;
if ( (stream = ffopen(filename, O_RDONLY)) == NULL )
{
    fprintf(stderr, "Cannot open %s for reading.n", filename);
    exit(EX_NOINPUT);
}
while ( (ch = FFGETC(stream)) != EOF )
{
}
ffclose(stream);

SEE ALSO
ffopen(3), ffputc(3), ffclose(3)