ffstdin(3)

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

SYNOPSIS

ffile_t *ffstdin()

ARGUMENTS
None

DESCRIPTION
ffstdin() is a simple wrapper function for connecting file descriptor 0 to an ffile_t object using ffdopen(3). This is useful for high-performance filter programs, where using the traditional FILE *stdin would cause a bottleneck. 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
Pointer to an ffile_t object if successful, NULL otherwise

EXAMPLES
ffile_t *stream;
// "-" as a filename argument traditionally indicates stdin
if ( strcmp(argv[arg], "-") == 0 )
    stream = ffstdin();
else
    stream = ffopen(argv[arg], O_RDONLY);

SEE ALSO
ffopen(3), ffdopen(3)