ICU 4.8.1.1  4.8.1.1
utf.h
Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 1999-2010, International Business Machines
00005 *   Corporation and others.  All Rights Reserved.
00006 *
00007 *******************************************************************************
00008 *   file name:  utf.h
00009 *   encoding:   US-ASCII
00010 *   tab size:   8 (not used)
00011 *   indentation:4
00012 *
00013 *   created on: 1999sep09
00014 *   created by: Markus W. Scherer
00015 */
00016 
00108 #ifndef __UTF_H__
00109 #define __UTF_H__
00110 
00111 #include "unicode/utypes.h"
00112 /* include the utfXX.h after the following definitions */
00113 
00114 /* single-code point definitions -------------------------------------------- */
00115 
00134 #define U_SENTINEL (-1)
00135 
00142 #define U_IS_UNICODE_NONCHAR(c) \
00143     ((c)>=0xfdd0 && \
00144      ((uint32_t)(c)<=0xfdef || ((c)&0xfffe)==0xfffe) && \
00145      (uint32_t)(c)<=0x10ffff)
00146 
00164 #define U_IS_UNICODE_CHAR(c) \
00165     ((uint32_t)(c)<0xd800 || \
00166         ((uint32_t)(c)>0xdfff && \
00167          (uint32_t)(c)<=0x10ffff && \
00168          !U_IS_UNICODE_NONCHAR(c)))
00169 
00176 #define U_IS_BMP(c) ((uint32_t)(c)<=0xffff)
00177 
00184 #define U_IS_SUPPLEMENTARY(c) ((uint32_t)((c)-0x10000)<=0xfffff)
00185  
00192 #define U_IS_LEAD(c) (((c)&0xfffffc00)==0xd800)
00193 
00200 #define U_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
00201 
00208 #define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
00209 
00217 #define U_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
00218 
00226 #define U_IS_SURROGATE_TRAIL(c) (((c)&0x400)!=0)
00227 
00228 /* include the utfXX.h ------------------------------------------------------ */
00229 
00230 #include "unicode/utf8.h"
00231 #include "unicode/utf16.h"
00232 
00233 /* utf_old.h contains deprecated, pre-ICU 2.4 definitions */
00234 #include "unicode/utf_old.h"
00235 
00236 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines