ICU 4.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utf.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 *
4 * Copyright (C) 1999-2008, International Business Machines
5 * Corporation and others. All Rights Reserved.
6 *
7 *******************************************************************************
8 * file name: utf.h
9 * encoding: US-ASCII
10 * tab size: 8 (not used)
11 * indentation:4
12 *
13 * created on: 1999sep09
14 * created by: Markus W. Scherer
15 */
16 
108 #ifndef __UTF_H__
109 #define __UTF_H__
110 
111 #include "unicode/utypes.h"
112 /* include the utfXX.h after the following definitions */
113 
114 /* single-code point definitions -------------------------------------------- */
115 
134 #define U_SENTINEL (-1)
135 
142 #define U_IS_UNICODE_NONCHAR(c) \
143  ((c)>=0xfdd0 && \
144  ((uint32_t)(c)<=0xfdef || ((c)&0xfffe)==0xfffe) && \
145  (uint32_t)(c)<=0x10ffff)
146 
164 #define U_IS_UNICODE_CHAR(c) \
165  ((uint32_t)(c)<0xd800 || \
166  ((uint32_t)(c)>0xdfff && \
167  (uint32_t)(c)<=0x10ffff && \
168  !U_IS_UNICODE_NONCHAR(c)))
169 
176 #define U_IS_BMP(c) ((uint32_t)(c)<=0xffff)
177 
184 #define U_IS_SUPPLEMENTARY(c) ((uint32_t)((c)-0x10000)<=0xfffff)
185 
192 #define U_IS_LEAD(c) (((c)&0xfffffc00)==0xd800)
193 
200 #define U_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
201 
208 #define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
209 
217 #define U_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
218 
226 #define U_IS_SURROGATE_TRAIL(c) (((c)&0x400)!=0)
227 
228 /* include the utfXX.h ------------------------------------------------------ */
229 
230 #include "unicode/utf8.h"
231 #include "unicode/utf16.h"
232 
233 /* utf_old.h contains deprecated, pre-ICU 2.4 definitions */
234 #include "unicode/utf_old.h"
235 
236 #endif
C API: 8-bit Unicode handling macros.
C API: Deprecated macros for Unicode string handling.
C API: 16-bit Unicode handling macros.
Basic definitions for ICU, for both C and C++ APIs.