intl/icu/source/common/unicode/uversion.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /*
michael@0 2 *******************************************************************************
michael@0 3 * Copyright (C) 2000-2011, International Business Machines
michael@0 4 * Corporation and others. All Rights Reserved.
michael@0 5 *******************************************************************************
michael@0 6 *
michael@0 7 * file name: uversion.h
michael@0 8 * encoding: US-ASCII
michael@0 9 * tab size: 8 (not used)
michael@0 10 * indentation:4
michael@0 11 *
michael@0 12 * Created by: Vladimir Weinstein
michael@0 13 *
michael@0 14 * Gets included by utypes.h and Windows .rc files
michael@0 15 */
michael@0 16
michael@0 17 /**
michael@0 18 * \file
michael@0 19 * \brief C API: API for accessing ICU version numbers.
michael@0 20 */
michael@0 21 /*===========================================================================*/
michael@0 22 /* Main ICU version information */
michael@0 23 /*===========================================================================*/
michael@0 24
michael@0 25 #ifndef UVERSION_H
michael@0 26 #define UVERSION_H
michael@0 27
michael@0 28 #include "unicode/umachine.h"
michael@0 29
michael@0 30 /* Actual version info lives in uvernum.h */
michael@0 31 #include "unicode/uvernum.h"
michael@0 32
michael@0 33 /** Maximum length of the copyright string.
michael@0 34 * @stable ICU 2.4
michael@0 35 */
michael@0 36 #define U_COPYRIGHT_STRING_LENGTH 128
michael@0 37
michael@0 38 /** An ICU version consists of up to 4 numbers from 0..255.
michael@0 39 * @stable ICU 2.4
michael@0 40 */
michael@0 41 #define U_MAX_VERSION_LENGTH 4
michael@0 42
michael@0 43 /** In a string, ICU version fields are delimited by dots.
michael@0 44 * @stable ICU 2.4
michael@0 45 */
michael@0 46 #define U_VERSION_DELIMITER '.'
michael@0 47
michael@0 48 /** The maximum length of an ICU version string.
michael@0 49 * @stable ICU 2.4
michael@0 50 */
michael@0 51 #define U_MAX_VERSION_STRING_LENGTH 20
michael@0 52
michael@0 53 /** The binary form of a version on ICU APIs is an array of 4 uint8_t.
michael@0 54 * To compare two versions, use memcmp(v1,v2,sizeof(UVersionInfo)).
michael@0 55 * @stable ICU 2.4
michael@0 56 */
michael@0 57 typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
michael@0 58
michael@0 59 /*===========================================================================*/
michael@0 60 /* C++ namespace if supported. Versioned unless versioning is disabled. */
michael@0 61 /*===========================================================================*/
michael@0 62
michael@0 63 /**
michael@0 64 * \def U_NAMESPACE_BEGIN
michael@0 65 * This is used to begin a declaration of a public ICU C++ API.
michael@0 66 * When not compiling for C++, it does nothing.
michael@0 67 * When compiling for C++, it begins an extern "C++" linkage block (to protect
michael@0 68 * against cases in which an external client includes ICU header files inside
michael@0 69 * an extern "C" linkage block).
michael@0 70 *
michael@0 71 * It also begins a versioned-ICU-namespace block.
michael@0 72 * @stable ICU 2.4
michael@0 73 */
michael@0 74
michael@0 75 /**
michael@0 76 * \def U_NAMESPACE_END
michael@0 77 * This is used to end a declaration of a public ICU C++ API.
michael@0 78 * When not compiling for C++, it does nothing.
michael@0 79 * When compiling for C++, it ends the extern "C++" block begun by
michael@0 80 * U_NAMESPACE_BEGIN.
michael@0 81 *
michael@0 82 * It also ends the versioned-ICU-namespace block begun by U_NAMESPACE_BEGIN.
michael@0 83 * @stable ICU 2.4
michael@0 84 */
michael@0 85
michael@0 86 /**
michael@0 87 * \def U_NAMESPACE_USE
michael@0 88 * This is used to specify that the rest of the code uses the
michael@0 89 * public ICU C++ API namespace.
michael@0 90 * This is invoked by default; we recommend that you turn it off:
michael@0 91 * See the "Recommended Build Options" section of the ICU4C readme
michael@0 92 * (http://source.icu-project.org/repos/icu/icu/trunk/readme.html#RecBuild)
michael@0 93 * @stable ICU 2.4
michael@0 94 */
michael@0 95
michael@0 96 /**
michael@0 97 * \def U_NAMESPACE_QUALIFIER
michael@0 98 * This is used to qualify that a function or class is part of
michael@0 99 * the public ICU C++ API namespace.
michael@0 100 *
michael@0 101 * This macro is unnecessary since ICU 49 requires namespace support.
michael@0 102 * You can just use "icu::" instead.
michael@0 103 * @stable ICU 2.4
michael@0 104 */
michael@0 105
michael@0 106 /* Define namespace symbols if the compiler supports it. */
michael@0 107 #ifdef __cplusplus
michael@0 108 # if U_DISABLE_RENAMING
michael@0 109 # define U_ICU_NAMESPACE icu
michael@0 110 namespace U_ICU_NAMESPACE { }
michael@0 111 # else
michael@0 112 # define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu)
michael@0 113 namespace U_ICU_NAMESPACE { }
michael@0 114 namespace icu = U_ICU_NAMESPACE;
michael@0 115 # endif
michael@0 116
michael@0 117 # define U_NAMESPACE_BEGIN extern "C++" { namespace U_ICU_NAMESPACE {
michael@0 118 # define U_NAMESPACE_END } }
michael@0 119 # define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
michael@0 120 # define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
michael@0 121
michael@0 122 # ifndef U_USING_ICU_NAMESPACE
michael@0 123 # define U_USING_ICU_NAMESPACE 1
michael@0 124 # endif
michael@0 125 # if U_USING_ICU_NAMESPACE
michael@0 126 U_NAMESPACE_USE
michael@0 127 # endif
michael@0 128 #else
michael@0 129 # define U_NAMESPACE_BEGIN
michael@0 130 # define U_NAMESPACE_END
michael@0 131 # define U_NAMESPACE_USE
michael@0 132 # define U_NAMESPACE_QUALIFIER
michael@0 133 #endif
michael@0 134
michael@0 135 /*===========================================================================*/
michael@0 136 /* General version helper functions. Definitions in putil.c */
michael@0 137 /*===========================================================================*/
michael@0 138
michael@0 139 /**
michael@0 140 * Parse a string with dotted-decimal version information and
michael@0 141 * fill in a UVersionInfo structure with the result.
michael@0 142 * Definition of this function lives in putil.c
michael@0 143 *
michael@0 144 * @param versionArray The destination structure for the version information.
michael@0 145 * @param versionString A string with dotted-decimal version information,
michael@0 146 * with up to four non-negative number fields with
michael@0 147 * values of up to 255 each.
michael@0 148 * @stable ICU 2.4
michael@0 149 */
michael@0 150 U_STABLE void U_EXPORT2
michael@0 151 u_versionFromString(UVersionInfo versionArray, const char *versionString);
michael@0 152
michael@0 153 /**
michael@0 154 * Parse a Unicode string with dotted-decimal version information and
michael@0 155 * fill in a UVersionInfo structure with the result.
michael@0 156 * Definition of this function lives in putil.c
michael@0 157 *
michael@0 158 * @param versionArray The destination structure for the version information.
michael@0 159 * @param versionString A Unicode string with dotted-decimal version
michael@0 160 * information, with up to four non-negative number
michael@0 161 * fields with values of up to 255 each.
michael@0 162 * @stable ICU 4.2
michael@0 163 */
michael@0 164 U_STABLE void U_EXPORT2
michael@0 165 u_versionFromUString(UVersionInfo versionArray, const UChar *versionString);
michael@0 166
michael@0 167
michael@0 168 /**
michael@0 169 * Write a string with dotted-decimal version information according
michael@0 170 * to the input UVersionInfo.
michael@0 171 * Definition of this function lives in putil.c
michael@0 172 *
michael@0 173 * @param versionArray The version information to be written as a string.
michael@0 174 * @param versionString A string buffer that will be filled in with
michael@0 175 * a string corresponding to the numeric version
michael@0 176 * information in versionArray.
michael@0 177 * The buffer size must be at least U_MAX_VERSION_STRING_LENGTH.
michael@0 178 * @stable ICU 2.4
michael@0 179 */
michael@0 180 U_STABLE void U_EXPORT2
michael@0 181 u_versionToString(const UVersionInfo versionArray, char *versionString);
michael@0 182
michael@0 183 /**
michael@0 184 * Gets the ICU release version. The version array stores the version information
michael@0 185 * for ICU. For example, release "1.3.31.2" is then represented as 0x01031F02.
michael@0 186 * Definition of this function lives in putil.c
michael@0 187 *
michael@0 188 * @param versionArray the version # information, the result will be filled in
michael@0 189 * @stable ICU 2.0
michael@0 190 */
michael@0 191 U_STABLE void U_EXPORT2
michael@0 192 u_getVersion(UVersionInfo versionArray);
michael@0 193 #endif

mercurial