#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
|
FILE * | vfopenf (const char *mode, const char *fmt, va_list ap) |
| Similar to fopenf() except it takes a va_list argument. More...
|
|
FILE * | fopenf (const char *mode, const char *fmt,...) |
| Open a file based on the formatted string and optional arguments. More...
|
|
- Author
- Joachim Wiberg
- Date
- 2021
- Copyright
- ISC License
◆ 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.
◆ 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.