Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

utypes.h

Go to the documentation of this file.
00001 /*
00002 **********************************************************************
00003 *   Copyright (C) 1996-2001, International Business Machines
00004 *   Corporation and others.  All Rights Reserved.
00005 **********************************************************************
00006 *
00007 *  FILE NAME : UTYPES.H (formerly ptypes.h)
00008 *
00009 *   Date        Name        Description
00010 *   12/11/96    helena      Creation.
00011 *   02/27/97    aliu        Added typedefs for UClassID, int8, int16, int32,
00012 *                           uint8, uint16, and uint32.
00013 *   04/01/97    aliu        Added XP_CPLUSPLUS and modified to work under C as
00014 *                            well as C++.
00015 *                           Modified to use memcpy() for uprv_arrayCopy() fns.
00016 *   04/14/97    aliu        Added TPlatformUtilities.
00017 *   05/07/97    aliu        Added import/export specifiers (replacing the old
00018 *                           broken EXT_CLASS).  Added version number for our
00019 *                           code.  Cleaned up header.
00020 *    6/20/97    helena      Java class name change.
00021 *   08/11/98    stephen     UErrorCode changed from typedef to enum
00022 *   08/12/98    erm         Changed T_ANALYTIC_PACKAGE_VERSION to 3
00023 *   08/14/98    stephen     Added uprv_arrayCopy() for int8_t, int16_t, int32_t
00024 *   12/09/98    jfitz       Added BUFFER_OVERFLOW_ERROR (bug 1100066)
00025 *   04/20/99    stephen     Cleaned up & reworked for autoconf.
00026 *                           Renamed to utypes.h.
00027 *   05/05/99    stephen     Changed to use <inttypes.h>
00028 *   12/07/99    helena      Moved copyright notice string from ucnv_bld.h here.
00029 *******************************************************************************
00030 */
00031 
00032 #ifndef UTYPES_H
00033 #define UTYPES_H
00034 
00035 #include "unicode/umachine.h"
00036 #include "unicode/utf.h"
00037 
00048 /*===========================================================================*/
00049 /* char Character set family                                                 */
00050 /*===========================================================================*/
00051 
00092 #define U_ASCII_FAMILY 0
00093 #define U_EBCDIC_FAMILY 1
00094 
00095 #ifndef U_CHARSET_FAMILY
00096 #   define U_CHARSET_FAMILY 0
00097 #endif
00098 
00099 /*===========================================================================*/
00100 /* Related version information                                               */
00101 /*===========================================================================*/
00102 
00104 #define U_ICU_VERSION_MAJOR_NUM 1
00105 
00107 #define U_ICU_VERSION_MINOR_NUM 8
00108 
00110 #define U_ICU_VERSION_PATCHLEVEL_NUM 1
00111 
00114 #define U_ICU_VERSION "1.8.1"
00115 
00117 #define U_ICU_VERSION_SHORT "18"
00118 
00120 #define U_MAX_VERSION_LENGTH 4
00121 
00123 #define U_VERSION_DELIMITER '.'
00124 
00126 #define U_MAX_VERSION_STRING_LENGTH 20
00127 
00129 typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
00130 
00131 /*===========================================================================*/
00132 /* ICUDATA naming scheme                                                     */
00133 /*===========================================================================*/
00134 
00144 #if U_CHARSET_FAMILY
00145 #   if U_IS_BIG_ENDIAN
00146    /* EBCDIC - should always be BE */
00147 #     define U_ICUDATA_TYPE_LETTER "e"
00148 #   else
00149 #     error "Don't know what to do with little endian EBCDIC!"
00150 #     define U_ICUDATA_TYPE_LETTER "x"
00151 #   endif
00152 #else
00153 #   if U_IS_BIG_ENDIAN
00154       /* Big-endian ASCII */
00155 #     define U_ICUDATA_TYPE_LETTER "b"
00156 #   else
00157       /* Little-endian ASCII */
00158 #     define U_ICUDATA_TYPE_LETTER "l"
00159 #   endif
00160 #endif
00161 
00164 #define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
00165 
00171 #if defined(OS390) && defined(XP_CPLUSPLUS)
00172 #    define U_CALLCONV __cdecl
00173 #else
00174 #    define U_CALLCONV 
00175 #endif
00176 
00181 #ifndef NULL
00182 #ifdef XP_CPLUSPLUS
00183 #define NULL    0
00184 #else
00185 #define NULL    ((void *)0)
00186 #endif
00187 #endif
00188 
00189 /*===========================================================================*/
00190 /* Calendar/TimeZone data types                                              */
00191 /*===========================================================================*/
00192 
00199 typedef double UDate;
00200 
00201 /* Common time manipulation constants */
00202 #define U_MILLIS_PER_SECOND        (1000)
00203 #define U_MILLIS_PER_MINUTE       (60000)
00204 #define U_MILLIS_PER_HOUR       (3600000)
00205 #define U_MILLIS_PER_DAY       (86400000)
00206 
00207 
00208 /*===========================================================================*/
00209 /* UClassID-based RTTI */
00210 /*===========================================================================*/
00211 
00254 typedef void* UClassID;
00255 
00256 /*===========================================================================*/
00257 /* Shared library/DLL import-export API control                              */
00258 /*===========================================================================*/
00259 
00260 /*
00261  * Control of symbol import/export.
00262  * ICU is separated into three libraries.
00263  */
00264 
00292 #if defined(U_COMBINED_IMPLEMENTATION)
00293 #define U_COMMON_API  U_EXPORT
00294 #define U_I18N_API    U_EXPORT
00295 #define U_LAYOUT_API  U_EXPORT
00296 #elif defined(U_COMMON_IMPLEMENTATION)
00297 #define U_COMMON_API  U_EXPORT
00298 #define U_I18N_API    U_IMPORT
00299 #define U_LAYOUT_API  U_IMPORT
00300 #elif defined(U_I18N_IMPLEMENTATION)
00301 #define U_COMMON_API  U_IMPORT
00302 #define U_I18N_API    U_EXPORT
00303 #define U_LAYOUT_API  U_IMPORT
00304 #elif defined(U_LAYOUT_IMPLEMENTATION)
00305 #define U_COMMON_API  U_IMPORT
00306 #define U_I18N_API    U_IMPORT
00307 #define U_LAYOUT_API  U_EXPORT
00308 #else
00309 #define U_COMMON_API  U_IMPORT
00310 #define U_I18N_API    U_IMPORT
00311 #define U_LAYOUT_API  U_IMPORT
00312 #endif
00313 
00318 #ifdef __cplusplus
00319 #define U_STANDARD_CPP_NAMESPACE        ::
00320 #else
00321 #define U_STANDARD_CPP_NAMESPACE
00322 #endif
00323 
00324 /*===========================================================================*/
00325 /* UErrorCode */
00326 /*===========================================================================*/
00327 
00341 enum UErrorCode {
00342     U_ERROR_INFO_START        = -128,   
00343     U_USING_FALLBACK_ERROR    = -128,   
00344     U_USING_DEFAULT_ERROR     = -127,   
00345     U_SAFECLONE_ALLOCATED_ERROR = -126, 
00346     U_ERROR_INFO_LIMIT,                 
00348     U_ZERO_ERROR              =  0,     
00350     U_ILLEGAL_ARGUMENT_ERROR  =  1,     
00351     U_MISSING_RESOURCE_ERROR  =  2,
00352     U_INVALID_FORMAT_ERROR    =  3,
00353     U_FILE_ACCESS_ERROR       =  4,
00354     U_INTERNAL_PROGRAM_ERROR  =  5,     
00355     U_MESSAGE_PARSE_ERROR     =  6,
00356     U_MEMORY_ALLOCATION_ERROR =  7,     
00357     U_INDEX_OUTOFBOUNDS_ERROR =  8,
00358     U_PARSE_ERROR             =  9,     
00359     U_INVALID_CHAR_FOUND      = 10,     
00360     U_TRUNCATED_CHAR_FOUND    = 11,     
00361     U_ILLEGAL_CHAR_FOUND      = 12,     
00362     U_INVALID_TABLE_FORMAT    = 13,     
00363     U_INVALID_TABLE_FILE      = 14,     
00364     U_BUFFER_OVERFLOW_ERROR   = 15,     
00365     U_UNSUPPORTED_ERROR       = 16,     
00366     U_RESOURCE_TYPE_MISMATCH  = 17,     
00367     U_ILLEGAL_ESCAPE_SEQUENCE = 18,     
00368     U_UNSUPPORTED_ESCAPE_SEQUENCE = 19, 
00369     U_NO_SPACE_AVAILABLE      = 20,     
00370     U_ERROR_LIMIT                       
00371 };
00372 
00373 #ifndef XP_CPLUSPLUS
00374 typedef enum UErrorCode UErrorCode;
00375 #endif
00376 
00377 /* Use the following to determine if an UErrorCode represents */
00378 /* operational success or failure. */
00379 
00380 #ifdef XP_CPLUSPLUS
00381 
00385     inline UBool U_SUCCESS(UErrorCode code) { return (UBool)(code<=U_ZERO_ERROR); }
00390     inline UBool U_FAILURE(UErrorCode code) { return (UBool)(code>U_ZERO_ERROR); }
00391 #else
00392 
00396 #   define U_SUCCESS(x) ((x)<=U_ZERO_ERROR)
00397 
00401 #   define U_FAILURE(x) ((x)>U_ZERO_ERROR)
00402 #endif
00403 
00409 U_CAPI const char * U_EXPORT2
00410 u_errorName(UErrorCode code);
00411 
00412 #define U_COPYRIGHT_STRING \
00413   " Copyright (C) 2001, International Business Machines Corporation and others. All Rights Reserved. "
00414 
00415 #define U_COPYRIGHT_STRING_LENGTH  128
00416 
00421 typedef void *UMTX;
00422 
00423 /*===========================================================================*/
00424 /* Include header for platform utilies */
00425 /*===========================================================================*/
00426 
00427 #include "unicode/putil.h"
00428 
00429 #endif /* _UTYPES */

Generated at Tue Jun 12 14:04:03 2001 for ICU 1.8.1 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000