libexplain  1.4.D001
Functions
libexplain/buffer/ebadf.h File Reference
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Functions

void explain_buffer_ebadf (explain_string_buffer_t *sb, int fildes, const char *caption)
void explain_buffer_ebadf_stream (explain_string_buffer_t *sb, const char *caption)
void explain_buffer_ebadf_dir (explain_string_buffer_t *sb, const char *caption)
void explain_buffer_ebadf_not_open_for_reading (explain_string_buffer_t *sb, const char *caption, int flags)
void explain_buffer_ebadf_not_open_for_writing (explain_string_buffer_t *sb, const char *caption, int flags)

Function Documentation

void explain_buffer_ebadf ( explain_string_buffer_t sb,
int  fildes,
const char *  caption 
)

The explain_buffer_ebadf function may be used to print a generic EBADF explanation into the string buffer.

Parameters:
sbThe string buffer to print into
fildesThe value of the manky file descriptor
captionthe argument name to whinge about

Definition at line 30 of file ebadf.c.

void explain_buffer_ebadf_dir ( explain_string_buffer_t sb,
const char *  caption 
)

The explain_buffer_ebadf_dir function may be used to print a generic EBADF or EINVAL explanation into the string buffer, where a DIR* argument does not refer to a valid directory stream.

Parameters:
sbThe string buffer to print into
captionthe argument name to whinge about

Definition at line 85 of file ebadf.c.

void explain_buffer_ebadf_not_open_for_reading ( explain_string_buffer_t sb,
const char *  caption,
int  flags 
)

The explain_buffer_ebafd_not_open_for_reading function is used to print an EBADF or EINVAL explanation into the string buffer, in the case where a file descriptor (or I/O stream) needs to be open for reading, but it is not.

Parameters:
sbThe string buffer to print into
captionThe name of the offending argument.
flagsThe file's open flags, as returned by fcntl(fildes, F_GETFL); or -1 when unknown.

Definition at line 24 of file not_open_for_reading.c.

void explain_buffer_ebadf_not_open_for_writing ( explain_string_buffer_t sb,
const char *  caption,
int  flags 
)

The explain_buffer_ebafd_not_open_for_writing function is used to print an EBADF or EINVAL explanation into the string buffer, in the case where a file descriptor (or I/O stream) needs to be open for reading, but it is not.

Parameters:
sbThe string buffer to print into
captionThe name of the offending argument.
flagsThe file's open flags, as returned by fcntl(fildes, F_GETFL); or -1 when unknown.

Definition at line 24 of file not_open_for_writing.c.

void explain_buffer_ebadf_stream ( explain_string_buffer_t sb,
const char *  caption 
)

The explain_buffer_ebadf_stream function may be used to print a generic EBADF explanation into the string buffer.

Parameters:
sbThe string buffer to print into
captionthe argument name to whinge about

Definition at line 61 of file ebadf.c.