1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2000-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*
* file name: uversion.h
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
* Created by: Vladimir Weinstein
*
* Gets included by utypes.h and Windows .rc files
*/
/**
* \file
* \brief C API: API for accessing ICU version numbers.
*/
/*===========================================================================*/
/* Main ICU version information */
/*===========================================================================*/
#ifndef UVERSION_H
#define UVERSION_H
#include "unicode/umachine.h"
/* Actual version info lives in uvernum.h */
#include "unicode/uvernum.h"
/** Maximum length of the copyright string.
* @stable ICU 2.4
*/
#define U_COPYRIGHT_STRING_LENGTH 128
/** An ICU version consists of up to 4 numbers from 0..255.
* @stable ICU 2.4
*/
#define U_MAX_VERSION_LENGTH 4
/** In a string, ICU version fields are delimited by dots.
* @stable ICU 2.4
*/
#define U_VERSION_DELIMITER '.'
/** The maximum length of an ICU version string.
* @stable ICU 2.4
*/
#define U_MAX_VERSION_STRING_LENGTH 20
/** The binary form of a version on ICU APIs is an array of 4 uint8_t.
* To compare two versions, use memcmp(v1,v2,sizeof(UVersionInfo)).
* @stable ICU 2.4
*/
typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
/*===========================================================================*/
/* C++ namespace if supported. Versioned unless versioning is disabled. */
/*===========================================================================*/
/* Define C++ namespace symbols. */
#ifdef __cplusplus
/**
* \def U_NAMESPACE_BEGIN
* This is used to begin a declaration of a public ICU C++ API within
* versioned-ICU-namespace block.
*
* @stable ICU 2.4
*/
/**
* \def U_NAMESPACE_END
* This is used to end a declaration of a public ICU C++ API.
* It ends the versioned-ICU-namespace block begun by U_NAMESPACE_BEGIN.
*
* @stable ICU 2.4
*/
/**
* \def U_NAMESPACE_USE
* This is used to specify that the rest of the code uses the
* public ICU C++ API namespace.
* @stable ICU 2.4
*/
/**
* \def U_NAMESPACE_QUALIFIER
* This is used to qualify that a function or class is part of
* the public ICU C++ API namespace.
*
* This macro is unnecessary since ICU 49 requires namespace support.
* You can just use "icu::" instead.
* @stable ICU 2.4
*/
# if U_DISABLE_RENAMING
# define U_ICU_NAMESPACE icu
namespace U_ICU_NAMESPACE { }
# else
# define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu)
namespace U_ICU_NAMESPACE { }
namespace icu = U_ICU_NAMESPACE;
# endif
# define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE {
# define U_NAMESPACE_END }
# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
# ifndef U_USING_ICU_NAMESPACE
# if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \
defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || \
defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_TOOLUTIL_IMPLEMENTATION)
# define U_USING_ICU_NAMESPACE 0
# else
# define U_USING_ICU_NAMESPACE 0
# endif
# endif
# if U_USING_ICU_NAMESPACE
U_NAMESPACE_USE
# endif
#ifndef U_HIDE_DRAFT_API
/**
* \def U_HEADER_NESTED_NAMESPACE
* Nested namespace used inside U_ICU_NAMESPACE for header-only APIs.
* Different when used inside ICU to prevent public use of internal instantiations:
* "header" when compiling calling code; "internal" when compiling ICU library code.
*
* When compiling for Windows, where DLL exports of APIs are explicit,
* this is always "header". Header-only types are not marked for export,
* which on Windows already avoids callers linking with library instantiations.
*
* @draft ICU 76
* @see U_HEADER_ONLY_NAMESPACE
*/
/**
* \def U_HEADER_ONLY_NAMESPACE
* Namespace used for header-only APIs.
* Different when used inside ICU to prevent public use of internal instantiations.
* "U_ICU_NAMESPACE::header" or "U_ICU_NAMESPACE::internal",
* see U_HEADER_NESTED_NAMESPACE for details.
*
* @draft ICU 76
*/
// The first test is the same as for defining U_EXPORT for Windows.
#if defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \
UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
# define U_HEADER_NESTED_NAMESPACE header
#elif defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \
defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || \
defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_TOOLUTIL_IMPLEMENTATION)
# define U_HEADER_NESTED_NAMESPACE internal
#else
# define U_HEADER_NESTED_NAMESPACE header
#endif
#define U_HEADER_ONLY_NAMESPACE U_ICU_NAMESPACE::U_HEADER_NESTED_NAMESPACE
namespace U_HEADER_ONLY_NAMESPACE {}
#endif // U_HIDE_DRAFT_API
#endif /* __cplusplus */
/*===========================================================================*/
/* General version helper functions. Definitions in putil.c */
/*===========================================================================*/
/**
* Parse a string with dotted-decimal version information and
* fill in a UVersionInfo structure with the result.
* Definition of this function lives in putil.c
*
* @param versionArray The destination structure for the version information.
* @param versionString A string with dotted-decimal version information,
* with up to four non-negative number fields with
* values of up to 255 each.
* @stable ICU 2.4
*/
U_CAPI void U_EXPORT2
u_versionFromString(UVersionInfo versionArray, const char *versionString);
/**
* Parse a Unicode string with dotted-decimal version information and
* fill in a UVersionInfo structure with the result.
* Definition of this function lives in putil.c
*
* @param versionArray The destination structure for the version information.
* @param versionString A Unicode string with dotted-decimal version
* information, with up to four non-negative number
* fields with values of up to 255 each.
* @stable ICU 4.2
*/
U_CAPI void U_EXPORT2
u_versionFromUString(UVersionInfo versionArray, const UChar *versionString);
/**
* Write a string with dotted-decimal version information according
* to the input UVersionInfo.
* Definition of this function lives in putil.c
*
* @param versionArray The version information to be written as a string.
* @param versionString A string buffer that will be filled in with
* a string corresponding to the numeric version
* information in versionArray.
* The buffer size must be at least U_MAX_VERSION_STRING_LENGTH.
* @stable ICU 2.4
*/
U_CAPI void U_EXPORT2
u_versionToString(const UVersionInfo versionArray, char *versionString);
/**
* Gets the ICU release version. The version array stores the version information
* for ICU. For example, release "1.3.31.2" is then represented as 0x01031F02.
* Definition of this function lives in putil.c
*
* @param versionArray the version # information, the result will be filled in
* @stable ICU 2.0
*/
U_CAPI void U_EXPORT2
u_getVersion(UVersionInfo versionArray);
#endif
|