utf8rewind  1.3.0
System library for processing UTF-8 encoded text
codepoint.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2015 Quinten Lansu
3 
4  Permission is hereby granted, free of charge, to any person
5  obtaining a copy of this software and associated documentation
6  files (the "Software"), to deal in the Software without
7  restriction, including without limitation the rights to use,
8  copy, modify, merge, publish, distribute, sublicense, and/or
9  sell copies of the Software, and to permit persons to whom the
10  Software is furnished to do so, subject to the following
11  conditions:
12 
13  The above copyright notice and this permission notice shall be
14  included in all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23  OTHER DEALINGS IN THE SOFTWARE.
24 */
25 
26 #ifndef _UTF8REWIND_INTERNAL_CODEPOINT_H_
27 #define _UTF8REWIND_INTERNAL_CODEPOINT_H_
28 
36 #include "utf8rewind.h"
37 
47 #define MAX_BASIC_LATIN 0x007F
48 
53 #define MAX_LATIN_1 0x00FF
54 
59 #define MAX_BASIC_MULTILINGUAL_PLANE 0xFFFF
60 
65 #define MAX_LEGAL_UNICODE 0x10FFFF
66 
71 #define REPLACEMENT_CHARACTER 0xFFFD
72 
77 #define REPLACEMENT_CHARACTER_STRING "\xEF\xBF\xBD"
78 
83 #define REPLACEMENT_CHARACTER_STRING_LENGTH 3
84 
89 #define SURROGATE_HIGH_START 0xD800
90 
95 #define SURROGATE_HIGH_END 0xDBFF
96 
101 #define SURROGATE_LOW_START 0xDC00
102 
107 #define SURROGATE_LOW_END 0xDFFF
108 
113 #define HANGUL_JAMO_FIRST 0x1100
114 
119 #define HANGUL_JAMO_LAST 0x11FF
120 
126 #define HANGUL_L_FIRST 0x1100
127 
133 #define HANGUL_L_LAST 0x1112
134 
139 #define HANGUL_L_COUNT 19
140 
146 #define HANGUL_V_FIRST 0x1161
147 
153 #define HANGUL_V_LAST 0x1175
154 
159 #define HANGUL_V_COUNT 21
160 
166 #define HANGUL_T_FIRST 0x11A7
167 
173 #define HANGUL_T_LAST 0x11C2
174 
179 #define HANGUL_T_COUNT 28
180 
185 #define HANGUL_N_COUNT 588 /* VCount * TCount */
186 
191 #define HANGUL_S_FIRST 0xAC00
192 
197 #define HANGUL_S_LAST 0xD7A3
198 
203 #define HANGUL_S_COUNT 11172 /* LCount * NCount */
204 
212 extern const uint8_t codepoint_decoded_length[256];
213 
225 uint8_t codepoint_write(unicode_t encoded, char** target, size_t* targetSize);
226 
236 uint8_t codepoint_read(const char* input, size_t inputSize, unicode_t* decoded);
237 
244 #endif /* _UTF8REWIND_INTERNAL_CODEPOINT_H_ */
uint32_t unicode_t
UTF-32 encoded code point.
Definition: utf8rewind.h:235
Public interface for UTF-8 functions.