Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-31 08:32:36

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 
0128 #ifndef U_HIDE_DRAFT_API
0129 /**
0130  * \def U_HEADER_NESTED_NAMESPACE
0131  * Nested namespace used inside U_ICU_NAMESPACE for header-only APIs.
0132  * Different when used inside ICU to prevent public use of internal instantiations:
0133  * "header" when compiling calling code; "internal" when compiling ICU library code.
0134  *
0135  * When compiling for Windows, where DLL exports of APIs are explicit,
0136  * this is always "header". Header-only types are not marked for export,
0137  * which on Windows already avoids callers linking with library instantiations.
0138  *
0139  * @draft ICU 76
0140  * @see U_HEADER_ONLY_NAMESPACE
0141  */
0142 
0143 /**
0144  * \def U_HEADER_ONLY_NAMESPACE
0145  * Namespace used for header-only APIs.
0146  * Different when used inside ICU to prevent public use of internal instantiations.
0147  * "U_ICU_NAMESPACE::header" or "U_ICU_NAMESPACE::internal",
0148  * see U_HEADER_NESTED_NAMESPACE for details.
0149  *
0150  * @draft ICU 76
0151  */
0152 
0153 // The first test is the same as for defining U_EXPORT for Windows.
0154 #if defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \
0155                           UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
0156 #   define U_HEADER_NESTED_NAMESPACE header
0157 #elif defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \
0158         defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || \
0159         defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_TOOLUTIL_IMPLEMENTATION)
0160 #   define U_HEADER_NESTED_NAMESPACE internal
0161 #else
0162 #   define U_HEADER_NESTED_NAMESPACE header
0163 #endif
0164 
0165 #define U_HEADER_ONLY_NAMESPACE U_ICU_NAMESPACE::U_HEADER_NESTED_NAMESPACE
0166 
0167 namespace U_HEADER_ONLY_NAMESPACE {}
0168 #endif  // U_HIDE_DRAFT_API
0169 
0170 #endif /* __cplusplus */
0171 
0172 /*===========================================================================*/
0173 /* General version helper functions. Definitions in putil.c                  */
0174 /*===========================================================================*/
0175 
0176 /**
0177  * Parse a string with dotted-decimal version information and
0178  * fill in a UVersionInfo structure with the result.
0179  * Definition of this function lives in putil.c
0180  *
0181  * @param versionArray The destination structure for the version information.
0182  * @param versionString A string with dotted-decimal version information,
0183  *                      with up to four non-negative number fields with
0184  *                      values of up to 255 each.
0185  * @stable ICU 2.4
0186  */
0187 U_CAPI void U_EXPORT2
0188 u_versionFromString(UVersionInfo versionArray, const char *versionString);
0189 
0190 /**
0191  * Parse a Unicode string with dotted-decimal version information and
0192  * fill in a UVersionInfo structure with the result.
0193  * Definition of this function lives in putil.c
0194  *
0195  * @param versionArray The destination structure for the version information.
0196  * @param versionString A Unicode string with dotted-decimal version
0197  *                      information, with up to four non-negative number
0198  *                      fields with values of up to 255 each.
0199  * @stable ICU 4.2
0200  */
0201 U_CAPI void U_EXPORT2
0202 u_versionFromUString(UVersionInfo versionArray, const UChar *versionString);
0203 
0204 
0205 /**
0206  * Write a string with dotted-decimal version information according
0207  * to the input UVersionInfo.
0208  * Definition of this function lives in putil.c
0209  *
0210  * @param versionArray The version information to be written as a string.
0211  * @param versionString A string buffer that will be filled in with
0212  *                      a string corresponding to the numeric version
0213  *                      information in versionArray.
0214  *                      The buffer size must be at least U_MAX_VERSION_STRING_LENGTH.
0215  * @stable ICU 2.4
0216  */
0217 U_CAPI void U_EXPORT2
0218 u_versionToString(const UVersionInfo versionArray, char *versionString);
0219 
0220 /**
0221  * Gets the ICU release version.  The version array stores the version information
0222  * for ICU.  For example, release "1.3.31.2" is then represented as 0x01031F02.
0223  * Definition of this function lives in putil.c
0224  *
0225  * @param versionArray the version # information, the result will be filled in
0226  * @stable ICU 2.0
0227  */
0228 U_CAPI void U_EXPORT2
0229 u_getVersion(UVersionInfo versionArray);
0230 #endif