📄 utypes.h
字号:
/************************************************************************ Copyright (C) 1996-2004, International Business Machines* Corporation and others. All Rights Reserved.************************************************************************ FILE NAME : UTYPES.H (formerly ptypes.h)** Date Name Description* 12/11/96 helena Creation.* 02/27/97 aliu Added typedefs for UClassID, int8, int16, int32,* uint8, uint16, and uint32.* 04/01/97 aliu Added XP_CPLUSPLUS and modified to work under C as* well as C++.* Modified to use memcpy() for uprv_arrayCopy() fns.* 04/14/97 aliu Added TPlatformUtilities.* 05/07/97 aliu Added import/export specifiers (replacing the old* broken EXT_CLASS). Added version number for our* code. Cleaned up header.* 6/20/97 helena Java class name change.* 08/11/98 stephen UErrorCode changed from typedef to enum* 08/12/98 erm Changed T_ANALYTIC_PACKAGE_VERSION to 3* 08/14/98 stephen Added uprv_arrayCopy() for int8_t, int16_t, int32_t* 12/09/98 jfitz Added BUFFER_OVERFLOW_ERROR (bug 1100066)* 04/20/99 stephen Cleaned up & reworked for autoconf.* Renamed to utypes.h.* 05/05/99 stephen Changed to use <inttypes.h>* 12/07/99 helena Moved copyright notice string from ucnv_bld.h here.********************************************************************************/#ifndef UTYPES_H#define UTYPES_H#include "unicode/umachine.h"#include "unicode/utf.h"#include "unicode/uversion.h"#include "unicode/uconfig.h"#ifdef U_HIDE_DRAFT_API#include "unicode/udraft.h"#endif#ifdef U_HIDE_DEPRECATED_API#include "unicode/udeprctd.h"#endif#ifdef U_HIDE_DEPRECATED_API#include "unicode/uobslete.h"#endif/*! * \file * \brief Basic definitions for ICU, for both C and C++ APIs * * This file defines basic types, constants, and enumerations directly or * indirectly by including other header files, especially utf.h for the * basic character and string definitions and umachine.h for consistent * integer and other types. *//*===========================================================================*//* char Character set family *//*===========================================================================*//** * U_CHARSET_FAMILY is equal to this value when the platform is an ASCII based platform. * @stable ICU 2.0 */#define U_ASCII_FAMILY 0/** * U_CHARSET_FAMILY is equal to this value when the platform is an EBCDIC based platform. * @stable ICU 2.0 */#define U_EBCDIC_FAMILY 1/** * \def U_CHARSET_FAMILY * * <p>These definitions allow to specify the encoding of text * in the char data type as defined by the platform and the compiler. * It is enough to determine the code point values of "invariant characters", * which are the ones shared by all encodings that are in use * on a given platform.</p> * * <p>Those "invariant characters" should be all the uppercase and lowercase * latin letters, the digits, the space, and "basic punctuation". * Also, '\\n', '\\r', '\\t' should be available.</p> * * <p>The list of "invariant characters" is:<br> * \code * A-Z a-z 0-9 SPACE " % & ' ( ) * + , - . / : ; < = > ? _ * \endcode * <br> * (52 letters + 10 numbers + 20 punc/sym/space = 82 total)</p> * * <p>This matches the IBM Syntactic Character Set (CS 640).</p> * * <p>In other words, all the graphic characters in 7-bit ASCII should * be safely accessible except the following:</p> * * \code * '\' <backslash> * '[' <left bracket> * ']' <right bracket> * '{' <left brace> * '}' <right brace> * '^' <circumflex> * '~' <tilde> * '!' <exclamation mark> * '#' <number sign> * '|' <vertical line> * '$' <dollar sign> * '@' <commercial at> * '`' <grave accent> * \endcode * @stable ICU 2.0 */#ifndef U_CHARSET_FAMILY# define U_CHARSET_FAMILY 0#endif/*===========================================================================*//* ICUDATA naming scheme *//*===========================================================================*//** * \def U_ICUDATA_TYPE_LETTER * * This is a platform-dependent string containing one letter: * - b for big-endian, ASCII-family platforms * - l for little-endian, ASCII-family platforms * - e for big-endian, EBCDIC-family platforms * This letter is part of the common data file name. * @stable ICU 2.0 *//** * \def U_ICUDATA_TYPE_LITLETTER * The non-string form of U_ICUDATA_TYPE_LETTER * @stable ICU 2.0 */#if U_CHARSET_FAMILY# if U_IS_BIG_ENDIAN /* EBCDIC - should always be BE */# define U_ICUDATA_TYPE_LETTER "e"# define U_ICUDATA_TYPE_LITLETTER e# else# error "Don't know what to do with little endian EBCDIC!"# define U_ICUDATA_TYPE_LETTER "x"# define U_ICUDATA_TYPE_LITLETTER x# endif#else# if U_IS_BIG_ENDIAN /* Big-endian ASCII */# define U_ICUDATA_TYPE_LETTER "b"# define U_ICUDATA_TYPE_LITLETTER b# else /* Little-endian ASCII */# define U_ICUDATA_TYPE_LETTER "l"# define U_ICUDATA_TYPE_LITLETTER l# endif#endif/** * A single string literal containing the icudata stub name. i.e. 'icudt18e' for * ICU 1.8.x on EBCDIC, etc.. * @stable ICU 2.0 */#define U_ICUDATA_NAME "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER/** * U_ICU_ENTRY_POINT is the name of the DLL entry point to the ICU data library. * Defined as a literal, not a string. * Tricky Preprocessor use - ## operator replaces macro paramters with the literal string * from the corresponding macro invocation, _before_ other macro substitutions. * Need a nested #defines to get the actual version numbers rather than * the literal text U_ICU_VERSION_MAJOR_NUM into the name. * The net result will be something of the form * #define U_ICU_ENTRY_POINT icudt19_dat * @stable ICU 2.4 */#define U_ICUDATA_ENTRY_POINT U_DEF2_ICUDATA_ENTRY_POINT(U_ICU_VERSION_MAJOR_NUM, U_ICU_VERSION_MINOR_NUM)/** * @internal */#define U_DEF2_ICUDATA_ENTRY_POINT(major, minor) U_DEF_ICUDATA_ENTRY_POINT(major, minor)/** * @internal */#define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt##major##minor##_dat/** * \def U_CALLCONV * Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary * in callback function typedefs to make sure that the calling convention * is compatible. * * This is only used for non-ICU-API functions. * When a function is a public ICU API, * you must use the U_CAPI and U_EXPORT2 qualifiers. * @stable ICU 2.0 */#if defined(OS390) && (__COMPILER_VER__ < 0x41020000) && defined(XP_CPLUSPLUS)# define U_CALLCONV __cdecl#else# define U_CALLCONV U_EXPORT2#endif/** * \def NULL * Define NULL if necessary, to 0 for C++ and to ((void *)0) for C. * @stable ICU 2.0 */#ifndef NULL#ifdef XP_CPLUSPLUS#define NULL 0#else#define NULL ((void *)0)#endif#endif/*===========================================================================*//* Calendar/TimeZone data types *//*===========================================================================*//** * Date and Time data type. * This is a primitive data type that holds the date and time * as the number of milliseconds since 1970-jan-01, 00:00 UTC. * UTC leap seconds are ignored. * @stable ICU 2.0 */typedef double UDate;/** The number of milliseconds per second @stable ICU 2.0 */#define U_MILLIS_PER_SECOND (1000)/** The number of milliseconds per minute @stable ICU 2.0 */#define U_MILLIS_PER_MINUTE (60000)/** The number of milliseconds per hour @stable ICU 2.0 */#define U_MILLIS_PER_HOUR (3600000)/** The number of milliseconds per day @stable ICU 2.0 */#define U_MILLIS_PER_DAY (86400000)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -