stream.c

changeset 34
fa9bda32de17
parent 20
43725438ac50
equal deleted inserted replaced
33:1a2d7298bc82 34:fa9bda32de17
1 /*
2 * stream.c
3 *
4 * Created on: 20.09.2011
5 * Author: Mike
6 */
7
8 #include "stream.h"
9
10 void close_stdout() {
11 #ifdef _WIN32
12 _STREAM_STDOUT = dup(STDOUT_FILENO);
13 #endif
14 freopen("/dev/null", "w", stdout);
15 }
16
17 void reopen_stdout() {
18 #ifdef _WIN32
19 close(STDOUT_FILENO);
20 fdopen(dup(_STREAM_STDOUT), "wa");
21 close(_STREAM_STDOUT);
22 #else
23 freopen("/dev/stdout", "w", stdout);
24 #endif
25 }

mercurial