Home | History | Annotate | Download | only in unicode
      1 /*
      2 *******************************************************************************
      3 *   Copyright (C) 2000-2009, International Business Machines
      4 *   Corporation and others.  All Rights Reserved.
      5 *******************************************************************************
      6 *
      7 *   file name:  uversion.h
      8 *   encoding:   US-ASCII
      9 *   tab size:   8 (not used)
     10 *   indentation:4
     11 *
     12 *   Created by: Vladimir Weinstein
     13 *
     14 *  Contains all the important version numbers for ICU.
     15 *  Gets included by utypes.h and Windows .rc files
     16 */
     17 
     18 /**
     19  * \file
     20  * \brief C API: Contains all the important version numbers for ICU.
     21  */
     22 /*===========================================================================*/
     23 /* Main ICU version information                                              */
     24 /*===========================================================================*/
     25 
     26 #ifndef UVERSION_H
     27 #define UVERSION_H
     28 
     29 /**
     30  * IMPORTANT: When updating version, the following things need to be done:
     31  * source/common/unicode/uversion.h - this file: update major, minor,
     32  *        patchlevel, suffix, version, short version constants, namespace,
     33  *                                                             and copyright
     34  * source/common/common.vcproj - update 'Output file name' on the link tab so
     35  *                   that it contains the new major/minor combination
     36  * source/i18n/i18n.vcproj - same as for the common.vcproj
     37  * source/layout/layout.vcproj - same as for the common.vcproj
     38  * source/layoutex/layoutex.vcproj - same
     39  * source/stubdata/stubdata.vcproj - same as for the common.vcproj
     40  * source/io/io.vcproj - same as for the common.vcproj
     41  * source/data/makedata.mak - change U_ICUDATA_NAME so that it contains
     42  *                            the new major/minor combination
     43  * source/tools/genren/genren.pl - use this script according to the README
     44  *                    in that folder
     45  */
     46 
     47 #include "unicode/umachine.h"
     48 
     49 /** The standard copyright notice that gets compiled into each library.
     50  *  This value will change in the subsequent releases of ICU
     51  *  @stable ICU 2.4
     52  */
     53 #define U_COPYRIGHT_STRING \
     54   " Copyright (C) 2009, International Business Machines Corporation and others. All Rights Reserved. "
     55 
     56 /** Maximum length of the copyright string.
     57  *  @stable ICU 2.4
     58  */
     59 #define U_COPYRIGHT_STRING_LENGTH  128
     60 
     61 /** The current ICU major version as an integer.
     62  *  This value will change in the subsequent releases of ICU
     63  *  @stable ICU 2.4
     64  */
     65 #define U_ICU_VERSION_MAJOR_NUM 4
     66 
     67 /** The current ICU minor version as an integer.
     68  *  This value will change in the subsequent releases of ICU
     69  *  @stable ICU 2.6
     70  */
     71 #define U_ICU_VERSION_MINOR_NUM 2
     72 
     73 /** The current ICU patchlevel version as an integer.
     74  *  This value will change in the subsequent releases of ICU
     75  *  @stable ICU 2.4
     76  */
     77 #define U_ICU_VERSION_PATCHLEVEL_NUM 1
     78 
     79 /** The current ICU build level version as an integer.
     80  *  This value is for use by ICU clients. It defaults to 0.
     81  *  @stable ICU 4.0
     82  */
     83 #ifndef U_ICU_VERSION_BUILDLEVEL_NUM
     84 #define U_ICU_VERSION_BUILDLEVEL_NUM 0
     85 #endif
     86 
     87 /** Glued version suffix for renamers
     88  *  This value will change in the subsequent releases of ICU
     89  *  @stable ICU 2.6
     90  */
     91 #define U_ICU_VERSION_SUFFIX _4_2
     92 
     93 /** The current ICU library version as a dotted-decimal string. The patchlevel and buildlevel
     94  *  only appears in this string if it non-zero.
     95  *  This value will change in the subsequent releases of ICU
     96  *  @stable ICU 2.4
     97  */
     98 #define U_ICU_VERSION "4.2.1"
     99 
    100 /** The current ICU library major/minor version as a string without dots, for library name suffixes.
    101  *  This value will change in the subsequent releases of ICU
    102  *  @stable ICU 2.6
    103  */
    104 #define U_ICU_VERSION_SHORT "42"
    105 
    106 /** An ICU version consists of up to 4 numbers from 0..255.
    107  *  @stable ICU 2.4
    108  */
    109 #define U_MAX_VERSION_LENGTH 4
    110 
    111 /** In a string, ICU version fields are delimited by dots.
    112  *  @stable ICU 2.4
    113  */
    114 #define U_VERSION_DELIMITER '.'
    115 
    116 /** The maximum length of an ICU version string.
    117  *  @stable ICU 2.4
    118  */
    119 #define U_MAX_VERSION_STRING_LENGTH 20
    120 
    121 /** The binary form of a version on ICU APIs is an array of 4 uint8_t.
    122  *  @stable ICU 2.4
    123  */
    124 typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
    125 
    126 /*===========================================================================*/
    127 /* C++ namespace if supported. Versioned unless versioning is disabled.      */
    128 /*===========================================================================*/
    129 
    130 /**
    131  * \def U_NAMESPACE_BEGIN
    132  * This is used to begin a declaration of a public ICU C++ API.
    133  * If the compiler doesn't support namespaces, this does nothing.
    134  * @stable ICU 2.4
    135  */
    136 
    137 /**
    138  * \def U_NAMESPACE_END
    139  * This is used to end a declaration of a public ICU C++ API
    140  * If the compiler doesn't support namespaces, this does nothing.
    141  * @stable ICU 2.4
    142  */
    143 
    144 /**
    145  * \def U_NAMESPACE_USE
    146  * This is used to specify that the rest of the code uses the
    147  * public ICU C++ API namespace.
    148  * If the compiler doesn't support namespaces, this does nothing.
    149  * @stable ICU 2.4
    150  */
    151 
    152 /**
    153  * \def U_NAMESPACE_QUALIFIER
    154  * This is used to qualify that a function or class is part of
    155  * the public ICU C++ API namespace.
    156  * If the compiler doesn't support namespaces, this does nothing.
    157  * @stable ICU 2.4
    158  */
    159 
    160 /* Define namespace symbols if the compiler supports it. */
    161 #if U_HAVE_NAMESPACE && defined(XP_CPLUSPLUS)
    162 #   if U_DISABLE_RENAMING
    163 #       define U_ICU_NAMESPACE icu
    164         namespace U_ICU_NAMESPACE { }
    165 #   else
    166 #       define U_ICU_NAMESPACE icu_4_2
    167         namespace U_ICU_NAMESPACE { }
    168         namespace icu = U_ICU_NAMESPACE;
    169 #   endif
    170 
    171 #   define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE {
    172 #   define U_NAMESPACE_END  }
    173 #   define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
    174 #   define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
    175 
    176 #   ifndef U_USING_ICU_NAMESPACE
    177         /* Chrome-specific: Set to 0 to force namespace
    178            declarations in Chrome ICU usage. */
    179 #       define U_USING_ICU_NAMESPACE 0
    180 #   endif
    181 #   if U_USING_ICU_NAMESPACE
    182         U_NAMESPACE_USE
    183 #   endif
    184 #else
    185 #   define U_NAMESPACE_BEGIN
    186 #   define U_NAMESPACE_END
    187 #   define U_NAMESPACE_USE
    188 #   define U_NAMESPACE_QUALIFIER
    189 #endif
    190 
    191 
    192 /*===========================================================================*/
    193 /* General version helper functions. Definitions in putil.c                  */
    194 /*===========================================================================*/
    195 
    196 /**
    197  * Parse a string with dotted-decimal version information and
    198  * fill in a UVersionInfo structure with the result.
    199  * Definition of this function lives in putil.c
    200  *
    201  * @param versionArray The destination structure for the version information.
    202  * @param versionString A string with dotted-decimal version information,
    203  *                      with up to four non-negative number fields with
    204  *                      values of up to 255 each.
    205  * @stable ICU 2.4
    206  */
    207 U_STABLE void U_EXPORT2
    208 u_versionFromString(UVersionInfo versionArray, const char *versionString);
    209 
    210 /**
    211  * Parse a Unicode string with dotted-decimal version information and
    212  * fill in a UVersionInfo structure with the result.
    213  * Definition of this function lives in putil.c
    214  *
    215  * @param versionArray The destination structure for the version information.
    216  * @param versionString A Unicode string with dotted-decimal version
    217  *                      information, with up to four non-negative number
    218  *                      fields with values of up to 255 each.
    219  * @draft ICU 4.2
    220  */
    221 U_STABLE void U_EXPORT2
    222 u_versionFromUString(UVersionInfo versionArray, const UChar *versionString);
    223 
    224 /**
    225  * Write a string with dotted-decimal version information according
    226  * to the input UVersionInfo.
    227  * Definition of this function lives in putil.c
    228  *
    229  * @param versionArray The version information to be written as a string.
    230  * @param versionString A string buffer that will be filled in with
    231  *                      a string corresponding to the numeric version
    232  *                      information in versionArray.
    233  *                      The buffer size must be at least U_MAX_VERSION_STRING_LENGTH.
    234  * @stable ICU 2.4
    235  */
    236 U_STABLE void U_EXPORT2
    237 u_versionToString(UVersionInfo versionArray, char *versionString);
    238 
    239 /**
    240  * Gets the ICU release version.  The version array stores the version information
    241  * for ICU.  For example, release "1.3.31.2" is then represented as 0x01031F02.
    242  * Definition of this function lives in putil.c
    243  *
    244  * @param versionArray the version # information, the result will be filled in
    245  * @stable ICU 2.0
    246  */
    247 U_STABLE void U_EXPORT2
    248 u_getVersion(UVersionInfo versionArray);
    249 
    250 /**
    251  * Compare two version numbers, v1 and v2, numerically.
    252  * Returns 0 if v1 == v2
    253  * Returns -1 if v1 < v2  (v1 is older, v2 is newer)
    254  * Returns +1 if v1 > v2  (v1 is newer, v2 is older)
    255  * @param v1 version to compare
    256  * @param v2 version to compare
    257  * @return comparison result
    258  * @draft ICU 4.2
    259  */
    260 U_STABLE int32_t U_EXPORT2
    261 u_compareVersions(UVersionInfo v1, UVersionInfo v2);
    262 
    263 
    264 /*===========================================================================
    265  * ICU collation framework version information
    266  * Version info that can be obtained from a collator is affected by these
    267  * numbers in a secret and magic way. Please use collator version as whole
    268  *===========================================================================
    269  */
    270 
    271 /** Collation runtime version (sort key generator, strcoll).
    272  * If the version is different, sortkeys for the same string could be different
    273  * version 2 was in ICU 1.8.1. changed is: compression intervals, French secondary
    274  * compression, generating quad level always when strength is quad or more
    275  * version 4 - ICU 2.2 - tracking UCA changes, ignore completely ignorables
    276  * in contractions, ignore primary ignorables after shifted
    277  * version 5 - ICU 2.8 - changed implicit generation code
    278  * version 6 - ICU 3.4 - with the UCA 4.1, Thai tag is no longer generated or used
    279  * This value may change in the subsequent releases of ICU
    280  * @stable ICU 2.4
    281  */
    282 #define UCOL_RUNTIME_VERSION 6
    283 
    284 /** Builder code version. When this is different, same tailoring might result
    285  * in assigning different collation elements to code points
    286  * version 2 was in ICU 1.8.1. added support for prefixes, tweaked canonical
    287  * closure. However, the tailorings should probably get same CEs assigned
    288  * version 5 - ICU 2.2 - fixed some bugs, renamed some indirect values.
    289  * version 6 - ICU 2.8 - fixed bug in builder that allowed 0xFF in primary values
    290  * version 7 - ICU 3.4 - with the UCA 4.1 Thai tag is no longer processed, complete ignorables
    291  *                       now break contractions
    292  * Backward compatible with the old rules.
    293  * This value may change in the subsequent releases of ICU
    294  * @stable ICU 2.4
    295  */
    296 #define UCOL_BUILDER_VERSION 7
    297 
    298 /** This is the version of the tailorings
    299  *  This value may change in the subsequent releases of ICU
    300  *  @stable ICU 2.4
    301  */
    302 #define UCOL_TAILORINGS_VERSION 1
    303 
    304 #endif
    305