Tou
Tou header library
Loading...
Searching...
No Matches
System/IO control

Macros

#define TOU_SILENCE(...)
 Shorthand for surrounding a piece of code with tou_disable_stdout and tou_enable_stdout.
 

Functions

int tou_disable_stdout ()
 Redirects STDOUT to /dev/null (or NUL: on Windows)
 
void tou_enable_stdout (int saved_fd)
 Re-enables STDOUT that had been disabled using the saved file descriptor from previous function.
 

Variables

int _tou_g_saved_stdout
 Filedescriptor handle local to this compilation unit used with TOU_SILENCE.
 

Detailed Description

Macro Definition Documentation

◆ TOU_SILENCE

#define TOU_SILENCE ( ...)
Value:
__VA_ARGS__ ; \
tou_enable_stdout(_tou_g_saved_stdout);
int _tou_g_saved_stdout
Filedescriptor handle local to this compilation unit used with TOU_SILENCE.
Definition tou.h:722
int tou_disable_stdout()
Redirects STDOUT to /dev/null (or NUL: on Windows)

Shorthand for surrounding a piece of code with tou_disable_stdout and tou_enable_stdout.

Function Documentation

◆ tou_disable_stdout()

int tou_disable_stdout ( )

Redirects STDOUT to /dev/null (or NUL: on Windows)

Return value should be saved if you wish to restore STDOUT function.

Returns
New file descriptor for the saved STDOUT

◆ tou_enable_stdout()

void tou_enable_stdout ( int saved_fd)

Re-enables STDOUT that had been disabled using the saved file descriptor from previous function.

Parameters
[in]saved_fdSaved STDOUT fd

Variable Documentation

◆ _tou_g_saved_stdout

int _tou_g_saved_stdout

Filedescriptor handle local to this compilation unit used with TOU_SILENCE.

Since it isn't surrounded by #ifdef TOU_IMPLEMENTATION it'll be declared each time you #include the header.