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-1999, 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 
00089 #define U_ASCII_FAMILY 0
00090 #define U_EBCDIC_FAMILY 1
00091 
00092 #ifndef U_CHARSET_FAMILY
00093 #   define U_CHARSET_FAMILY 0
00094 #endif
00095 
00096 /*===========================================================================*/
00097 /* Related version information                                               */
00098 /*===========================================================================*/
00099 
00101 #define U_ICU_VERSION "1.7"
00102 
00104 #define U_ICU_VERSION_SHORT "17"
00105 
00107 #define U_MAX_VERSION_LENGTH 4
00108 
00110 #define U_VERSION_DELIMITER '.'
00111 
00113 #define U_MAX_VERSION_STRING_LENGTH 20
00114 
00116 typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
00117 
00118 /*===========================================================================*/
00119 /* ICUDATA naming scheme                                                     */
00120 /*===========================================================================*/
00121 
00131 #if U_CHARSET_FAMILY
00132 #   if U_IS_BIG_ENDIAN
00133    /* EBCDIC - should always be BE */
00134 #     define U_ICUDATA_TYPE_LETTER "e"
00135 #   else
00136 #     error "Don't know what to do with little endian EBCDIC!"
00137 #     define U_ICUDATA_TYPE_LETTER "x"
00138 #   endif
00139 #else
00140 #   if U_IS_BIG_ENDIAN
00141       /* Big-endian ASCII */
00142 #     define U_ICUDATA_TYPE_LETTER "b"
00143 #   else
00144           /* Little-endian ASCII */
00145 #     define U_ICUDATA_TYPE_LETTER "l"
00146 #   endif
00147 #endif
00148 
00151 #define U_ICUDATA_NAME    "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
00152 
00158 #if defined(OS390) && defined(XP_CPLUSPLUS)
00159 #    define U_CALLCONV __cdecl
00160 #else
00161 #    define U_CALLCONV 
00162 #endif
00163 
00168 #ifndef NULL
00169 #ifdef XP_CPLUSPLUS
00170 #define NULL    0
00171 #else
00172 #define NULL    ((void *)0)
00173 #endif
00174 #endif
00175 
00180 #ifndef U_MAX_PTR
00181 #define U_MAX_PTR ((void*)-1)
00182 #endif
00183 
00184 /*===========================================================================*/
00185 /* Calendar/TimeZone data types                                              */
00186 /*===========================================================================*/
00187 
00194 typedef double UDate;
00195 
00196 /* Common time manipulation constants */
00197 #define U_MILLIS_PER_SECOND        (1000)
00198 #define U_MILLIS_PER_MINUTE       (60000)
00199 #define U_MILLIS_PER_HOUR       (3600000)
00200 #define U_MILLIS_PER_DAY       (86400000)
00201 
00202 
00203 /*===========================================================================*/
00204 /* UClassID-based RTTI */
00205 /*===========================================================================*/
00206 
00249 typedef void* UClassID;
00250 
00251 /*===========================================================================*/
00252 /* Shared library/DLL import-export API control                              */
00253 /*===========================================================================*/
00254 
00255 /*
00256  * Control of symbol import/export.
00257  * The ICU is separated into two libraries.
00258  */
00259 
00278 #ifdef U_COMMON_IMPLEMENTATION
00279 #define U_COMMON_API  U_EXPORT
00280 #define U_I18N_API    U_IMPORT
00281 #define U_LAYOUT_API  U_IMPORT
00282 #elif defined(U_I18N_IMPLEMENTATION)
00283 #define U_COMMON_API  U_IMPORT
00284 #define U_I18N_API    U_EXPORT
00285 #define U_LAYOUT_API  U_IMPORT
00286 #elif defined(U_LAYOUT_IMPLEMENTATION)
00287 #define U_COMMON_API  U_IMPORT
00288 #define U_I18N_API    U_IMPORT
00289 #define U_LAYOUT_API  U_EXPORT
00290 #else
00291 #define U_COMMON_API  U_IMPORT
00292 #define U_I18N_API    U_IMPORT
00293 #define U_LAYOUT_API  U_IMPORT
00294 #endif
00295 
00300 #ifdef __cplusplus
00301 #define U_STANDARD_CPP_NAMESPACE        ::
00302 #else
00303 #define U_STANDARD_CPP_NAMESPACE
00304 #endif
00305 
00306 /*===========================================================================*/
00307 /* UErrorCode */
00308 /*===========================================================================*/
00309 
00323 enum UErrorCode {
00324     U_ERROR_INFO_START        = -128,   
00325     U_USING_FALLBACK_ERROR    = -128,   
00326     U_USING_DEFAULT_ERROR     = -127,   
00327     U_ERROR_INFO_LIMIT,                 
00329     U_ZERO_ERROR              =  0,     
00331     U_ILLEGAL_ARGUMENT_ERROR  =  1,     
00332     U_MISSING_RESOURCE_ERROR  =  2,
00333     U_INVALID_FORMAT_ERROR    =  3,
00334     U_FILE_ACCESS_ERROR       =  4,
00335     U_INTERNAL_PROGRAM_ERROR  =  5,     
00336     U_MESSAGE_PARSE_ERROR     =  6,
00337     U_MEMORY_ALLOCATION_ERROR =  7,     
00338     U_INDEX_OUTOFBOUNDS_ERROR =  8,
00339     U_PARSE_ERROR             =  9,     
00340     U_INVALID_CHAR_FOUND      = 10,     
00341     U_TRUNCATED_CHAR_FOUND    = 11,     
00342     U_ILLEGAL_CHAR_FOUND      = 12,     
00343     U_INVALID_TABLE_FORMAT    = 13,     
00344     U_INVALID_TABLE_FILE      = 14,     
00345     U_BUFFER_OVERFLOW_ERROR   = 15,     
00346     U_UNSUPPORTED_ERROR       = 16,     
00347     U_RESOURCE_TYPE_MISMATCH  = 17,     
00348     U_ILLEGAL_ESCAPE_SEQUENCE = 18,     
00349     U_UNSUPPORTED_ESCAPE_SEQUENCE = 19, 
00350     U_ERROR_LIMIT                       
00351 };
00352 
00353 #ifndef XP_CPLUSPLUS
00354 typedef enum UErrorCode UErrorCode;
00355 #endif
00356 
00357 /* Use the following to determine if an UErrorCode represents */
00358 /* operational success or failure. */
00359 
00360 #ifdef XP_CPLUSPLUS
00361 
00365     inline UBool U_SUCCESS(UErrorCode code) { return (UBool)(code<=U_ZERO_ERROR); }
00370     inline UBool U_FAILURE(UErrorCode code) { return (UBool)(code>U_ZERO_ERROR); }
00371 #else
00372 
00376 #   define U_SUCCESS(x) ((x)<=U_ZERO_ERROR)
00377 
00381 #   define U_FAILURE(x) ((x)>U_ZERO_ERROR)
00382 #endif
00383 
00389 U_CAPI const char * U_EXPORT2
00390 u_errorName(UErrorCode code);
00391 
00392 #define U_COPYRIGHT_STRING \
00393   " Copyright (C) 2000, International Business Machines Corporation and others.  All Rights Reserved. "
00394 
00395 #define U_COPYRIGHT_STRING_LENGTH  160
00396 
00401 typedef void *UMTX;
00402 
00403 /*===========================================================================*/
00404 /* Include header for platform utilies */
00405 /*===========================================================================*/
00406 
00407 #include "unicode/putil.h"
00408 
00409 #endif /* _UTYPES */

Generated at Fri Dec 15 12:12:39 2000 for ICU 1.7 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000