stream.c

Thu, 01 Dec 2011 17:04:30 +0100

author
Mike Becker <universe@uap-core.de>
date
Thu, 01 Dec 2011 17:04:30 +0100
changeset 25
802c5382f499
parent 20
43725438ac50
permissions
-rw-r--r--

Added line buffer (and warning message - there is no regexp parser, though)

     1 /*
     2  * stream.c
     3  *
     4  *  Created on: 20.09.2011
     5  *      Author: Mike
     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