xt_ff_stdout(3)

NAME
xt_ff_stdout() - Create a fast file stream connected to descriptor 1

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

SYNOPSIS
xt_ff_t *xt_ff_stdout(void)

ARGUMENTS
None

DESCRIPTION
xt_ff_stdout(3) is a simple wrapper function for connecting file descriptor 1 to an xt_ff_t object using xt_ff_dopen(3). This is useful for high-performance filter programs, where using the traditional FILE *stdout would cause a bottleneck. The xt_ff_t system is simpler than and much faster than traditional 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 xt_ff_t object if successful, NULL otherwise

EXAMPLES
xt_ff_t *stream;
// "-" as a filename argument traditionally indicates stdout
if ( strcmp(argv[arg], "-") == 0 )
    stream = xt_ff_stdout();
else
    stream = xt_ff_open(argv[arg], O_WRONLY|O_CREAT|O_TRUNC);

SEE ALSO
xt_ff_open(3), xt_ff_dopen(3)