libtranscript
 All Data Structures Functions Variables Enumerations Enumerator Modules
utf.h
1 /* Copyright (C) 2011 G.P. Halkes
2  This program is free software: you can redistribute it and/or modify
3  it under the terms of the GNU General Public License version 3, as
4  published by the Free Software Foundation.
5 
6  This program is distributed in the hope that it will be useful,
7  but WITHOUT ANY WARRANTY; without even the implied warranty of
8  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  GNU General Public License for more details.
10 
11  You should have received a copy of the GNU General Public License
12  along with this program. If not, see <http://www.gnu.org/licenses/>.
13 */
14 #ifndef TRANSCRIPT_UTF_H
15 #define TRANSCRIPT_UTF_H
16 
17 #include <transcript/api.h>
18 #include <transcript/bool.h>
19 #include <transcript/handle.h>
20 
21 #define TRANSCRIPT_UTF_ILLEGAL UINT32_C(0xffffffff)
22 #define TRANSCRIPT_UTF_INCOMPLETE UINT32_C(0xfffffffe)
23 /* TRANSCRIPT_UTF_INTERNAL_ERROR can _not_ be returned from the UTF-8/16/32 converters, only
24  from UTF-7/GB-18030/SCSU/BOCU-1 decoders. */
25 #define TRANSCRIPT_UTF_INTERNAL_ERROR UINT32_C(0xfffffffd)
26 /* TRANSCRIPT_UTF_NO_VALUE is only used by the UTF-7 decoder, which may consume a '-'
27  character after a Base64 sequence without producing a new codepoint. */
28 #define TRANSCRIPT_UTF_NO_VALUE UINT32_C(0xfffffffc)
29 
30 enum {
31  _TRANSCRIPT_UTF8_LOOSE = _TRANSCRIPT_UTFLAST,
32  _TRANSCRIPT_CESU8,
33  _TRANSCRIPT_GB18030,
34  _TRANSCRIPT_SCSU,
35  _TRANSCRIPT_UTF7,
36  _TRANSCRIPT_UTF32_NO_CHECK,
37  _TRANSCRIPT_UTF16BE_BOM,
38  _TRANSCRIPT_UTF16LE_BOM,
39  _TRANSCRIPT_UTF32BE_BOM,
40  _TRANSCRIPT_UTF32LE_BOM,
41  _TRANSCRIPT_UTF8_BOM
42 };
43 /* FIXME: rename! */
44 TRANSCRIPT_API put_unicode_func_t _transcript_get_put_unicode(int type);
45 TRANSCRIPT_API get_unicode_func_t _transcript_get_get_unicode(int type);
46 TRANSCRIPT_LOCAL uint_fast32_t _transcript_get_utf32_no_check(const char **inbuf, const char *inbuflimit, bool_t skip);
47 TRANSCRIPT_LOCAL transcript_error_t _transcript_put_utf16_no_check(uint_fast32_t codepoint, char **outbuf);
48 #endif
transcript_error_t
Error values.
Definition: transcript.h:91