This source file includes following definitions.
- xmem_cd_iconveh
- xstr_cd_iconveh
- xmem_iconveh
- xstr_iconveh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include <config.h>
19
20
21 #include "xstriconveh.h"
22
23 #include <errno.h>
24
25 #include "striconveh.h"
26 #include "xalloc.h"
27
28
29 #if HAVE_ICONV
30
31 int
32 xmem_cd_iconveh (const char *src, size_t srclen,
33 const iconveh_t *cd,
34 enum iconv_ilseq_handler handler,
35 size_t *offsets,
36 char **resultp, size_t *lengthp)
37 {
38 int retval =
39 mem_cd_iconveh (src, srclen, cd, handler, offsets, resultp, lengthp);
40
41 if (retval < 0 && errno == ENOMEM)
42 xalloc_die ();
43 return retval;
44 }
45
46 char *
47 xstr_cd_iconveh (const char *src,
48 const iconveh_t *cd,
49 enum iconv_ilseq_handler handler)
50 {
51 char *result = str_cd_iconveh (src, cd, handler);
52
53 if (result == NULL && errno == ENOMEM)
54 xalloc_die ();
55 return result;
56 }
57
58 #endif
59
60 int
61 xmem_iconveh (const char *src, size_t srclen,
62 const char *from_codeset, const char *to_codeset,
63 enum iconv_ilseq_handler handler,
64 size_t *offsets,
65 char **resultp, size_t *lengthp)
66 {
67 int retval =
68 mem_iconveh (src, srclen, from_codeset, to_codeset, handler, offsets,
69 resultp, lengthp);
70
71 if (retval < 0 && errno == ENOMEM)
72 xalloc_die ();
73 return retval;
74 }
75
76 char *
77 xstr_iconveh (const char *src,
78 const char *from_codeset, const char *to_codeset,
79 enum iconv_ilseq_handler handler)
80 {
81 char *result = str_iconveh (src, from_codeset, to_codeset, handler);
82
83 if (result == NULL && errno == ENOMEM)
84 xalloc_die ();
85 return result;
86 }