#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
Go to the source code of this file.
|
FILE * | vfopenf (const char *mode, const char *fmt, va_list ap) |
|
FILE * | fopenf (const char *mode, const char *fmt,...) |
|
- Author
- Joachim Wiberg
- Date
- 2021
- Copyright
- ISC License
Definition in file fopenf.c.
◆ fopenf()
FILE * fopenf |
( |
const char * | mode, |
|
|
const char * | fmt, |
|
|
| ... ) |
Open a file based on the formatted string and optional arguments
- Parameters
-
mode | An fopen() mode string, e.g. "w+". |
fmt | Formatted string to be composed into a pathname. |
This function is an extension to the fopen() family, lessening the burden of first having to compose the filename from parts in a seprate buffer.
- Returns
- Upon successful completion, fopenf() returns a FILE pointer. Otherwise,
NULL
is returned and errno is set to indicate the error.
Definition at line 75 of file fopenf.c.
◆ vfopenf()
FILE * vfopenf |
( |
const char * | mode, |
|
|
const char * | fmt, |
|
|
va_list | ap ) |
Similar to fopenf() except it takes a va_list argument
- Parameters
-
mode | An fopen() mode string, e.g. "w+". |
fmt | Formatted string to be composed into a pathname. |
ap | List of variable arguemnts from va_start(). |
See fopenf() for details.
- Returns
- a FILE pointer, or
NULL
on error.
Definition at line 40 of file fopenf.c.