stream.c

Mon, 13 Feb 2012 19:10:00 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 13 Feb 2012 19:10:00 +0100
changeset 31
27c3c1c6b768
parent 20
43725438ac50
permissions
-rw-r--r--

added --exclude-cstyle-comments shortcut

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

#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