home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_01
/
1001014c
< prev
next >
Wrap
Text File
|
1991-11-18
|
346b
|
18 lines
Listing 4 -- the file freopen.c
/* freopen function */
#include <stdlib.h>
#include "xstdio.h"
FILE *(freopen)(const char *name, const char *mods, FILE *str)
{ /* reopen a file */
unsigned short mode = str->_Mode & _MALFIL;
str->_Mode &= ~_MALFIL;
fclose(str);
str->_Mode = mode;
return (_Foprep(name, mods, str));
}