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 0
00111 
00113 #define U_ICU_VERSION "1.8"
00114 
00116 #define U_ICU_VERSION_SHORT "18"
00117 
00119 #define U_MAX_VERSION_LENGTH 4
00120 
00122 #define U_VERSION_DELIMITER '.'
00123 
00125 #define U_MAX_VERSION_STRING_LENGTH 20
00126 
00128 typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
00129 
00130 /*===========================================================================*/
00131 /* ICUDATA naming scheme                                                     */
00132 /*===========================================================================*/
00133 
00143 #if U_CHARSET_FAMILY
00144 #   if U_IS_BIG_ENDIAN
00145    /* EBCDIC - should always be BE */
00146 #     define U_ICUDATA_TYPE_LETTER "e"
00147 #   else
00148 #     error "Don't know what to do with little endian EBCDIC!"
00149 #     define U_ICUDATA_TYPE_LETTER "x"
00150 #   endif
00151 #else
00152 #   if U_IS_BIG_ENDIAN
00153       /* Big-endian ASCII */
00154 #     define U_ICUDATA_TYPE_LETTER "b"
00155 #   else
00156       /* Little-endian ASCII */
00157 #     define U_ICUDATA_TYPE_LETTER "l"
00158 #   endif
00159 #endif
00160 
00163 #define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
00164 
00170 #if defined(OS390) && defined(XP_CPLUSPLUS)
00171 #    define U_CALLCONV __cdecl
00172 #else
00173 #    define U_CALLCONV 
00174 #endif
00175 
00180 #ifndef NULL
00181 #ifdef XP_CPLUSPLUS
00182 #define NULL    0
00183 #else
00184 #define NULL    ((void *)0)
00185 #endif
00186 #endif
00187 
00188 /*===========================================================================*/
00189 /* Calendar/TimeZone data types                                              */
00190 /*===========================================================================*/
00191 
00198 typedef double UDate;
00199 
00200 /* Common time manipulation constants */
00201 #define U_MILLIS_PER_SECOND        (1000)
00202 #define U_MILLIS_PER_MINUTE       (60000)
00203 #define U_MILLIS_PER_HOUR       (3600000)
00204 #define U_MILLIS_PER_DAY       (86400000)
00205 
00206 
00207 /*===========================================================================*/
00208 /* UClassID-based RTTI */
00209 /*===========================================================================*/
00210 
00253 typedef void* UClassID;
00254 
00255 /*===========================================================================*/
00256 /* Shared library/DLL import-export API control                              */
00257 /*===========================================================================*/
00258 
00259 /*
00260  * Control of symbol import/export.
00261  * ICU is separated into three libraries.
00262  */
00263 
00291 #if defined(U_COMBINED_IMPLEMENTATION)
00292 #define U_COMMON_API  U_EXPORT
00293 #define U_I18N_API    U_EXPORT
00294 #define U_LAYOUT_API  U_EXPORT
00295 #elif defined(U_COMMON_IMPLEMENTATION)
00296 #define U_COMMON_API  U_EXPORT
00297 #define U_I18N_API    U_IMPORT
00298 #define U_LAYOUT_API  U_IMPORT
00299 #elif defined(U_I18N_IMPLEMENTATION)
00300 #define U_COMMON_API  U_IMPORT
00301 #define U_I18N_API    U_EXPORT
00302 #define U_LAYOUT_API  U_IMPORT
00303 #elif defined(U_LAYOUT_IMPLEMENTATION)
00304 #define U_COMMON_API  U_IMPORT
00305 #define U_I18N_API    U_IMPORT
00306 #define U_LAYOUT_API  U_EXPORT
00307 #else
00308 #define U_COMMON_API  U_IMPORT
00309 #define U_I18N_API    U_IMPORT
00310 #define U_LAYOUT_API  U_IMPORT
00311 #endif
00312 
00317 #ifdef __cplusplus
00318 #define U_STANDARD_CPP_NAMESPACE        ::
00319 #else
00320 #define U_STANDARD_CPP_NAMESPACE
00321 #endif
00322 
00323 /*===========================================================================*/
00324 /* UErrorCode */
00325 /*===========================================================================*/
00326 
00340 enum UErrorCode {
00341     U_ERROR_INFO_START        = -128,   
00342     U_USING_FALLBACK_ERROR    = -128,   
00343     U_USING_DEFAULT_ERROR     = -127,   
00344     U_SAFECLONE_ALLOCATED_ERROR = -126, 
00345     U_ERROR_INFO_LIMIT,                 
00347     U_ZERO_ERROR              =  0,     
00349     U_ILLEGAL_ARGUMENT_ERROR  =  1,     
00350     U_MISSING_RESOURCE_ERROR  =  2,
00351     U_INVALID_FORMAT_ERROR    =  3,
00352     U_FILE_ACCESS_ERROR       =  4,
00353     U_INTERNAL_PROGRAM_ERROR  =  5,     
00354     U_MESSAGE_PARSE_ERROR     =  6,
00355     U_MEMORY_ALLOCATION_ERROR =  7,     
00356     U_INDEX_OUTOFBOUNDS_ERROR =  8,
00357     U_PARSE_ERROR             =  9,     
00358     U_INVALID_CHAR_FOUND      = 10,     
00359     U_TRUNCATED_CHAR_FOUND    = 11,     
00360     U_ILLEGAL_CHAR_FOUND      = 12,     
00361     U_INVALID_TABLE_FORMAT    = 13,     
00362     U_INVALID_TABLE_FILE      = 14,     
00363     U_BUFFER_OVERFLOW_ERROR   = 15,     
00364     U_UNSUPPORTED_ERROR       = 16,     
00365     U_RESOURCE_TYPE_MISMATCH  = 17,     
00366     U_ILLEGAL_ESCAPE_SEQUENCE = 18,     
00367     U_UNSUPPORTED_ESCAPE_SEQUENCE = 19, 
00368     U_NO_SPACE_AVAILABLE      = 20,     
00369     U_ERROR_LIMIT                       
00370 };
00371 
00372 #ifndef XP_CPLUSPLUS
00373 typedef enum UErrorCode UErrorCode;
00374 #endif
00375 
00376 /* Use the following to determine if an UErrorCode represents */
00377 /* operational success or failure. */
00378 
00379 #ifdef XP_CPLUSPLUS
00380 
00384     inline UBool U_SUCCESS(UErrorCode code) { return (UBool)(code<=U_ZERO_ERROR); }
00389     inline UBool U_FAILURE(UErrorCode code) { return (UBool)(code>U_ZERO_ERROR); }
00390 #else
00391 
00395 #   define U_SUCCESS(x) ((x)<=U_ZERO_ERROR)
00396 
00400 #   define U_FAILURE(x) ((x)>U_ZERO_ERROR)
00401 #endif
00402 
00408 U_CAPI const char * U_EXPORT2
00409 u_errorName(UErrorCode code);
00410 
00411 #define U_COPYRIGHT_STRING \
00412   " Copyright (C) 2001, International Business Machines Corporation and others. All Rights Reserved. "
00413 
00414 #define U_COPYRIGHT_STRING_LENGTH  128
00415 
00420 typedef void *UMTX;
00421 
00422 /*===========================================================================*/
00423 /* Include header for platform utilies */
00424 /*===========================================================================*/
00425 
00426 #include "unicode/putil.h"
00427 
00428 #endif /* _UTYPES */

Generated at Thu Mar 22 16:12:43 2001 for ICU 1.8 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000