libite 2.6.1
fopenf.c File Reference
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

FILE * vfopenf (const char *mode, const char *fmt, va_list ap)
 
FILE * fopenf (const char *mode, const char *fmt,...)
 

Detailed Description

Author
Joachim Wiberg
Date
2021

Definition in file fopenf.c.

Function Documentation

◆ fopenf()

FILE * fopenf ( const char * mode,
const char * fmt,
... )

Open a file based on the formatted string and optional arguments

Parameters
modeAn fopen() mode string, e.g. "w+".
fmtFormatted 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
modeAn fopen() mode string, e.g. "w+".
fmtFormatted string to be composed into a pathname.
apList 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.