1b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* 2b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru******************************************************************************* 350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho* Copyright (C) 2000-2010, International Business Machines 4b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* Corporation and others. All Rights Reserved. 5b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru******************************************************************************* 6b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 7b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* file name: uversion.h 8b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* encoding: US-ASCII 9b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* tab size: 8 (not used) 10b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* indentation:4 11b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 12b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* Created by: Vladimir Weinstein 13b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 14b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* Gets included by utypes.h and Windows .rc files 15b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*/ 16b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 17b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 18b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \file 1950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * \brief C API: API for accessing ICU version numbers. 20b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 21b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/ 22b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* Main ICU version information */ 23b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/ 24b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 25b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef UVERSION_H 26b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define UVERSION_H 27b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 28b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/umachine.h" 29b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 3050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/* Actual version info lives in uvernum.h */ 3150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#include "unicode/uvernum.h" 32b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 33b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Maximum length of the copyright string. 34b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 35b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 36b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_COPYRIGHT_STRING_LENGTH 128 37b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 38b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** An ICU version consists of up to 4 numbers from 0..255. 39b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 40b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 41b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_MAX_VERSION_LENGTH 4 42b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 43b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** In a string, ICU version fields are delimited by dots. 44b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 45b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 46b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_VERSION_DELIMITER '.' 47b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 48b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** The maximum length of an ICU version string. 49b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 50b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 51b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_MAX_VERSION_STRING_LENGTH 20 52b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 53b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** The binary form of a version on ICU APIs is an array of 4 uint8_t. 5450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * To compare two versions, use memcmp(v1,v2,sizeof(UVersionInfo)). 55b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 56b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 57b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]; 58b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 59b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/ 60b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* C++ namespace if supported. Versioned unless versioning is disabled. */ 61b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/ 62b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 63b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 64b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_NAMESPACE_BEGIN 65b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This is used to begin a declaration of a public ICU C++ API. 6650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * When not compiling for C++, it does nothing. 6750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * When compiling for C++, it begins an extern "C++" linkage block (to protect 6850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * against cases in which an external client includes ICU header files inside 6950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * an extern "C" linkage block). 7050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * If the C++ compiler supports namespaces, it also begins a namespace block. 71b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 72b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 73b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 74b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 75b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_NAMESPACE_END 7650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * This is used to end a declaration of a public ICU C++ API. 7750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * When not compiling for C++, it does nothing. 7850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * When compiling for C++, it ends the extern "C++" block begun by 7950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * U_NAMESPACE_BEGIN. 8050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * If the C++ compiler supports namespaces, it also ends the namespace block 8150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * begun by U_NAMESPACE_BEGIN. 82b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 83b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 84b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 85b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 86b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_NAMESPACE_USE 87b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This is used to specify that the rest of the code uses the 88b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * public ICU C++ API namespace. 89b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If the compiler doesn't support namespaces, this does nothing. 90b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 91b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 92b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 93b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 94b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \def U_NAMESPACE_QUALIFIER 95b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This is used to qualify that a function or class is part of 96b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the public ICU C++ API namespace. 97b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If the compiler doesn't support namespaces, this does nothing. 98b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 99b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 100b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 101b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* Define namespace symbols if the compiler supports it. */ 10250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#ifdef XP_CPLUSPLUS 10350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#if U_HAVE_NAMESPACE 104b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# if U_DISABLE_RENAMING 105b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# define U_ICU_NAMESPACE icu 106b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru namespace U_ICU_NAMESPACE { } 107b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# else 10850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho# define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu) 109b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru namespace U_ICU_NAMESPACE { } 110b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru namespace icu = U_ICU_NAMESPACE; 111b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# endif 112b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 11350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho# define U_NAMESPACE_BEGIN extern "C++" { namespace U_ICU_NAMESPACE { 11450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho# define U_NAMESPACE_END } } 115b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE; 116b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE:: 117b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 118b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# ifndef U_USING_ICU_NAMESPACE 119b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# define U_USING_ICU_NAMESPACE 1 120b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# endif 121b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# if U_USING_ICU_NAMESPACE 122b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru U_NAMESPACE_USE 123b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# endif 124b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#else 12550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho# define U_NAMESPACE_BEGIN extern "C++" { 12650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho# define U_NAMESPACE_END } 12750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho# define U_NAMESPACE_USE 12850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho# define U_NAMESPACE_QUALIFIER 12950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#endif 13050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#else 131b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# define U_NAMESPACE_BEGIN 132b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# define U_NAMESPACE_END 133b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# define U_NAMESPACE_USE 134b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru# define U_NAMESPACE_QUALIFIER 135b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif 136b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 137b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/ 138b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* General version helper functions. Definitions in putil.c */ 139b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*===========================================================================*/ 140b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 141b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 142b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Parse a string with dotted-decimal version information and 143b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * fill in a UVersionInfo structure with the result. 144b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Definition of this function lives in putil.c 145b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 146b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param versionArray The destination structure for the version information. 147b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param versionString A string with dotted-decimal version information, 148b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * with up to four non-negative number fields with 149b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * values of up to 255 each. 150b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 151b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 152b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 153b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruu_versionFromString(UVersionInfo versionArray, const char *versionString); 154b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 155b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 156b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Parse a Unicode string with dotted-decimal version information and 157b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * fill in a UVersionInfo structure with the result. 158b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Definition of this function lives in putil.c 159b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * 160b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param versionArray The destination structure for the version information. 161b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param versionString A Unicode string with dotted-decimal version 162b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * information, with up to four non-negative number 163b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * fields with values of up to 255 each. 16450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @stable ICU 4.2 165b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */ 166b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste QueruU_STABLE void U_EXPORT2 167b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queruu_versionFromUString(UVersionInfo versionArray, const UChar *versionString); 168b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru 16950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho 170b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/** 171b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Write a string with dotted-decimal version information according 172b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to the input UVersionInfo. 173b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Definition of this function lives in putil.c 174b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 175b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param versionArray The version information to be written as a string. 176b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param versionString A string buffer that will be filled in with 177b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * a string corresponding to the numeric version 178b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * information in versionArray. 179b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The buffer size must be at least U_MAX_VERSION_STRING_LENGTH. 180b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 181b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 182b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 183b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruu_versionToString(UVersionInfo versionArray, char *versionString); 184b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 185b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 186b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Gets the ICU release version. The version array stores the version information 187b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * for ICU. For example, release "1.3.31.2" is then represented as 0x01031F02. 188b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Definition of this function lives in putil.c 189b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * 190b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param versionArray the version # information, the result will be filled in 191b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 192b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 193b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2 194b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruu_getVersion(UVersionInfo versionArray); 195b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif 196