1*0e209d39SAndroid Build Coastguard Worker // © 2016 and later: Unicode, Inc. and others. 2*0e209d39SAndroid Build Coastguard Worker // License & terms of use: http://www.unicode.org/copyright.html 3*0e209d39SAndroid Build Coastguard Worker /* 4*0e209d39SAndroid Build Coastguard Worker ******************************************************************************* 5*0e209d39SAndroid Build Coastguard Worker * Copyright (C) 2000-2011, International Business Machines 6*0e209d39SAndroid Build Coastguard Worker * Corporation and others. All Rights Reserved. 7*0e209d39SAndroid Build Coastguard Worker ******************************************************************************* 8*0e209d39SAndroid Build Coastguard Worker * 9*0e209d39SAndroid Build Coastguard Worker * file name: uversion.h 10*0e209d39SAndroid Build Coastguard Worker * encoding: UTF-8 11*0e209d39SAndroid Build Coastguard Worker * tab size: 8 (not used) 12*0e209d39SAndroid Build Coastguard Worker * indentation:4 13*0e209d39SAndroid Build Coastguard Worker * 14*0e209d39SAndroid Build Coastguard Worker * Created by: Vladimir Weinstein 15*0e209d39SAndroid Build Coastguard Worker * 16*0e209d39SAndroid Build Coastguard Worker * Gets included by utypes.h and Windows .rc files 17*0e209d39SAndroid Build Coastguard Worker */ 18*0e209d39SAndroid Build Coastguard Worker 19*0e209d39SAndroid Build Coastguard Worker /** 20*0e209d39SAndroid Build Coastguard Worker * @addtogroup icu4c ICU4C 21*0e209d39SAndroid Build Coastguard Worker * @{ 22*0e209d39SAndroid Build Coastguard Worker * \file 23*0e209d39SAndroid Build Coastguard Worker * \brief C API: API for accessing ICU version numbers. 24*0e209d39SAndroid Build Coastguard Worker */ 25*0e209d39SAndroid Build Coastguard Worker /*===========================================================================*/ 26*0e209d39SAndroid Build Coastguard Worker /* Main ICU version information */ 27*0e209d39SAndroid Build Coastguard Worker /*===========================================================================*/ 28*0e209d39SAndroid Build Coastguard Worker 29*0e209d39SAndroid Build Coastguard Worker #ifndef UVERSION_H 30*0e209d39SAndroid Build Coastguard Worker #define UVERSION_H 31*0e209d39SAndroid Build Coastguard Worker 32*0e209d39SAndroid Build Coastguard Worker #include "unicode/umachine.h" 33*0e209d39SAndroid Build Coastguard Worker 34*0e209d39SAndroid Build Coastguard Worker /* Actual version info lives in uvernum.h */ 35*0e209d39SAndroid Build Coastguard Worker #include "unicode/uvernum.h" 36*0e209d39SAndroid Build Coastguard Worker 37*0e209d39SAndroid Build Coastguard Worker /** Maximum length of the copyright string. 38*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 39*0e209d39SAndroid Build Coastguard Worker */ 40*0e209d39SAndroid Build Coastguard Worker #define U_COPYRIGHT_STRING_LENGTH 128 41*0e209d39SAndroid Build Coastguard Worker 42*0e209d39SAndroid Build Coastguard Worker /** An ICU version consists of up to 4 numbers from 0..255. 43*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 44*0e209d39SAndroid Build Coastguard Worker */ 45*0e209d39SAndroid Build Coastguard Worker #define U_MAX_VERSION_LENGTH 4 46*0e209d39SAndroid Build Coastguard Worker 47*0e209d39SAndroid Build Coastguard Worker /** In a string, ICU version fields are delimited by dots. 48*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 49*0e209d39SAndroid Build Coastguard Worker */ 50*0e209d39SAndroid Build Coastguard Worker #define U_VERSION_DELIMITER '.' 51*0e209d39SAndroid Build Coastguard Worker 52*0e209d39SAndroid Build Coastguard Worker /** The maximum length of an ICU version string. 53*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 54*0e209d39SAndroid Build Coastguard Worker */ 55*0e209d39SAndroid Build Coastguard Worker #define U_MAX_VERSION_STRING_LENGTH 20 56*0e209d39SAndroid Build Coastguard Worker 57*0e209d39SAndroid Build Coastguard Worker /** The binary form of a version on ICU APIs is an array of 4 uint8_t. 58*0e209d39SAndroid Build Coastguard Worker * To compare two versions, use memcmp(v1,v2,sizeof(UVersionInfo)). 59*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 60*0e209d39SAndroid Build Coastguard Worker */ 61*0e209d39SAndroid Build Coastguard Worker typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]; 62*0e209d39SAndroid Build Coastguard Worker 63*0e209d39SAndroid Build Coastguard Worker /*===========================================================================*/ 64*0e209d39SAndroid Build Coastguard Worker /* C++ namespace if supported. Versioned unless versioning is disabled. */ 65*0e209d39SAndroid Build Coastguard Worker /*===========================================================================*/ 66*0e209d39SAndroid Build Coastguard Worker 67*0e209d39SAndroid Build Coastguard Worker /* Define C++ namespace symbols. */ 68*0e209d39SAndroid Build Coastguard Worker #ifdef __cplusplus 69*0e209d39SAndroid Build Coastguard Worker 70*0e209d39SAndroid Build Coastguard Worker /** 71*0e209d39SAndroid Build Coastguard Worker * \def U_NAMESPACE_BEGIN 72*0e209d39SAndroid Build Coastguard Worker * This is used to begin a declaration of a public ICU C++ API within 73*0e209d39SAndroid Build Coastguard Worker * versioned-ICU-namespace block. 74*0e209d39SAndroid Build Coastguard Worker * 75*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 76*0e209d39SAndroid Build Coastguard Worker */ 77*0e209d39SAndroid Build Coastguard Worker 78*0e209d39SAndroid Build Coastguard Worker /** 79*0e209d39SAndroid Build Coastguard Worker * \def U_NAMESPACE_END 80*0e209d39SAndroid Build Coastguard Worker * This is used to end a declaration of a public ICU C++ API. 81*0e209d39SAndroid Build Coastguard Worker * It ends the versioned-ICU-namespace block begun by U_NAMESPACE_BEGIN. 82*0e209d39SAndroid Build Coastguard Worker * 83*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 84*0e209d39SAndroid Build Coastguard Worker */ 85*0e209d39SAndroid Build Coastguard Worker 86*0e209d39SAndroid Build Coastguard Worker /** 87*0e209d39SAndroid Build Coastguard Worker * \def U_NAMESPACE_USE 88*0e209d39SAndroid Build Coastguard Worker * This is used to specify that the rest of the code uses the 89*0e209d39SAndroid Build Coastguard Worker * public ICU C++ API namespace. 90*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 91*0e209d39SAndroid Build Coastguard Worker */ 92*0e209d39SAndroid Build Coastguard Worker 93*0e209d39SAndroid Build Coastguard Worker /** 94*0e209d39SAndroid Build Coastguard Worker * \def U_NAMESPACE_QUALIFIER 95*0e209d39SAndroid Build Coastguard Worker * This is used to qualify that a function or class is part of 96*0e209d39SAndroid Build Coastguard Worker * the public ICU C++ API namespace. 97*0e209d39SAndroid Build Coastguard Worker * 98*0e209d39SAndroid Build Coastguard Worker * This macro is unnecessary since ICU 49 requires namespace support. 99*0e209d39SAndroid Build Coastguard Worker * You can just use "icu::" instead. 100*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 101*0e209d39SAndroid Build Coastguard Worker */ 102*0e209d39SAndroid Build Coastguard Worker 103*0e209d39SAndroid Build Coastguard Worker # if U_DISABLE_RENAMING 104*0e209d39SAndroid Build Coastguard Worker # define U_ICU_NAMESPACE icu 105*0e209d39SAndroid Build Coastguard Worker namespace U_ICU_NAMESPACE { } 106*0e209d39SAndroid Build Coastguard Worker # else 107*0e209d39SAndroid Build Coastguard Worker # define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu) 108*0e209d39SAndroid Build Coastguard Worker namespace U_ICU_NAMESPACE { } 109*0e209d39SAndroid Build Coastguard Worker namespace icu = U_ICU_NAMESPACE; 110*0e209d39SAndroid Build Coastguard Worker # endif 111*0e209d39SAndroid Build Coastguard Worker 112*0e209d39SAndroid Build Coastguard Worker # define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE { 113*0e209d39SAndroid Build Coastguard Worker # define U_NAMESPACE_END } 114*0e209d39SAndroid Build Coastguard Worker # define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE; 115*0e209d39SAndroid Build Coastguard Worker # define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE:: 116*0e209d39SAndroid Build Coastguard Worker 117*0e209d39SAndroid Build Coastguard Worker # ifndef U_USING_ICU_NAMESPACE 118*0e209d39SAndroid Build Coastguard Worker # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \ 119*0e209d39SAndroid Build Coastguard Worker defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || \ 120*0e209d39SAndroid Build Coastguard Worker defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_TOOLUTIL_IMPLEMENTATION) 121*0e209d39SAndroid Build Coastguard Worker # define U_USING_ICU_NAMESPACE 0 122*0e209d39SAndroid Build Coastguard Worker # else 123*0e209d39SAndroid Build Coastguard Worker # define U_USING_ICU_NAMESPACE 0 124*0e209d39SAndroid Build Coastguard Worker # endif 125*0e209d39SAndroid Build Coastguard Worker # endif 126*0e209d39SAndroid Build Coastguard Worker # if U_USING_ICU_NAMESPACE 127*0e209d39SAndroid Build Coastguard Worker U_NAMESPACE_USE 128*0e209d39SAndroid Build Coastguard Worker # endif 129*0e209d39SAndroid Build Coastguard Worker #endif /* __cplusplus */ 130*0e209d39SAndroid Build Coastguard Worker 131*0e209d39SAndroid Build Coastguard Worker /*===========================================================================*/ 132*0e209d39SAndroid Build Coastguard Worker /* General version helper functions. Definitions in putil.c */ 133*0e209d39SAndroid Build Coastguard Worker /*===========================================================================*/ 134*0e209d39SAndroid Build Coastguard Worker 135*0e209d39SAndroid Build Coastguard Worker 136*0e209d39SAndroid Build Coastguard Worker 137*0e209d39SAndroid Build Coastguard Worker 138*0e209d39SAndroid Build Coastguard Worker 139*0e209d39SAndroid Build Coastguard Worker 140*0e209d39SAndroid Build Coastguard Worker /** 141*0e209d39SAndroid Build Coastguard Worker * Write a string with dotted-decimal version information according 142*0e209d39SAndroid Build Coastguard Worker * to the input UVersionInfo. 143*0e209d39SAndroid Build Coastguard Worker * Definition of this function lives in putil.c 144*0e209d39SAndroid Build Coastguard Worker * 145*0e209d39SAndroid Build Coastguard Worker * @param versionArray The version information to be written as a string. 146*0e209d39SAndroid Build Coastguard Worker * @param versionString A string buffer that will be filled in with 147*0e209d39SAndroid Build Coastguard Worker * a string corresponding to the numeric version 148*0e209d39SAndroid Build Coastguard Worker * information in versionArray. 149*0e209d39SAndroid Build Coastguard Worker * The buffer size must be at least U_MAX_VERSION_STRING_LENGTH. 150*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.4 151*0e209d39SAndroid Build Coastguard Worker */ 152*0e209d39SAndroid Build Coastguard Worker U_CAPI void U_EXPORT2 153*0e209d39SAndroid Build Coastguard Worker u_versionToString(const UVersionInfo versionArray, char *versionString) __INTRODUCED_IN(31); 154*0e209d39SAndroid Build Coastguard Worker 155*0e209d39SAndroid Build Coastguard Worker 156*0e209d39SAndroid Build Coastguard Worker 157*0e209d39SAndroid Build Coastguard Worker /** 158*0e209d39SAndroid Build Coastguard Worker * Gets the ICU release version. The version array stores the version information 159*0e209d39SAndroid Build Coastguard Worker * for ICU. For example, release "1.3.31.2" is then represented as 0x01031F02. 160*0e209d39SAndroid Build Coastguard Worker * Definition of this function lives in putil.c 161*0e209d39SAndroid Build Coastguard Worker * 162*0e209d39SAndroid Build Coastguard Worker * @param versionArray the version # information, the result will be filled in 163*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.0 164*0e209d39SAndroid Build Coastguard Worker */ 165*0e209d39SAndroid Build Coastguard Worker U_CAPI void U_EXPORT2 166*0e209d39SAndroid Build Coastguard Worker u_getVersion(UVersionInfo versionArray) __INTRODUCED_IN(31); 167*0e209d39SAndroid Build Coastguard Worker 168*0e209d39SAndroid Build Coastguard Worker 169*0e209d39SAndroid Build Coastguard Worker #endif 170*0e209d39SAndroid Build Coastguard Worker 171*0e209d39SAndroid Build Coastguard Worker /** @} */ // addtogroup 172