libexplain  1.4.D001
Data Structures | Typedefs | Functions
libexplain/errno_info.h File Reference
#include <libexplain/ac/stddef.h>

Go to the source code of this file.

Data Structures

struct  explain_errno_info_t

Typedefs

typedef struct explain_errno_info_t explain_errno_info_t

Functions

const explain_errno_info_texplain_errno_info_by_number (int errnum)
const explain_errno_info_texplain_errno_info_by_name (const char *name)
const explain_errno_info_texplain_errno_info_by_name_fuzzy (const char *name)
const explain_errno_info_texplain_errno_info_by_text (const char *text)
const explain_errno_info_texplain_errno_info_by_text_fuzzy (const char *text)
const char * explain_internal_strerror (int n)
void explain_internal_strerror_r (int errnum, char *data, size_t data_size)

Typedef Documentation

The explain_errno_info_t type describes an errno value, and its (macro) name.

While the tables contains a description string, it is only used if the "internal-strerror=true" option is set. It is principally of use for automated testing, to elimitate differences between Unix implimentations.

Definition at line 34 of file errno_info.h.


Function Documentation

const explain_errno_info_t* explain_errno_info_by_name ( const char *  name)

The explain_errno_info_by_name function may be used to locate errno information by errno name.

Parameters:
nameThe error name ("ENOENT", etc)
Returns:
pointer to info on success, or NULL on failure

Definition at line 26 of file by_name.c.

The explain_errno_info_by_name_fuzzy function may be used to locate errno information by errno name, using fuzzy matching. (For best results, try the exact match first.)

Parameters:
nameThe error name ("ENOENT", etc)
Returns:
pointer to info on success, or NULL on failure

Definition at line 25 of file by_name_fuzzy.c.

The explain_errno_info_by_number function may be used to locate errno information by errno number.

Parameters:
errnumThe error number
Returns:
pointer to info on success, or NULL on failure

Definition at line 24 of file by_number.c.

const explain_errno_info_t* explain_errno_info_by_text ( const char *  text)

The explain_errno_info_by_text function may be used to locate errno information by errno text.

Parameters:
textThe error name ("No such file or directory", etc)
Returns:
pointer to info on success, or NULL on failure

Definition at line 26 of file by_text.c.

The explain_errno_info_by_text_fuzzy function may be used to locate errno information by errno text, using fuzzy matching. (For best results, try the exact match first.)

Parameters:
textThe error text ("No such file or directory", etc)
Returns:
pointer to info on success, or NULL on failure

Definition at line 27 of file by_text_fuzzy.c.

const char* explain_internal_strerror ( int  n)

The explain_internal_strerror method may be used to obtain a string corresponding to an error number. It honors the explain_option_internal_strerror flag.

Returns:
on failure, NULL if the error number os unknown; or on success, a pointer to a string that may not bee altered or free()ed.

Definition at line 27 of file internal_strerror.c.

void explain_internal_strerror_r ( int  errnum,
char *  data,
size_t  data_size 
)

The explain_internal_strerror_r method may be used to obtain a string corresponding to an error number. It honors the explain_option_internal_strerror flag.

Parameters:
errnumThe error number to describe
dataThe array in which to return the result.
data_sizeThe maximum size of thereturned string, including the terminating NUL character.

Definition at line 42 of file internal_strerror.c.