safec
3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_lib.h"
Functions | |
EXPORT errno_t | freopen_s (FILE *restrict *restrict newstreamptr, const char *restrict filename, const char *restrict mode, FILE *restrict stream) |
The freopen_s function first, attempts to close the file associated with the stream, ignoring any errors. More... | |
EXPORT errno_t freopen_s | ( | FILE *restrict *restrict | newstreamptr, |
const char *restrict | filename, | ||
const char *restrict | mode, | ||
FILE *restrict | stream | ||
) |
The freopen_s
function first, attempts to close the file associated with the stream, ignoring any errors.
Then, if filename is not null, attempts to open the file specified by filename using mode as if by fopen, and associates that file with the file stream pointed to by stream. If filename is a null pointer, then the function attempts to reopen the file that is already associated with stream (it is implementation defined which mode changes are allowed in this case).
[out] | newstreamptr | pointer to a FILE stream that will be updated by this function call |
[in] | filename | file name to associate the file stream to |
[in] | mode | as in fopen |
[in] | stream | the file stream to modify |
If the file was reopened successfully, then the pointer to the FILE pointed to by newstreamptr will be set to the pointer to the object controlling the opened file. Otherwise, the pointer to the FILE pointed to by newstreamptr will be set to a null pointer.
EOK | on success |
ESNULLP | when any argument is a NULL pointer |
> | 0 any other errno |