clibs
Tiny but handy utility libraries for C
Loading...
Searching...
No Matches
print.c File Reference

Implementation of thread-local output streams for print macros. More...

#include "print.h"
Include dependency graph for print.c:

Macros

#define THREAD_LOCAL   __thread

Functions

void clibs_set_output (FILE *out, FILE *err)
 Sets thread-local output streams.
FILE * clibs_get_out (void)
 Returns the current thread-local output stream.
FILE * clibs_get_err (void)
 Returns the current thread-local error stream.

Detailed Description

Implementation of thread-local output streams for print macros.

Function Documentation

◆ clibs_get_err()

FILE * clibs_get_err ( void )

Returns the current thread-local error stream.

Gets current error stream (fallback: stderr).

Falls back to stderr if no thread-local error stream is set.

Returns
FILE* current error stream.

◆ clibs_get_out()

FILE * clibs_get_out ( void )

Returns the current thread-local output stream.

Gets current output stream (fallback: stdout).

Falls back to stdout if no thread-local output stream is set.

Returns
FILE* current output stream.

◆ clibs_set_output()

void clibs_set_output ( FILE * out,
FILE * err )

Sets thread-local output streams.

Sets thread-local output and error streams.

Parameters
outOutput stream for general messages (default fallback: stdout).
errOutput stream for log messages (default fallback: stderr).