libexplain
1.4.D001
|
#include <libexplain/ac/assert.h>
#include <libexplain/ac/ctype.h>
#include <libexplain/ac/errno.h>
#include <libexplain/ac/stdio.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/string.h>
#include <libexplain/buffer/einval.h>
#include <libexplain/buffer/errno/generic.h>
#include <libexplain/buffer/errno/iconv_open.h>
#include <libexplain/buffer/pathname.h>
#include <libexplain/buffer/is_the_null_pointer.h>
#include <libexplain/explanation.h>
#include <libexplain/fstrcmp.h>
Go to the source code of this file.
Functions | |
static void | explain_buffer_errno_iconv_open_system_call (explain_string_buffer_t *sb, int errnum, const char *tocode, const char *fromcode) |
static char * | xstrdup (const char *text) |
static void | one_more_name (char *name) |
static void | upcase_insitu (char *name) |
static char * | strdup_upcase (const char *text) |
static void | get_list_of_known_names (void) |
static int | is_known_name (const char *name) |
static char * | known_names_fuzzy (const char *name) |
static int | known_names_check (explain_string_buffer_t *sb, const char *locale, const char *locale_caption) |
void | explain_buffer_errno_iconv_open_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, const char *tocode, const char *fromcode) |
void | explain_buffer_errno_iconv_open (explain_string_buffer_t *sb, int errnum, const char *tocode, const char *fromcode) |
Variables | |
static char ** | known_names |
static size_t | known_names_size |
static size_t | known_names_allocated |
void explain_buffer_errno_iconv_open | ( | explain_string_buffer_t * | sb, |
int | errnum, | ||
const char * | tocode, | ||
const char * | fromcode | ||
) |
The explain_buffer_errno_iconv_open function is used to obtain an explanation of an error returned by the iconv_open(3) system call. The least the message will contain is the value of strerror(errnum)
, but usually it will do much better, and indicate the underlying cause in more detail.
sb | The string buffer to print the message into. If a suitable buffer is specified, this function is thread safe. |
errnum | The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is necessary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. |
tocode | The original tocode, exactly as passed to the iconv_open(3) system call. |
fromcode | The original fromcode, exactly as passed to the iconv_open(3) system call. |
Definition at line 323 of file iconv_open.c.
void explain_buffer_errno_iconv_open_explanation | ( | explain_string_buffer_t * | sb, |
int | errnum, | ||
const char * | syscall_name, | ||
const char * | tocode, | ||
const char * | fromcode | ||
) |
The explain_buffer_errno_iconv_open_explanation function is used to obtain the explanation (the part after "because") of an error returned by the iconv_open(3) system call (and similar).
sb | The string buffer to print the message into. If a suitable buffer is specified, this function is thread safe. |
errnum | The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is necessary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. |
syscall_name | The name of the offending system call. |
tocode | The original tocode, exactly as passed to the iconv_open(3) system call. |
fromcode | The original fromcode, exactly as passed to the iconv_open(3) system call. |
Definition at line 293 of file iconv_open.c.
static void explain_buffer_errno_iconv_open_system_call | ( | explain_string_buffer_t * | sb, |
int | errnum, | ||
const char * | tocode, | ||
const char * | fromcode | ||
) | [static] |
Definition at line 36 of file iconv_open.c.
static void get_list_of_known_names | ( | void | ) | [static] |
Definition at line 167 of file iconv_open.c.
static int is_known_name | ( | const char * | name | ) | [static] |
Definition at line 196 of file iconv_open.c.
static int known_names_check | ( | explain_string_buffer_t * | sb, |
const char * | locale, | ||
const char * | locale_caption | ||
) | [static] |
Definition at line 250 of file iconv_open.c.
static char* known_names_fuzzy | ( | const char * | name | ) | [static] |
Definition at line 218 of file iconv_open.c.
static void one_more_name | ( | char * | name | ) | [static] |
Definition at line 69 of file iconv_open.c.
static char* strdup_upcase | ( | const char * | text | ) | [static] |
Definition at line 132 of file iconv_open.c.
static void upcase_insitu | ( | char * | name | ) | [static] |
Definition at line 97 of file iconv_open.c.
static char* xstrdup | ( | const char * | text | ) | [static] |
Definition at line 54 of file iconv_open.c.
char** known_names [static] |
Definition at line 48 of file iconv_open.c.
size_t known_names_allocated [static] |
Definition at line 50 of file iconv_open.c.
size_t known_names_size [static] |
Definition at line 49 of file iconv_open.c.