FreeBASIC  0.91.0
file_resetex.c
Go to the documentation of this file.
1 /* recover stdio after redirection */
2 
3 #include "fb.h"
4 
5 /* streamno:
6  0 Reset stdin
7  1 Reset stdout */
8 FBCALL void fb_FileResetEx( int streamno )
9 {
10  int errnum;
11 
12  FB_LOCK();
13 
14  switch( streamno ) {
15  case 0:
16  case 1:
17  errnum = fb_hFileResetEx( streamno ) ? FB_RTERROR_OK : FB_RTERROR_FILEIO;
18  break;
19  default:
21  }
22 
23  FB_UNLOCK();
24 
25  fb_ErrorSetNum( errnum );
26 }