1explain_iconv_open_or_die(3)Library Functions Manualexplain_iconv_open_or_die(3)
2
3
4

NAME

6       explain_iconv_open_or_die  -  prepare for charset conversion and report
7       errors
8

SYNOPSIS

10       #include <libexplain/iconv_open.h>
11       iconv_t explain_iconv_open_or_die(const char *tocode, const char *from‐
12       code);
13       iconv_t  explain_iconv_open_on_error(const  char  *tocode,  const  char
14       *fromcode);
15

DESCRIPTION

17       The  explain_iconv_open_or_die   function   is   used   to   call   the
18       iconv_open(3) system call. On failure an explanation will be printed to
19       stderr, obtained from the explain_iconv_open(3) function, and then  the
20       process terminates by calling exit(EXIT_FAILURE).
21
22       The   explain_iconv_open_on_error   function   is   used  to  call  the
23       iconv_open(3) system call. On failure an explanation will be printed to
24       stderr,  obtained  from  the  explain_iconv_open(3) function, but still
25       returns to the caller.
26
27       tocode  The tocode, exactly as to be passed to the iconv_open(3) system
28               call.
29
30       fromcode
31               The fromcode, exactly as to be passed to the iconv_open(3) sys‐
32               tem call.
33

RETURN VALUE

35       The explain_iconv_open_or_die function only  returns  on  success,  see
36       iconv_open(3)  for  more information. On failure, prints an explanation
37       and exits, it does not return.
38
39       The  explain_iconv_open_on_error  function  always  returns  the  value
40       return by the wrapped iconv_open(3) system call.
41

EXAMPLE

43       The  explain_iconv_open_or_die  function  is  intended  to be used in a
44       fashion similar to the following example:
45              iconv_t result = explain_iconv_open_or_die(tocode, fromcode);
46

SEE ALSO

48       iconv_open(3)
49               allocate descriptor for character set conversion
50
51       explain_iconv_open(3)
52               explain iconv_open(3) errors
53
54       exit(2) terminate the calling process
55
57       libexplain version 1.4
58       Copyright (C) 2013 Peter Miller
59
60
61
62                                                  explain_iconv_open_or_die(3)
Impressum