annotate lib/uniconv.h @ 11476:d053b39f7091

New include file "iconveh.h".
author Bruno Haible <bruno@clisp.org>
date Sat, 11 Apr 2009 00:01:31 +0200
parents 3c13040c2619
children ef4e896a3b4f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7945
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Conversions between Unicode and legacy encodings.
11452
1b9f62427f8b Doc fixes.
Bruno Haible <bruno@clisp.org>
parents: 9307
diff changeset
2 Copyright (C) 2002, 2005, 2007, 2009 Free Software Foundation, Inc.
7945
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
9307
ad8a75a45dc9 Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8959
diff changeset
4 This program is free software: you can redistribute it and/or modify it
ad8a75a45dc9 Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8959
diff changeset
5 under the terms of the GNU Lesser General Public License as published
ad8a75a45dc9 Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8959
diff changeset
6 by the Free Software Foundation; either version 3 of the License, or
ad8a75a45dc9 Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8959
diff changeset
7 (at your option) any later version.
7945
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9307
ad8a75a45dc9 Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8959
diff changeset
12 Lesser General Public License for more details.
7945
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
9307
ad8a75a45dc9 Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8959
diff changeset
14 You should have received a copy of the GNU Lesser General Public License
ad8a75a45dc9 Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8959
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
7945
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 #ifndef _UNICONV_H
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #define _UNICONV_H
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 /* Get size_t. */
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <stddef.h>
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include "unitypes.h"
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 /* Get enum iconv_ilseq_handler. */
11476
d053b39f7091 New include file "iconveh.h".
Bruno Haible <bruno@clisp.org>
parents: 11475
diff changeset
26 #include "iconveh.h"
7945
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
11475
3c13040c2619 Fix comment.
Bruno Haible <bruno@clisp.org>
parents: 11452
diff changeset
28 /* Get uniconv_register_autodetect() declaration. */
7945
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 #include "striconveha.h"
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 /* Get locale_charset() declaration. */
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 #include "localcharset.h"
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 #ifdef __cplusplus
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 extern "C" {
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #endif
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 /* Converts an entire string, possibly including NUL bytes, from one encoding
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 to a Unicode encoding.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 Converts a memory region given in encoding FROMCODE. FROMCODE is as for
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 iconv_open(3).
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 The input is in the memory region between SRC (inclusive) and SRC + SRCLEN
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 (exclusive).
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 If OFFSETS is not NULL, it should point to an array of SRCLEN integers; this
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 array is filled with offsets into the result, i.e. the character starting
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 at SRC[i] corresponds to the character starting at (*RESULTP)[OFFSETS[i]],
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 and other offsets are set to (size_t)(-1).
11452
1b9f62427f8b Doc fixes.
Bruno Haible <bruno@clisp.org>
parents: 9307
diff changeset
50 *RESULTP and *LENGTHP should initially be a scratch buffer and its size,
7945
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 or *RESULTP can initially be NULL.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 May erase the contents of the memory at *RESULTP.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 Return value: 0 if successful, otherwise -1 and errno set.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 If successful: The resulting string is stored in *RESULTP and its length
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 in *LENGTHP. *RESULTP is set to a freshly allocated memory block, or is
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 unchanged if no dynamic memory allocation was necessary.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 Particular errno values: EINVAL, EILSEQ, ENOMEM. */
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 extern int
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 u8_conv_from_encoding (const char *fromcode,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 enum iconv_ilseq_handler handler,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 const char *src, size_t srclen,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 size_t *offsets,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 uint8_t **resultp, size_t *lengthp);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 extern int
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 u16_conv_from_encoding (const char *fromcode,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 enum iconv_ilseq_handler handler,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 const char *src, size_t srclen,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 size_t *offsets,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 uint16_t **resultp, size_t *lengthp);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 extern int
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 u32_conv_from_encoding (const char *fromcode,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 enum iconv_ilseq_handler handler,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 const char *src, size_t srclen,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 size_t *offsets,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 uint32_t **resultp, size_t *lengthp);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76
8959
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
77 /* Converts an entire Unicode string, possibly including NUL units, from a
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
78 Unicode encoding to a given encoding.
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
79 Converts a memory region to encoding TOCODE. TOCODE is as for
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
80 iconv_open(3).
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
81 The input is in the memory region between SRC (inclusive) and SRC + SRCLEN
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
82 (exclusive).
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
83 If OFFSETS is not NULL, it should point to an array of SRCLEN integers; this
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
84 array is filled with offsets into the result, i.e. the character starting
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
85 at SRC[i] corresponds to the character starting at (*RESULTP)[OFFSETS[i]],
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
86 and other offsets are set to (size_t)(-1).
11452
1b9f62427f8b Doc fixes.
Bruno Haible <bruno@clisp.org>
parents: 9307
diff changeset
87 *RESULTP and *LENGTHP should initially be a scratch buffer and its size,
8959
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
88 or *RESULTP can initially be NULL.
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
89 May erase the contents of the memory at *RESULTP.
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
90 Return value: 0 if successful, otherwise -1 and errno set.
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
91 If successful: The resulting string is stored in *RESULTP and its length
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
92 in *LENGTHP. *RESULTP is set to a freshly allocated memory block, or is
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
93 unchanged if no dynamic memory allocation was necessary.
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
94 Particular errno values: EINVAL, EILSEQ, ENOMEM. */
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
95 extern int
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
96 u8_conv_to_encoding (const char *tocode,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
97 enum iconv_ilseq_handler handler,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
98 const uint8_t *src, size_t srclen,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
99 size_t *offsets,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
100 char **resultp, size_t *lengthp);
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
101 extern int
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
102 u16_conv_to_encoding (const char *tocode,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
103 enum iconv_ilseq_handler handler,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
104 const uint16_t *src, size_t srclen,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
105 size_t *offsets,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
106 char **resultp, size_t *lengthp);
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
107 extern int
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
108 u32_conv_to_encoding (const char *tocode,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
109 enum iconv_ilseq_handler handler,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
110 const uint32_t *src, size_t srclen,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
111 size_t *offsets,
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
112 char **resultp, size_t *lengthp);
dd17470aa43e New modules uniconv/u{8,16,32}-conv-to-enc.
Bruno Haible <bruno@clisp.org>
parents: 7945
diff changeset
113
7945
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 /* Converts a NUL terminated string from a given encoding.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 The result is malloc allocated, or NULL (with errno set) in case of error.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116 Particular errno values: EILSEQ, ENOMEM. */
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 extern uint8_t *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 u8_strconv_from_encoding (const char *string,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 const char *fromcode,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 enum iconv_ilseq_handler handler);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 extern uint16_t *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 u16_strconv_from_encoding (const char *string,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 const char *fromcode,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 enum iconv_ilseq_handler handler);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 extern uint32_t *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126 u32_strconv_from_encoding (const char *string,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 const char *fromcode,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 enum iconv_ilseq_handler handler);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
129
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130 /* Converts a NUL terminated string to a given encoding.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
131 The result is malloc allocated, or NULL (with errno set) in case of error.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
132 Particular errno values: EILSEQ, ENOMEM. */
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133 extern char *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
134 u8_strconv_to_encoding (const uint8_t *string,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135 const char *tocode,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136 enum iconv_ilseq_handler handler);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
137 extern char *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138 u16_strconv_to_encoding (const uint16_t *string,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 const char *tocode,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 enum iconv_ilseq_handler handler);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 extern char *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 u32_strconv_to_encoding (const uint32_t *string,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 const char *tocode,
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
144 enum iconv_ilseq_handler handler);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
145
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146 /* Converts a NUL terminated string from the locale encoding.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 The result is malloc allocated, or NULL (with errno set) in case of error.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148 Particular errno values: ENOMEM. */
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149 extern uint8_t *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
150 u8_strconv_from_locale (const char *string);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
151 extern uint16_t *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
152 u16_strconv_from_locale (const char *string);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
153 extern uint32_t *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
154 u32_strconv_from_locale (const char *string);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
155
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
156 /* Converts a NUL terminated string to the locale encoding.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
157 The result is malloc allocated, or NULL (with errno set) in case of error.
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
158 Particular errno values: ENOMEM. */
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
159 extern char *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
160 u8_strconv_to_locale (const uint8_t *string);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
161 extern char *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
162 u16_strconv_to_locale (const uint16_t *string);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
163 extern char *
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
164 u32_strconv_to_locale (const uint32_t *string);
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
165
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
166
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
167 #ifdef __cplusplus
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
168 }
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
169 #endif
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
170
3d820a985c88 New module 'uniconv/base'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
171 #endif /* _UNICONV_H */