stream.c

Tue, 20 Sep 2011 15:19:28 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 20 Sep 2011 15:19:28 +0200
changeset 16
bc9a0fefd892
child 20
43725438ac50
permissions
-rw-r--r--

fixed makefile to run safely on compile errors + added -V option to cline

     1 /*
     2  * stream.c
     3  *
     4  *  Created on: 20.09.2011
     5  *      Author: beckermi
     6  */
     8 #include "stream.h"
    10 void close_stdout() {
    11 #ifdef _WIN32
    12   _STREAM_STDOUT = dup(STDOUT_FILENO);
    13 #endif
    14   freopen("/dev/null", "w", stdout);
    15 }
    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