Main Page   Class Hierarchy   Compound List   File List   Header Files   Sources   Compound Members   File Members  

utypes.h

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 
00038 #include <memory.h>
00039 #include <stdlib.h>
00040 
00041 /*===========================================================================*/
00042 /* char Character set family                                                 */
00043 /*===========================================================================*/
00044 
00045 /*
00046  * These definitions allow to specify the encoding of text
00047  * in the char data type as defined by the platform and the compiler.
00048  * It is enough to determine the code point values of "invariant characters",
00049  * which are the ones shared by all encodings that are in use
00050  * on a given platform.
00051  *
00052  * Those "invariant characters" should be all the uppercase and lowercase
00053  * latin letters, the digits, the space, and "basic punctuation".
00054  * Also, '\n', '\r', '\t' should be available.
00055  *
00056  * The list of "invariant characters" is:
00057  *    A-Z  a-z  0-9  SPACE  "  %  &  '  (  )  *  +  ,  -  .  /  :  ;  <  =  >  ?  _
00058  * (52 letters + 10 numbers + 20 punc/sym = 82 total)
00059  *
00060  * In other words, all the graphic characters in 7-bit ASCII should
00061  * be safely accessible except the following:
00062  * 
00063  *    '\' <backslash>
00064  *    '[' <left bracket>
00065  *    ']' <right bracket>
00066  *    '{' <left brace>
00067  *    '}' <right brace>
00068  *    '^' <circumflex>
00069  *    '~' <tilde>
00070  *    '!' <exclamation mark>
00071  *    '#' <number sign>
00072  *    '|' <vertical line>
00073  *    '$' <dollar sign>
00074  *    '@' <commercial at>
00075  *    '`' <grave accent>
00076  */
00077 
00078 #define U_ASCII_FAMILY 0
00079 #define U_EBCDIC_FAMILY 1
00080 
00081 #ifndef U_CHARSET_FAMILY
00082 #   define U_CHARSET_FAMILY 0
00083 #endif
00084 
00085 /*===========================================================================*/
00086 /* Related version information                                               */
00087 /*===========================================================================*/
00088 #define U_ICU_VERSION "1.6"
00089 
00090 #define U_MAX_VERSION_LENGTH 4
00091 #define U_VERSION_DELIMITER '.'
00092 #define U_MAX_VERSION_STRING_LENGTH 20
00093 
00094 typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
00095 
00096 /* Work around the OS390 compiler issue, to be removed when the compiler 
00097 updates come out.  */
00098 #if defined(OS390) && defined(XP_CPLUSPLUS)
00099 #    define U_CALLCONV __cdecl
00100 #else
00101 #    define U_CALLCONV 
00102 #endif
00103 
00104 /* Define NULL (the wrong way, cast to void *) if it does not exist. */
00105 #ifndef NULL
00106 #ifdef XP_CPLUSPLUS
00107 #define NULL    0
00108 #else
00109 #define NULL    ((void *)0)
00110 #endif
00111 #endif
00112 
00113 /* Maximum value of a (void*) - use to indicate the limit of
00114    an 'infinite' buffer.  */
00115 #ifndef U_MAX_PTR
00116 #define U_MAX_PTR ((void*)-1)
00117 #endif
00118 
00119 /*===========================================================================*/
00120 /* Calendar/TimeZone data types                                              */
00121 /*===========================================================================*/
00122 
00129 typedef double UDate;
00130 
00131 /* Common time manipulation constants */
00132 #define U_MILLIS_PER_SECOND        (1000)
00133 #define U_MILLIS_PER_MINUTE       (60000)
00134 #define U_MILLIS_PER_HOUR       (3600000)
00135 #define U_MILLIS_PER_DAY       (86400000)
00136 
00137 
00138 /*===========================================================================*/
00139 /* UClassID-based RTTI */
00140 /*===========================================================================*/
00141 
00179 typedef void* UClassID;
00180 
00181 /*===========================================================================*/
00182 /* Shared library/DLL import-export API control                              */
00183 /*===========================================================================*/
00184 
00191 #ifdef U_COMMON_IMPLEMENTATION
00192 #define U_COMMON_API  U_EXPORT
00193 #define U_I18N_API    U_IMPORT
00194 #elif defined(U_I18N_IMPLEMENTATION)
00195 #define U_COMMON_API  U_IMPORT
00196 #define U_I18N_API    U_EXPORT
00197 #else
00198 #define U_COMMON_API  U_IMPORT
00199 #define U_I18N_API    U_IMPORT
00200 #endif
00201 /*===========================================================================*/
00202 /* UErrorCode */
00203 /*===========================================================================*/
00204 
00208 enum UErrorCode {
00209     U_ERROR_INFO_START        = -128,     /* Start of information results (semantically successful) */
00210     U_USING_FALLBACK_ERROR    = -128,
00211     U_USING_DEFAULT_ERROR     = -127,
00212     U_ERROR_INFO_LIMIT,
00213 
00215     U_ZERO_ERROR              =  0,             
00216 
00217     U_ILLEGAL_ARGUMENT_ERROR  =  1,       /* Start of codes indicating failure */
00218     U_MISSING_RESOURCE_ERROR  =  2,
00219     U_INVALID_FORMAT_ERROR    =  3,
00220     U_FILE_ACCESS_ERROR       =  4,
00221     U_INTERNAL_PROGRAM_ERROR  =  5,       /* Indicates a bug in the library code */
00222     U_MESSAGE_PARSE_ERROR     =  6,
00223     U_MEMORY_ALLOCATION_ERROR =  7,       /* Memory allocation error */
00224     U_INDEX_OUTOFBOUNDS_ERROR =  8,
00225     U_PARSE_ERROR             =  9,       /* Equivalent to Java ParseException */
00226     U_INVALID_CHAR_FOUND      = 10,       /* In the Character conversion routines: Invalid character or sequence was encountered*/
00227     U_TRUNCATED_CHAR_FOUND    = 11,       /* In the Character conversion routines: More bytes are required to complete the conversion successfully*/
00228     U_ILLEGAL_CHAR_FOUND      = 12,       /* In codeset conversion: a sequence that does NOT belong in the codepage has been encountered*/
00229     U_INVALID_TABLE_FORMAT    = 13,       /* Conversion table file found, but corrupted*/
00230     U_INVALID_TABLE_FILE      = 14,       /* Conversion table file not found*/
00231     U_BUFFER_OVERFLOW_ERROR   = 15,       /* A result would not fit in the supplied buffer */
00232     U_UNSUPPORTED_ERROR       = 16,       /* Requested operation not supported in current context */
00233     U_RESOURCE_TYPE_MISMATCH  = 17,       /* an operation is requested over a resource that does not support it*/
00234     U_ERROR_LIMIT
00235 };
00236 
00237 #ifndef XP_CPLUSPLUS
00238 typedef enum UErrorCode UErrorCode;
00239 #endif
00240 
00241 /* Use the following to determine if an UErrorCode represents */
00242 /* operational success or failure. */
00243 #ifdef XP_CPLUSPLUS
00245 inline UBool U_SUCCESS(UErrorCode code) { return (UBool)(code<=U_ZERO_ERROR); }
00247 inline UBool U_FAILURE(UErrorCode code) { return (UBool)(code>U_ZERO_ERROR); }
00248 #else
00250 #define U_SUCCESS(x) ((x)<=U_ZERO_ERROR)
00252 #define U_FAILURE(x) ((x)>U_ZERO_ERROR)
00253 #endif
00254 
00260 U_CAPI const char * U_EXPORT2
00261 u_errorName(UErrorCode code);
00262 
00263 #define U_COPYRIGHT_STRING \
00264   " Copyright (C) 2000, International Business Machines Corporation and others.  All Rights Reserved. "
00265 
00266 #define U_COPYRIGHT_STRING_LENGTH  160
00267 
00268 /*===========================================================================*/
00269 /* Include header for platform utilies */
00270 /*===========================================================================*/
00271 
00272 
00273 
00274 /* Mutex data type.  INTERNAL.*/
00275 typedef void *UMTX;
00276 
00277 
00278 #include "unicode/putil.h"
00279 
00280 #endif /* _UTYPES */

Generated at Wed Aug 16 16:05:39 2000 for ICU1.6 by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999