stream.c

Sat, 15 Oct 2011 14:52:12 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 15 Oct 2011 14:52:12 +0200
changeset 18
cae1294702aa
parent 16
bc9a0fefd892
child 20
43725438ac50
permissions
-rw-r--r--

Increased warning level, fixed resulting warnings, changed std form c99 to gnu99

/*
 * stream.c
 *
 *  Created on: 20.09.2011
 *      Author: beckermi
 */

#include "stream.h"

void close_stdout() {
#ifdef _WIN32
  _STREAM_STDOUT = dup(STDOUT_FILENO);
#endif
  freopen("/dev/null", "w", stdout);
}

void reopen_stdout() {
#ifdef _WIN32
  close(STDOUT_FILENO);
  fdopen(dup(_STREAM_STDOUT), "wa");
  close(_STREAM_STDOUT);
#else
  freopen("/dev/stdout", "w", stdout);
#endif
}

mercurial