libexplain  1.4.D001
Functions
libexplain/filename.h File Reference
#include <stdio.h>

Go to the source code of this file.

Functions

int explain_filename_from_stream (FILE *stream, char *data, size_t data_size)
int explain_filename_from_fildes (int fildes, char *data, size_t data_size)

Function Documentation

int explain_filename_from_fildes ( int  fildes,
char *  data,
size_t  data_size 
)

The explain_filename_from_stream function may be used to obtain the filename associated with the given I/O stream.

Parameters:
fildesThe file descriptor from which to obtain the filename.
datathe filename will be returned in this buffer, NUL terminated.
data_sizeThe available size of the return buffer, in bytes. If too small, the result will be silently truncated.
Returns:
0 on success, -1 on error (does NOT set errno)
int explain_filename_from_stream ( FILE *  stream,
char *  data,
size_t  data_size 
)

The explain_filename_from_stream function may be used to obtain the filename associated with the given I/O stream.

Parameters:
streamThe file stream from which to obtain the filename.
datathe filename will be returned in this buffer, NUL terminated.
data_sizeThe available size of the return buffer, in bytes. If too small, the result will be silently truncated.
Returns:
0 on success, -1 on error (does NOT set errno)