1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/common/unicode/uversion.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,193 @@ 1.4 +/* 1.5 +******************************************************************************* 1.6 +* Copyright (C) 2000-2011, International Business Machines 1.7 +* Corporation and others. All Rights Reserved. 1.8 +******************************************************************************* 1.9 +* 1.10 +* file name: uversion.h 1.11 +* encoding: US-ASCII 1.12 +* tab size: 8 (not used) 1.13 +* indentation:4 1.14 +* 1.15 +* Created by: Vladimir Weinstein 1.16 +* 1.17 +* Gets included by utypes.h and Windows .rc files 1.18 +*/ 1.19 + 1.20 +/** 1.21 + * \file 1.22 + * \brief C API: API for accessing ICU version numbers. 1.23 + */ 1.24 +/*===========================================================================*/ 1.25 +/* Main ICU version information */ 1.26 +/*===========================================================================*/ 1.27 + 1.28 +#ifndef UVERSION_H 1.29 +#define UVERSION_H 1.30 + 1.31 +#include "unicode/umachine.h" 1.32 + 1.33 +/* Actual version info lives in uvernum.h */ 1.34 +#include "unicode/uvernum.h" 1.35 + 1.36 +/** Maximum length of the copyright string. 1.37 + * @stable ICU 2.4 1.38 + */ 1.39 +#define U_COPYRIGHT_STRING_LENGTH 128 1.40 + 1.41 +/** An ICU version consists of up to 4 numbers from 0..255. 1.42 + * @stable ICU 2.4 1.43 + */ 1.44 +#define U_MAX_VERSION_LENGTH 4 1.45 + 1.46 +/** In a string, ICU version fields are delimited by dots. 1.47 + * @stable ICU 2.4 1.48 + */ 1.49 +#define U_VERSION_DELIMITER '.' 1.50 + 1.51 +/** The maximum length of an ICU version string. 1.52 + * @stable ICU 2.4 1.53 + */ 1.54 +#define U_MAX_VERSION_STRING_LENGTH 20 1.55 + 1.56 +/** The binary form of a version on ICU APIs is an array of 4 uint8_t. 1.57 + * To compare two versions, use memcmp(v1,v2,sizeof(UVersionInfo)). 1.58 + * @stable ICU 2.4 1.59 + */ 1.60 +typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]; 1.61 + 1.62 +/*===========================================================================*/ 1.63 +/* C++ namespace if supported. Versioned unless versioning is disabled. */ 1.64 +/*===========================================================================*/ 1.65 + 1.66 +/** 1.67 + * \def U_NAMESPACE_BEGIN 1.68 + * This is used to begin a declaration of a public ICU C++ API. 1.69 + * When not compiling for C++, it does nothing. 1.70 + * When compiling for C++, it begins an extern "C++" linkage block (to protect 1.71 + * against cases in which an external client includes ICU header files inside 1.72 + * an extern "C" linkage block). 1.73 + * 1.74 + * It also begins a versioned-ICU-namespace block. 1.75 + * @stable ICU 2.4 1.76 + */ 1.77 + 1.78 +/** 1.79 + * \def U_NAMESPACE_END 1.80 + * This is used to end a declaration of a public ICU C++ API. 1.81 + * When not compiling for C++, it does nothing. 1.82 + * When compiling for C++, it ends the extern "C++" block begun by 1.83 + * U_NAMESPACE_BEGIN. 1.84 + * 1.85 + * It also ends the versioned-ICU-namespace block begun by U_NAMESPACE_BEGIN. 1.86 + * @stable ICU 2.4 1.87 + */ 1.88 + 1.89 +/** 1.90 + * \def U_NAMESPACE_USE 1.91 + * This is used to specify that the rest of the code uses the 1.92 + * public ICU C++ API namespace. 1.93 + * This is invoked by default; we recommend that you turn it off: 1.94 + * See the "Recommended Build Options" section of the ICU4C readme 1.95 + * (http://source.icu-project.org/repos/icu/icu/trunk/readme.html#RecBuild) 1.96 + * @stable ICU 2.4 1.97 + */ 1.98 + 1.99 +/** 1.100 + * \def U_NAMESPACE_QUALIFIER 1.101 + * This is used to qualify that a function or class is part of 1.102 + * the public ICU C++ API namespace. 1.103 + * 1.104 + * This macro is unnecessary since ICU 49 requires namespace support. 1.105 + * You can just use "icu::" instead. 1.106 + * @stable ICU 2.4 1.107 + */ 1.108 + 1.109 +/* Define namespace symbols if the compiler supports it. */ 1.110 +#ifdef __cplusplus 1.111 +# if U_DISABLE_RENAMING 1.112 +# define U_ICU_NAMESPACE icu 1.113 + namespace U_ICU_NAMESPACE { } 1.114 +# else 1.115 +# define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu) 1.116 + namespace U_ICU_NAMESPACE { } 1.117 + namespace icu = U_ICU_NAMESPACE; 1.118 +# endif 1.119 + 1.120 +# define U_NAMESPACE_BEGIN extern "C++" { namespace U_ICU_NAMESPACE { 1.121 +# define U_NAMESPACE_END } } 1.122 +# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE; 1.123 +# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE:: 1.124 + 1.125 +# ifndef U_USING_ICU_NAMESPACE 1.126 +# define U_USING_ICU_NAMESPACE 1 1.127 +# endif 1.128 +# if U_USING_ICU_NAMESPACE 1.129 + U_NAMESPACE_USE 1.130 +# endif 1.131 +#else 1.132 +# define U_NAMESPACE_BEGIN 1.133 +# define U_NAMESPACE_END 1.134 +# define U_NAMESPACE_USE 1.135 +# define U_NAMESPACE_QUALIFIER 1.136 +#endif 1.137 + 1.138 +/*===========================================================================*/ 1.139 +/* General version helper functions. Definitions in putil.c */ 1.140 +/*===========================================================================*/ 1.141 + 1.142 +/** 1.143 + * Parse a string with dotted-decimal version information and 1.144 + * fill in a UVersionInfo structure with the result. 1.145 + * Definition of this function lives in putil.c 1.146 + * 1.147 + * @param versionArray The destination structure for the version information. 1.148 + * @param versionString A string with dotted-decimal version information, 1.149 + * with up to four non-negative number fields with 1.150 + * values of up to 255 each. 1.151 + * @stable ICU 2.4 1.152 + */ 1.153 +U_STABLE void U_EXPORT2 1.154 +u_versionFromString(UVersionInfo versionArray, const char *versionString); 1.155 + 1.156 +/** 1.157 + * Parse a Unicode string with dotted-decimal version information and 1.158 + * fill in a UVersionInfo structure with the result. 1.159 + * Definition of this function lives in putil.c 1.160 + * 1.161 + * @param versionArray The destination structure for the version information. 1.162 + * @param versionString A Unicode string with dotted-decimal version 1.163 + * information, with up to four non-negative number 1.164 + * fields with values of up to 255 each. 1.165 + * @stable ICU 4.2 1.166 + */ 1.167 +U_STABLE void U_EXPORT2 1.168 +u_versionFromUString(UVersionInfo versionArray, const UChar *versionString); 1.169 + 1.170 + 1.171 +/** 1.172 + * Write a string with dotted-decimal version information according 1.173 + * to the input UVersionInfo. 1.174 + * Definition of this function lives in putil.c 1.175 + * 1.176 + * @param versionArray The version information to be written as a string. 1.177 + * @param versionString A string buffer that will be filled in with 1.178 + * a string corresponding to the numeric version 1.179 + * information in versionArray. 1.180 + * The buffer size must be at least U_MAX_VERSION_STRING_LENGTH. 1.181 + * @stable ICU 2.4 1.182 + */ 1.183 +U_STABLE void U_EXPORT2 1.184 +u_versionToString(const UVersionInfo versionArray, char *versionString); 1.185 + 1.186 +/** 1.187 + * Gets the ICU release version. The version array stores the version information 1.188 + * for ICU. For example, release "1.3.31.2" is then represented as 0x01031F02. 1.189 + * Definition of this function lives in putil.c 1.190 + * 1.191 + * @param versionArray the version # information, the result will be filled in 1.192 + * @stable ICU 2.0 1.193 + */ 1.194 +U_STABLE void U_EXPORT2 1.195 +u_getVersion(UVersionInfo versionArray); 1.196 +#endif