1b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*
2b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru**********************************************************************
3103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius*   Copyright (C) 1996-2012, International Business Machines
4b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   Corporation and others.  All Rights Reserved.
5b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru**********************************************************************
6b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*
7b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*  FILE NAME : UTYPES.H (formerly ptypes.h)
8b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*
9b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   Date        Name        Description
10b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   12/11/96    helena      Creation.
11b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   02/27/97    aliu        Added typedefs for UClassID, int8, int16, int32,
12b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*                           uint8, uint16, and uint32.
13b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   04/01/97    aliu        Added XP_CPLUSPLUS and modified to work under C as
14b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*                            well as C++.
15b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*                           Modified to use memcpy() for uprv_arrayCopy() fns.
16b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   04/14/97    aliu        Added TPlatformUtilities.
17b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   05/07/97    aliu        Added import/export specifiers (replacing the old
18b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*                           broken EXT_CLASS).  Added version number for our
19b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*                           code.  Cleaned up header.
20b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*    6/20/97    helena      Java class name change.
21b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   08/11/98    stephen     UErrorCode changed from typedef to enum
22b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   08/12/98    erm         Changed T_ANALYTIC_PACKAGE_VERSION to 3
23b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   08/14/98    stephen     Added uprv_arrayCopy() for int8_t, int16_t, int32_t
24b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   12/09/98    jfitz       Added BUFFER_OVERFLOW_ERROR (bug 1100066)
25b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   04/20/99    stephen     Cleaned up & reworked for autoconf.
26b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*                           Renamed to utypes.h.
27b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   05/05/99    stephen     Changed to use <inttypes.h>
28b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   12/07/99    helena      Moved copyright notice string from ucnv_bld.h here.
29b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*******************************************************************************
30b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*/
31b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
32b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef UTYPES_H
33b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define UTYPES_H
34b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
35b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
36b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/umachine.h"
37b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/uversion.h"
38b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/uconfig.h"
39103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#include <float.h>
40103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius
41103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#if !U_NO_DEFAULT_INCLUDE_UTF_HEADERS
42103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#   include "unicode/utf.h"
43103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#endif
44b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
4550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/*!
4650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * \file
4750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * \brief Basic definitions for ICU, for both C and C++ APIs
4850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho *
4950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * This file defines basic types, constants, and enumerations directly or
5050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * indirectly by including other header files, especially utf.h for the
5150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * basic character and string definitions and umachine.h for consistent
5250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * integer and other types.
5350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */
5450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
5550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
5650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/**
5750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * \def U_SHOW_CPLUSPLUS_API
5850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @internal
5950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */
60103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifdef __cplusplus
6150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#   ifndef U_SHOW_CPLUSPLUS_API
6250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#       define U_SHOW_CPLUSPLUS_API 1
6350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#   endif
6450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#else
6550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#   undef U_SHOW_CPLUSPLUS_API
6650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#   define U_SHOW_CPLUSPLUS_API 0
6750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#endif
6850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
6950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** @{ API visibility control */
7050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
71b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
72b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * \def U_HIDE_DRAFT_API
73b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Define this to 1 to request that draft API be "hidden"
74b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @internal
75b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */
76b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/**
77b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * \def U_HIDE_INTERNAL_API
78b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Define this to 1 to request that internal API be "hidden"
79b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @internal
80b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
81b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#if !U_DEFAULT_SHOW_DRAFT && !defined(U_SHOW_DRAFT_API)
82b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_HIDE_DRAFT_API 1
83b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
8450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#if !U_DEFAULT_SHOW_DRAFT && !defined(U_SHOW_INTERNAL_API)
8550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#define U_HIDE_INTERNAL_API 1
8650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#endif
87b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
8850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/** @} */
8950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
90b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
91b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* ICUDATA naming scheme                                                     */
92b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
93b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
94b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
95b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_ICUDATA_TYPE_LETTER
96b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
97b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This is a platform-dependent string containing one letter:
98b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * - b for big-endian, ASCII-family platforms
99b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * - l for little-endian, ASCII-family platforms
100b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * - e for big-endian, EBCDIC-family platforms
101b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This letter is part of the common data file name.
102b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
103b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
104b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
105b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
106b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_ICUDATA_TYPE_LITLETTER
107b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The non-string form of U_ICUDATA_TYPE_LETTER
108b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
109b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
110b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#if U_CHARSET_FAMILY
111b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#   if U_IS_BIG_ENDIAN
112b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru   /* EBCDIC - should always be BE */
113b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#     define U_ICUDATA_TYPE_LETTER "e"
114b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#     define U_ICUDATA_TYPE_LITLETTER e
115b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#   else
116b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#     error "Don't know what to do with little endian EBCDIC!"
117b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#     define U_ICUDATA_TYPE_LETTER "x"
118b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#     define U_ICUDATA_TYPE_LITLETTER x
119b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#   endif
120b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#else
121b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#   if U_IS_BIG_ENDIAN
122b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru      /* Big-endian ASCII */
123b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#     define U_ICUDATA_TYPE_LETTER "b"
124b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#     define U_ICUDATA_TYPE_LITLETTER b
125b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#   else
126b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru      /* Little-endian ASCII */
127b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#     define U_ICUDATA_TYPE_LETTER "l"
128b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#     define U_ICUDATA_TYPE_LITLETTER l
129b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#   endif
130b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
131b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
132b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
133b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * A single string literal containing the icudata stub name. i.e. 'icudt18e' for
134b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * ICU 1.8.x on EBCDIC, etc..
135b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
136b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
137103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
138103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifndef U_HIDE_INTERNAL_API
13950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#define U_USRDATA_NAME    "usrdt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER  /**< @internal */
14072bf11cf6ae9d6b688bacfd5ef5d4d39eba11cffCraig Cornelius// BEGIN android-change - U_USE_USRDATA should be off by default. */
14172bf11cf6ae9d6b688bacfd5ef5d4d39eba11cffCraig Cornelius#ifndef U_USE_USRDATA
14272bf11cf6ae9d6b688bacfd5ef5d4d39eba11cffCraig Cornelius#define U_USE_USRDATA     0  /**< @internal */
14372bf11cf6ae9d6b688bacfd5ef5d4d39eba11cffCraig Cornelius#endif  /* U_USE_USRDATA */
14472bf11cf6ae9d6b688bacfd5ef5d4d39eba11cffCraig Cornelius// END android-change
145103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#endif  /* U_HIDE_INTERNAL_API */
146b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
147b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
148b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *  U_ICU_ENTRY_POINT is the name of the DLL entry point to the ICU data library.
149b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *    Defined as a literal, not a string.
150b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *    Tricky Preprocessor use - ## operator replaces macro paramters with the literal string
151b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                              from the corresponding macro invocation, _before_ other macro substitutions.
152b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                              Need a nested \#defines to get the actual version numbers rather than
153b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                              the literal text U_ICU_VERSION_MAJOR_NUM into the name.
154b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                              The net result will be something of the form
155b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                                  \#define U_ICU_ENTRY_POINT icudt19_dat
156b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4
157b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
158103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#define U_ICUDATA_ENTRY_POINT  U_DEF2_ICUDATA_ENTRY_POINT(U_ICU_VERSION_MAJOR_NUM,U_LIB_SUFFIX_C_NAME)
159b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
160103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifndef U_HIDE_INTERNAL_API
161b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
162103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * Do not use. Note that it's OK for the 2nd argument to be undefined (literal).
163b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @internal
164b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
165103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#define U_DEF2_ICUDATA_ENTRY_POINT(major,suff) U_DEF_ICUDATA_ENTRY_POINT(major,suff)
166103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius
167b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
168b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Do not use.
169b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @internal
170b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
17150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#ifndef U_DEF_ICUDATA_ENTRY_POINT
17250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/* affected by symbol renaming. See platform.h */
173103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifndef U_LIB_SUFFIX_C_NAME
174103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#define U_DEF_ICUDATA_ENTRY_POINT(major, suff) icudt##major##_dat
175b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#else
176103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#define U_DEF_ICUDATA_ENTRY_POINT(major, suff) icudt##suff ## major##_dat
177103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#endif
178b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
179103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#endif  /* U_HIDE_INTERNAL_API */
180b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
181b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
182b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def NULL
183b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.
184b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
185b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
186b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef NULL
187103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifdef __cplusplus
188b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define NULL    0
189b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#else
190b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define NULL    ((void *)0)
191b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
192b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
193b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
194b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
195b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* Calendar/TimeZone data types                                              */
196b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
197b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
198b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
199b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Date and Time data type.
200b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This is a primitive data type that holds the date and time
201b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * as the number of milliseconds since 1970-jan-01, 00:00 UTC.
202b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UTC leap seconds are ignored.
203b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
204b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
205b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef double UDate;
206b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
207b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** The number of milliseconds per second @stable ICU 2.0 */
208b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_MILLIS_PER_SECOND        (1000)
209b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** The number of milliseconds per minute @stable ICU 2.0 */
210b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_MILLIS_PER_MINUTE       (60000)
211b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** The number of milliseconds per hour @stable ICU 2.0 */
212b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_MILLIS_PER_HOUR       (3600000)
213b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** The number of milliseconds per day @stable ICU 2.0 */
214b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_MILLIS_PER_DAY       (86400000)
215b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
216b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/**
217b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Maximum UDate value
218103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8
219b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */
220b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho#define U_DATE_MAX DBL_MAX
221b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho
222b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/**
223b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Minimum UDate value
224103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8
225b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */
226b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho#define U_DATE_MIN -U_DATE_MAX
227b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho
228b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
229b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* Shared library/DLL import-export API control                              */
230b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
231b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
232b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*
233b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Control of symbol import/export.
234b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * ICU is separated into three libraries.
235b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
236b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
237103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius/**
238b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_COMBINED_IMPLEMENTATION
239b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set to export library symbols from inside the ICU library
240b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * when all of ICU is in a single library.
241b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This can be set as a compiler option while building ICU, and it
242b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * needs to be the first one tested to override U_COMMON_API, U_I18N_API, etc.
243b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
244b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
245b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
246b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
247b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_DATA_API
248b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set to export library symbols from inside the stubdata library,
249b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and to import them from outside.
250b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.0
251b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
252b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
253b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
254b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_COMMON_API
255b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set to export library symbols from inside the common library,
256b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and to import them from outside.
257b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
258b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
259b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
260b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
261b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_I18N_API
262b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set to export library symbols from inside the i18n library,
263b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and to import them from outside.
264b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
265b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
266b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
267b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
268b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_LAYOUT_API
269b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set to export library symbols from inside the layout engine library,
270b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and to import them from outside.
271b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
272b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
273b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
274b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
275b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_LAYOUTEX_API
276b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set to export library symbols from inside the layout extensions library,
277b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and to import them from outside.
278b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6
279b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
280b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
281b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
282b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_IO_API
283b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set to export library symbols from inside the ustdio library,
284b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and to import them from outside.
285b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
286b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
287b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
288b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
289b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_TOOLUTIL_API
290b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Set to export library symbols from inside the toolutil library,
291b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and to import them from outside.
292b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.4
293b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
294b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
295b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#if defined(U_COMBINED_IMPLEMENTATION)
296b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_DATA_API     U_EXPORT
297b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COMMON_API   U_EXPORT
298b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_I18N_API     U_EXPORT
299b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUT_API   U_EXPORT
300b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUTEX_API U_EXPORT
301b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_IO_API       U_EXPORT
302b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_TOOLUTIL_API U_EXPORT
303b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#elif defined(U_STATIC_IMPLEMENTATION)
304b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_DATA_API
305b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COMMON_API
306b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_I18N_API
307b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUT_API
308b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUTEX_API
309b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_IO_API
310b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_TOOLUTIL_API
311b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#elif defined(U_COMMON_IMPLEMENTATION)
312b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_DATA_API     U_IMPORT
313b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COMMON_API   U_EXPORT
314b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_I18N_API     U_IMPORT
315b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUT_API   U_IMPORT
316b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUTEX_API U_IMPORT
317b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_IO_API       U_IMPORT
318b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_TOOLUTIL_API U_IMPORT
319b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#elif defined(U_I18N_IMPLEMENTATION)
320b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_DATA_API     U_IMPORT
321b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COMMON_API   U_IMPORT
322b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_I18N_API     U_EXPORT
323b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUT_API   U_IMPORT
324b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUTEX_API U_IMPORT
325b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_IO_API       U_IMPORT
326b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_TOOLUTIL_API U_IMPORT
327b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#elif defined(U_LAYOUT_IMPLEMENTATION)
328b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_DATA_API     U_IMPORT
329b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COMMON_API   U_IMPORT
330b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_I18N_API     U_IMPORT
331b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUT_API   U_EXPORT
332b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUTEX_API U_IMPORT
333b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_IO_API       U_IMPORT
334b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_TOOLUTIL_API U_IMPORT
335b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#elif defined(U_LAYOUTEX_IMPLEMENTATION)
336b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_DATA_API     U_IMPORT
337b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COMMON_API   U_IMPORT
338b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_I18N_API     U_IMPORT
339b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUT_API   U_IMPORT
340b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUTEX_API U_EXPORT
341b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_IO_API       U_IMPORT
342b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_TOOLUTIL_API U_IMPORT
343b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#elif defined(U_IO_IMPLEMENTATION)
344b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_DATA_API     U_IMPORT
345b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COMMON_API   U_IMPORT
346b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_I18N_API     U_IMPORT
347b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUT_API   U_IMPORT
348b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUTEX_API U_IMPORT
349b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_IO_API       U_EXPORT
350b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_TOOLUTIL_API U_IMPORT
351b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#elif defined(U_TOOLUTIL_IMPLEMENTATION)
352b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_DATA_API     U_IMPORT
353b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COMMON_API   U_IMPORT
354b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_I18N_API     U_IMPORT
355b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUT_API   U_IMPORT
356b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUTEX_API U_IMPORT
357b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_IO_API       U_IMPORT
358b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_TOOLUTIL_API U_EXPORT
359b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#else
360b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_DATA_API     U_IMPORT
361b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COMMON_API   U_IMPORT
362b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_I18N_API     U_IMPORT
363b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUT_API   U_IMPORT
364b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_LAYOUTEX_API U_IMPORT
365b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_IO_API       U_IMPORT
366b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_TOOLUTIL_API U_IMPORT
367b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
368b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
369b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
370b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_STANDARD_CPP_NAMESPACE
371b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Control of C++ Namespace
372b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
373b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
374b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifdef __cplusplus
375b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_STANDARD_CPP_NAMESPACE        ::
376b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#else
377b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_STANDARD_CPP_NAMESPACE
378b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
379b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
380b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
381b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
382b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* Global delete operator                                                    */
383b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
384b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
385b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*
386b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The ICU4C library must not use the global new and delete operators.
387b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * These operators here are defined to enable testing for this.
388b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * See Jitterbug 2581 for details of why this is necessary.
389b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
390b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Verification that ICU4C's memory usage is correct, i.e.,
391b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * that global new/delete are not used:
392b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
393b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * a) Check for imports of global new/delete (see uobject.cpp for details)
394b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * b) Verify that new is never imported.
395b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * c) Verify that delete is only imported from object code for interface/mixin classes.
396b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * d) Add global delete and delete[] only for the ICU4C library itself
397b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *    and define them in a way that crashes or otherwise easily shows a problem.
398b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
399b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The following implements d).
400b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The operator implementations crash; this is intentional and used for library debugging.
401b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
402b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Note: This is currently only done on Windows because
403b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * some Linux/Unix compilers have problems with defining global new/delete.
404103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * On Windows, it is _MSC_VER>=1200 for MSVC 6.0 and higher.
405b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
406103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#if defined(__cplusplus) && U_DEBUG && U_OVERRIDE_CXX_ALLOCATION && (_MSC_VER>=1200) && !defined(U_STATIC_IMPLEMENTATION) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION))
407b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
408b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef U_HIDE_INTERNAL_API
409b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
410b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Global operator new, defined only inside ICU4C, must not be used.
411b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Crashes intentionally.
412b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @internal
413b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
414b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruinline void *
415b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruoperator new(size_t /*size*/) {
416b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    char *q=NULL;
417b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    *q=5; /* break it */
418b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    return q;
419b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}
420b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
421c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru#ifdef _Ret_bytecap_
422c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru/* This is only needed to suppress a Visual C++ 2008 warning for operator new[]. */
423c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru_Ret_bytecap_(_Size)
424c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru#endif
425b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
426b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Global operator new[], defined only inside ICU4C, must not be used.
427b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Crashes intentionally.
428b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @internal
429b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
430b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruinline void *
431b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruoperator new[](size_t /*size*/) {
432b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    char *q=NULL;
433b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    *q=5; /* break it */
434b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    return q;
435b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}
436b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
437b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
438b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Global operator delete, defined only inside ICU4C, must not be used.
439b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Crashes intentionally.
440b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @internal
441b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
442b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruinline void
443b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruoperator delete(void * /*p*/) {
444b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    char *q=NULL;
445b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    *q=5; /* break it */
446b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}
447b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
448b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
449b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Global operator delete[], defined only inside ICU4C, must not be used.
450b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Crashes intentionally.
451b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @internal
452b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
453b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruinline void
454b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruoperator delete[](void * /*p*/) {
455b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    char *q=NULL;
456b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    *q=5; /* break it */
457b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}
458b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
459b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif /* U_HIDE_INTERNAL_API */
460b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
461b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
462b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
463b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* UErrorCode */
464b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/
465b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
466b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
467b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Error code to replace exception handling, so that the code is compatible with all C++ compilers,
468b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and to use the same mechanism for C and C++.
469b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
470b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \par
471b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * ICU functions that take a reference (C++) or a pointer (C) to a UErrorCode
472b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * first test if(U_FAILURE(errorCode)) { return immediately; }
473b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * so that in a chain of such functions the first one that sets an error code
474b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * causes the following ones to not perform any operations.
475b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
476b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \par
477b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Error codes should be tested using U_FAILURE() and U_SUCCESS().
478b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
479b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
480b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum UErrorCode {
481b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /* The ordering of U_ERROR_INFO_START Vs U_USING_FALLBACK_WARNING looks weird
482b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * and is that way because VC++ debugger displays first encountered constant,
483b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * which is not the what the code is used for
484b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
485b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
486b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_USING_FALLBACK_WARNING  = -128,   /**< A resource bundle lookup returned a fallback result (not an error) */
487b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
488b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ERROR_WARNING_START     = -128,   /**< Start of information results (semantically successful) */
489b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
490b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_USING_DEFAULT_WARNING   = -127,   /**< A resource bundle lookup returned a result from the root locale (not an error) */
491b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
492b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_SAFECLONE_ALLOCATED_WARNING = -126, /**< A SafeClone operation required allocating memory (informational only) */
493b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
494b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_STATE_OLD_WARNING       = -125,   /**< ICU has to use compatibility layer to construct the service. Expect performance/memory usage degradation. Consider upgrading */
495b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
496b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_STRING_NOT_TERMINATED_WARNING = -124,/**< An output string could not be NUL-terminated because output length==destCapacity. */
497b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
498b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_SORT_KEY_TOO_SHORT_WARNING = -123, /**< Number of levels requested in getBound is higher than the number of levels in the sort key */
499b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
500b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_AMBIGUOUS_ALIAS_WARNING = -122,   /**< This converter alias can go to different converter implementations */
501b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
502b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_DIFFERENT_UCA_VERSION = -121,     /**< ucol_open encountered a mismatch between UCA version and collator image version, so the collator was constructed from rules. No impact to further function */
50350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
50450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    U_PLUGIN_CHANGED_LEVEL_WARNING = -120, /**< A plugin caused a level change. May not be an error, but later plugins may not load. */
505b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
506b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ERROR_WARNING_LIMIT,              /**< This must always be the last warning value to indicate the limit for UErrorCode warnings (last warning code +1) */
507b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
508b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
509b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ZERO_ERROR              =  0,     /**< No error, no warning. */
510b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
511b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ILLEGAL_ARGUMENT_ERROR  =  1,     /**< Start of codes indicating failure */
512b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MISSING_RESOURCE_ERROR  =  2,     /**< The requested resource cannot be found */
513b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVALID_FORMAT_ERROR    =  3,     /**< Data format is not what is expected */
514b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_FILE_ACCESS_ERROR       =  4,     /**< The requested file cannot be found */
515b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INTERNAL_PROGRAM_ERROR  =  5,     /**< Indicates a bug in the library code */
516b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MESSAGE_PARSE_ERROR     =  6,     /**< Unable to parse a message (message format) */
517b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MEMORY_ALLOCATION_ERROR =  7,     /**< Memory allocation error */
518b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INDEX_OUTOFBOUNDS_ERROR =  8,     /**< Trying to access the index that is out of bounds */
519b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_PARSE_ERROR             =  9,     /**< Equivalent to Java ParseException */
520b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVALID_CHAR_FOUND      = 10,     /**< Character conversion: Unmappable input sequence. In other APIs: Invalid character. */
521b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_TRUNCATED_CHAR_FOUND    = 11,     /**< Character conversion: Incomplete input sequence. */
522b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ILLEGAL_CHAR_FOUND      = 12,     /**< Character conversion: Illegal input sequence/combination of input units. */
523b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVALID_TABLE_FORMAT    = 13,     /**< Conversion table file found, but corrupted */
524b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVALID_TABLE_FILE      = 14,     /**< Conversion table file not found */
525b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BUFFER_OVERFLOW_ERROR   = 15,     /**< A result would not fit in the supplied buffer */
526b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNSUPPORTED_ERROR       = 16,     /**< Requested operation not supported in current context */
527b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_RESOURCE_TYPE_MISMATCH  = 17,     /**< an operation is requested over a resource that does not support it */
528b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ILLEGAL_ESCAPE_SEQUENCE = 18,     /**< ISO-2022 illlegal escape sequence */
529b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNSUPPORTED_ESCAPE_SEQUENCE = 19, /**< ISO-2022 unsupported escape sequence */
530b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_NO_SPACE_AVAILABLE      = 20,     /**< No space available for in-buffer expansion for Arabic shaping */
531b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_CE_NOT_FOUND_ERROR      = 21,     /**< Currently used only while setting variable top, but can be used generally */
532b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_PRIMARY_TOO_LONG_ERROR  = 22,     /**< User tried to set variable top to a primary that is longer than two bytes */
533b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_STATE_TOO_OLD_ERROR     = 23,     /**< ICU cannot construct a service from this state, as it is no longer supported */
534b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_TOO_MANY_ALIASES_ERROR  = 24,     /**< There are too many aliases in the path to the requested resource.
535b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                             It is very possible that a circular alias definition has occured */
536b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ENUM_OUT_OF_SYNC_ERROR  = 25,     /**< UEnumeration out of sync with underlying collection */
537b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVARIANT_CONVERSION_ERROR = 26,  /**< Unable to convert a UChar* string to char* with the invariant converter. */
538b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVALID_STATE_ERROR     = 27,     /**< Requested operation can not be completed with ICU in its current state */
539b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_COLLATOR_VERSION_MISMATCH = 28,   /**< Collator version is not compatible with the base version */
540b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_USELESS_COLLATOR_ERROR  = 29,     /**< Collator is options only and no base is specified */
541b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_NO_WRITE_PERMISSION     = 30,     /**< Attempt to modify read-only or constant data. */
542b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
543b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_STANDARD_ERROR_LIMIT,             /**< This must always be the last value to indicate the limit for standard errors */
544b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /*
545b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * the error code range 0x10000 0x10100 are reserved for Transliterator
546b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
547b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BAD_VARIABLE_DEFINITION=0x10000,/**< Missing '$' or duplicate variable name */
548b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_PARSE_ERROR_START = 0x10000,    /**< Start of Transliterator errors */
549b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MALFORMED_RULE,                 /**< Elements of a rule are misplaced */
550b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MALFORMED_SET,                  /**< A UnicodeSet pattern is invalid*/
551b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MALFORMED_SYMBOL_REFERENCE,     /**< UNUSED as of ICU 2.4 */
552b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MALFORMED_UNICODE_ESCAPE,       /**< A Unicode escape pattern is invalid*/
553b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MALFORMED_VARIABLE_DEFINITION,  /**< A variable definition is invalid */
554b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MALFORMED_VARIABLE_REFERENCE,   /**< A variable reference is invalid */
555b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MISMATCHED_SEGMENT_DELIMITERS,  /**< UNUSED as of ICU 2.4 */
556b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MISPLACED_ANCHOR_START,         /**< A start anchor appears at an illegal position */
557b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MISPLACED_CURSOR_OFFSET,        /**< A cursor offset occurs at an illegal position */
558b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MISPLACED_QUANTIFIER,           /**< A quantifier appears after a segment close delimiter */
559b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MISSING_OPERATOR,               /**< A rule contains no operator */
560b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MISSING_SEGMENT_CLOSE,          /**< UNUSED as of ICU 2.4 */
561b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_ANTE_CONTEXTS,         /**< More than one ante context */
562b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_CURSORS,               /**< More than one cursor */
563b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_POST_CONTEXTS,         /**< More than one post context */
564b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_TRAILING_BACKSLASH,             /**< A dangling backslash */
565b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNDEFINED_SEGMENT_REFERENCE,    /**< A segment reference does not correspond to a defined segment */
566b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNDEFINED_VARIABLE,             /**< A variable reference does not correspond to a defined variable */
567b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNQUOTED_SPECIAL,               /**< A special character was not quoted or escaped */
568b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNTERMINATED_QUOTE,             /**< A closing single quote is missing */
569b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_RULE_MASK_ERROR,                /**< A rule is hidden by an earlier more general rule */
570b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MISPLACED_COMPOUND_FILTER,      /**< A compound filter is in an invalid location */
571b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_COMPOUND_FILTERS,      /**< More than one compound filter */
572b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVALID_RBT_SYNTAX,             /**< A "::id" rule was passed to the RuleBasedTransliterator parser */
573b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVALID_PROPERTY_PATTERN,       /**< UNUSED as of ICU 2.4 */
574b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MALFORMED_PRAGMA,               /**< A 'use' pragma is invlalid */
575b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNCLOSED_SEGMENT,               /**< A closing ')' is missing */
576b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ILLEGAL_CHAR_IN_SEGMENT,        /**< UNUSED as of ICU 2.4 */
577b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_VARIABLE_RANGE_EXHAUSTED,       /**< Too many stand-ins generated for the given variable range */
578b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_VARIABLE_RANGE_OVERLAP,         /**< The variable range overlaps characters used in rules */
579b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ILLEGAL_CHARACTER,              /**< A special character is outside its allowed context */
580b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INTERNAL_TRANSLITERATOR_ERROR,  /**< Internal transliterator system error */
581b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVALID_ID,                     /**< A "::id" rule specifies an unknown transliterator */
582b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_INVALID_FUNCTION,               /**< A "&fn()" rule specifies an unknown transliterator */
583b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_PARSE_ERROR_LIMIT,              /**< The limit for Transliterator errors */
584b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
585b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /*
586b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * the error code range 0x10100 0x10200 are reserved for formatting API parsing error
587b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
588b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNEXPECTED_TOKEN=0x10100,       /**< Syntax error in format pattern */
589b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_FMT_PARSE_ERROR_START=0x10100,  /**< Start of format library errors */
590b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_DECIMAL_SEPARATORS,    /**< More than one decimal separator in number pattern */
591b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_DECIMAL_SEPERATORS = U_MULTIPLE_DECIMAL_SEPARATORS, /**< Typo: kept for backward compatibility. Use U_MULTIPLE_DECIMAL_SEPARATORS */
592b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_EXPONENTIAL_SYMBOLS,   /**< More than one exponent symbol in number pattern */
593b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MALFORMED_EXPONENTIAL_PATTERN,  /**< Grouping symbol in exponent pattern */
594b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_PERCENT_SYMBOLS,       /**< More than one percent symbol in number pattern */
595b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_PERMILL_SYMBOLS,       /**< More than one permill symbol in number pattern */
596b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_MULTIPLE_PAD_SPECIFIERS,        /**< More than one pad symbol in number pattern */
597b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_PATTERN_SYNTAX_ERROR,           /**< Syntax error in format pattern */
598b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_ILLEGAL_PAD_POSITION,           /**< Pad symbol misplaced in number pattern */
599b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNMATCHED_BRACES,               /**< Braces do not match in message pattern */
600b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNSUPPORTED_PROPERTY,           /**< UNUSED as of ICU 2.4 */
601b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_UNSUPPORTED_ATTRIBUTE,          /**< UNUSED as of ICU 2.4 */
602c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru    U_ARGUMENT_TYPE_MISMATCH,         /**< Argument name and argument index mismatch in MessageFormat functions */
603c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru    U_DUPLICATE_KEYWORD,              /**< Duplicate keyword in PluralFormat */
60450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    U_UNDEFINED_KEYWORD,              /**< Undefined Plural keyword */
605c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru    U_DEFAULT_KEYWORD_MISSING,        /**< Missing DEFAULT rule in plural rules */
60650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    U_DECIMAL_NUMBER_SYNTAX_ERROR,    /**< Decimal number syntax error */
607103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius    U_FORMAT_INEXACT_ERROR,           /**< Cannot format a number exactly and rounding mode is ROUND_UNNECESSARY @stable ICU 4.8 */
608b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_FMT_PARSE_ERROR_LIMIT,          /**< The limit for format library errors */
609b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
610b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /*
611b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * the error code range 0x10200 0x102ff are reserved for Break Iterator related error
612b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
613b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_INTERNAL_ERROR=0x10200,          /**< An internal error (bug) was detected.             */
614b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_ERROR_START=0x10200,             /**< Start of codes indicating Break Iterator failures */
615b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_HEX_DIGITS_EXPECTED,             /**< Hex digits expected as part of a escaped char in a rule. */
616b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_SEMICOLON_EXPECTED,              /**< Missing ';' at the end of a RBBI rule.            */
617b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_RULE_SYNTAX,                     /**< Syntax error in RBBI rule.                        */
618b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_UNCLOSED_SET,                    /**< UnicodeSet witing an RBBI rule missing a closing ']'.  */
619b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_ASSIGN_ERROR,                    /**< Syntax error in RBBI rule assignment statement.   */
620b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_VARIABLE_REDFINITION,            /**< RBBI rule $Variable redefined.                    */
621b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_MISMATCHED_PAREN,                /**< Mis-matched parentheses in an RBBI rule.          */
622b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_NEW_LINE_IN_QUOTED_STRING,       /**< Missing closing quote in an RBBI rule.            */
623b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_UNDEFINED_VARIABLE,              /**< Use of an undefined $Variable in an RBBI rule.    */
624b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_INIT_ERROR,                      /**< Initialization failure.  Probable missing ICU Data. */
625b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_RULE_EMPTY_SET,                  /**< Rule contains an empty Unicode Set.               */
626b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_UNRECOGNIZED_OPTION,             /**< !!option in RBBI rules not recognized.            */
627b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_MALFORMED_RULE_TAG,              /**< The {nnn} tag on a rule is mal formed             */
628b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_BRK_ERROR_LIMIT,                     /**< This must always be the last value to indicate the limit for Break Iterator failures */
629b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
630b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /*
631b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * The error codes in the range 0x10300-0x103ff are reserved for regular expression related errrs
632b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
633b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_INTERNAL_ERROR=0x10300,       /**< An internal error (bug) was detected.              */
634b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_ERROR_START=0x10300,          /**< Start of codes indicating Regexp failures          */
635b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_RULE_SYNTAX,                  /**< Syntax error in regexp pattern.                    */
636b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_INVALID_STATE,                /**< RegexMatcher in invalid state for requested operation */
637b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_BAD_ESCAPE_SEQUENCE,          /**< Unrecognized backslash escape sequence in pattern  */
638b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_PROPERTY_SYNTAX,              /**< Incorrect Unicode property                         */
639b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_UNIMPLEMENTED,                /**< Use of regexp feature that is not yet implemented. */
640b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_MISMATCHED_PAREN,             /**< Incorrectly nested parentheses in regexp pattern.  */
641b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_NUMBER_TOO_BIG,               /**< Decimal number is too large.                       */
642b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_BAD_INTERVAL,                 /**< Error in {min,max} interval                        */
643b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_MAX_LT_MIN,                   /**< In {min,max}, max is less than min.                */
644b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_INVALID_BACK_REF,             /**< Back-reference to a non-existent capture group.    */
645b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_INVALID_FLAG,                 /**< Invalid value for match mode flags.                */
646b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_LOOK_BEHIND_LIMIT,            /**< Look-Behind pattern matches must have a bounded maximum length.    */
647b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_SET_CONTAINS_STRING,          /**< Regexps cannot have UnicodeSets containing strings.*/
648c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru    U_REGEX_OCTAL_TOO_BIG,                /**< Octal character constants must be <= 0377.         */
649c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru    U_REGEX_MISSING_CLOSE_BRACKET,        /**< Missing closing bracket on a bracket expression.   */
650c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru    U_REGEX_INVALID_RANGE,                /**< In a character range [x-y], x is greater than y.   */
651c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru    U_REGEX_STACK_OVERFLOW,               /**< Regular expression backtrack stack overflow.       */
652c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru    U_REGEX_TIME_OUT,                     /**< Maximum allowed match time exceeded                */
653c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru    U_REGEX_STOPPED_BY_CALLER,            /**< Matching operation aborted by user callback fn.    */
654b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_REGEX_ERROR_LIMIT,                  /**< This must always be the last value to indicate the limit for regexp errors */
655b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
656b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /*
657b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * The error code in the range 0x10400-0x104ff are reserved for IDNA related error codes
658b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
659b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_PROHIBITED_ERROR=0x10400,
660b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_ERROR_START=0x10400,
661b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_UNASSIGNED_ERROR,
662b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_CHECK_BIDI_ERROR,
663b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_STD3_ASCII_RULES_ERROR,
664b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_ACE_PREFIX_ERROR,
665b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_VERIFICATION_ERROR,
666b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_LABEL_TOO_LONG_ERROR,
667b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_ZERO_LENGTH_LABEL_ERROR,
668b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR,
669b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_IDNA_ERROR_LIMIT,
670b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /*
671b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Aliases for StringPrep
672b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
673b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_STRINGPREP_PROHIBITED_ERROR = U_IDNA_PROHIBITED_ERROR,
674b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_STRINGPREP_UNASSIGNED_ERROR = U_IDNA_UNASSIGNED_ERROR,
675b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    U_STRINGPREP_CHECK_BIDI_ERROR = U_IDNA_CHECK_BIDI_ERROR,
67650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
67750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    /*
67850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * The error code in the range 0x10500-0x105ff are reserved for Plugin related error codes
67950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     */
68050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    U_PLUGIN_ERROR_START=0x10500,         /**< Start of codes indicating plugin failures */
68150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    U_PLUGIN_TOO_HIGH=0x10500,            /**< The plugin's level is too high to be loaded right now. */
68250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    U_PLUGIN_DIDNT_SET_LEVEL,             /**< The plugin didn't call uplug_setPlugLevel in response to a QUERY */
68350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    U_PLUGIN_ERROR_LIMIT,                 /**< This must always be the last value to indicate the limit for plugin errors */
684b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
68550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    U_ERROR_LIMIT=U_PLUGIN_ERROR_LIMIT      /**< This must always be the last value to indicate the limit for UErrorCode (last error code +1) */
686b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru} UErrorCode;
687b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
688b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* Use the following to determine if an UErrorCode represents */
689b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* operational success or failure. */
690b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
691103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifdef __cplusplus
692b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
693b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Does the error code indicate success?
694b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
695b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
696b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    static
697b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    inline UBool U_SUCCESS(UErrorCode code) { return (UBool)(code<=U_ZERO_ERROR); }
698b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
699b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Does the error code indicate a failure?
700b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
701b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
702b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    static
703b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    inline UBool U_FAILURE(UErrorCode code) { return (UBool)(code>U_ZERO_ERROR); }
704b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#else
705b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
706b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Does the error code indicate success?
707b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
708b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
709b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#   define U_SUCCESS(x) ((x)<=U_ZERO_ERROR)
710b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
711b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Does the error code indicate a failure?
712b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
713b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
714b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#   define U_FAILURE(x) ((x)>U_ZERO_ERROR)
715b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
716b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
717b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
718b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Return a string for a UErrorCode value.
719b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The string will be the same as the name of the error code constant
720b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * in the UErrorCode enum above.
721b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
722b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
723b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char * U_EXPORT2
724b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruu_errorName(UErrorCode code);
725b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
726b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
727b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif /* _UTYPES */
728