|
||||
File indexing completed on 2025-01-18 10:13:16
0001 // © 2016 and later: Unicode, Inc. and others. 0002 // License & terms of use: http://www.unicode.org/copyright.html 0003 /* 0004 ******************************************************************************* 0005 * Copyright (C) 2000-2011, International Business Machines 0006 * Corporation and others. All Rights Reserved. 0007 ******************************************************************************* 0008 * 0009 * file name: uversion.h 0010 * encoding: UTF-8 0011 * tab size: 8 (not used) 0012 * indentation:4 0013 * 0014 * Created by: Vladimir Weinstein 0015 * 0016 * Gets included by utypes.h and Windows .rc files 0017 */ 0018 0019 /** 0020 * \file 0021 * \brief C API: API for accessing ICU version numbers. 0022 */ 0023 /*===========================================================================*/ 0024 /* Main ICU version information */ 0025 /*===========================================================================*/ 0026 0027 #ifndef UVERSION_H 0028 #define UVERSION_H 0029 0030 #include "unicode/umachine.h" 0031 0032 /* Actual version info lives in uvernum.h */ 0033 #include "unicode/uvernum.h" 0034 0035 /** Maximum length of the copyright string. 0036 * @stable ICU 2.4 0037 */ 0038 #define U_COPYRIGHT_STRING_LENGTH 128 0039 0040 /** An ICU version consists of up to 4 numbers from 0..255. 0041 * @stable ICU 2.4 0042 */ 0043 #define U_MAX_VERSION_LENGTH 4 0044 0045 /** In a string, ICU version fields are delimited by dots. 0046 * @stable ICU 2.4 0047 */ 0048 #define U_VERSION_DELIMITER '.' 0049 0050 /** The maximum length of an ICU version string. 0051 * @stable ICU 2.4 0052 */ 0053 #define U_MAX_VERSION_STRING_LENGTH 20 0054 0055 /** The binary form of a version on ICU APIs is an array of 4 uint8_t. 0056 * To compare two versions, use memcmp(v1,v2,sizeof(UVersionInfo)). 0057 * @stable ICU 2.4 0058 */ 0059 typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]; 0060 0061 /*===========================================================================*/ 0062 /* C++ namespace if supported. Versioned unless versioning is disabled. */ 0063 /*===========================================================================*/ 0064 0065 /* Define C++ namespace symbols. */ 0066 #ifdef __cplusplus 0067 0068 /** 0069 * \def U_NAMESPACE_BEGIN 0070 * This is used to begin a declaration of a public ICU C++ API within 0071 * versioned-ICU-namespace block. 0072 * 0073 * @stable ICU 2.4 0074 */ 0075 0076 /** 0077 * \def U_NAMESPACE_END 0078 * This is used to end a declaration of a public ICU C++ API. 0079 * It ends the versioned-ICU-namespace block begun by U_NAMESPACE_BEGIN. 0080 * 0081 * @stable ICU 2.4 0082 */ 0083 0084 /** 0085 * \def U_NAMESPACE_USE 0086 * This is used to specify that the rest of the code uses the 0087 * public ICU C++ API namespace. 0088 * @stable ICU 2.4 0089 */ 0090 0091 /** 0092 * \def U_NAMESPACE_QUALIFIER 0093 * This is used to qualify that a function or class is part of 0094 * the public ICU C++ API namespace. 0095 * 0096 * This macro is unnecessary since ICU 49 requires namespace support. 0097 * You can just use "icu::" instead. 0098 * @stable ICU 2.4 0099 */ 0100 0101 # if U_DISABLE_RENAMING 0102 # define U_ICU_NAMESPACE icu 0103 namespace U_ICU_NAMESPACE { } 0104 # else 0105 # define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu) 0106 namespace U_ICU_NAMESPACE { } 0107 namespace icu = U_ICU_NAMESPACE; 0108 # endif 0109 0110 # define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE { 0111 # define U_NAMESPACE_END } 0112 # define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE; 0113 # define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE:: 0114 0115 # ifndef U_USING_ICU_NAMESPACE 0116 # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \ 0117 defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || \ 0118 defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_TOOLUTIL_IMPLEMENTATION) 0119 # define U_USING_ICU_NAMESPACE 0 0120 # else 0121 # define U_USING_ICU_NAMESPACE 0 0122 # endif 0123 # endif 0124 # if U_USING_ICU_NAMESPACE 0125 U_NAMESPACE_USE 0126 # endif 0127 #endif /* __cplusplus */ 0128 0129 /*===========================================================================*/ 0130 /* General version helper functions. Definitions in putil.c */ 0131 /*===========================================================================*/ 0132 0133 /** 0134 * Parse a string with dotted-decimal version information and 0135 * fill in a UVersionInfo structure with the result. 0136 * Definition of this function lives in putil.c 0137 * 0138 * @param versionArray The destination structure for the version information. 0139 * @param versionString A string with dotted-decimal version information, 0140 * with up to four non-negative number fields with 0141 * values of up to 255 each. 0142 * @stable ICU 2.4 0143 */ 0144 U_CAPI void U_EXPORT2 0145 u_versionFromString(UVersionInfo versionArray, const char *versionString); 0146 0147 /** 0148 * Parse a Unicode string with dotted-decimal version information and 0149 * fill in a UVersionInfo structure with the result. 0150 * Definition of this function lives in putil.c 0151 * 0152 * @param versionArray The destination structure for the version information. 0153 * @param versionString A Unicode string with dotted-decimal version 0154 * information, with up to four non-negative number 0155 * fields with values of up to 255 each. 0156 * @stable ICU 4.2 0157 */ 0158 U_CAPI void U_EXPORT2 0159 u_versionFromUString(UVersionInfo versionArray, const UChar *versionString); 0160 0161 0162 /** 0163 * Write a string with dotted-decimal version information according 0164 * to the input UVersionInfo. 0165 * Definition of this function lives in putil.c 0166 * 0167 * @param versionArray The version information to be written as a string. 0168 * @param versionString A string buffer that will be filled in with 0169 * a string corresponding to the numeric version 0170 * information in versionArray. 0171 * The buffer size must be at least U_MAX_VERSION_STRING_LENGTH. 0172 * @stable ICU 2.4 0173 */ 0174 U_CAPI void U_EXPORT2 0175 u_versionToString(const UVersionInfo versionArray, char *versionString); 0176 0177 /** 0178 * Gets the ICU release version. The version array stores the version information 0179 * for ICU. For example, release "1.3.31.2" is then represented as 0x01031F02. 0180 * Definition of this function lives in putil.c 0181 * 0182 * @param versionArray the version # information, the result will be filled in 0183 * @stable ICU 2.0 0184 */ 0185 U_CAPI void U_EXPORT2 0186 u_getVersion(UVersionInfo versionArray); 0187 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |