// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** * Copyright (C) 1999-2015 International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * * * ucnv_bld.h: * Contains internal data structure definitions * Created by Bertrand A. Damiba * * Change history: * * 06/29/2000 helena Major rewrite of the callback APIs. */ #ifndef UCNV_BLD_H #define UCNV_BLD_H #include "unicode/utypes.h" #if !UCONFIG_NO_CONVERSION #include "unicode/ucnv.h" #include "unicode/ucnv_err.h" #include "unicode/utf16.h" #include "ucnv_cnv.h" #include "ucnvmbcs.h" #include "ucnv_ext.h" #include "udataswp.h" /* size of the overflow buffers in UConverter, enough for escaping callbacks */ #define UCNV_ERROR_BUFFER_LENGTH … /* at most 4 bytes per substitution character (part of .cnv file format! see UConverterStaticData) */ #define UCNV_MAX_SUBCHAR_LEN … /* at most 8 bytes per character in toUBytes[] (UTF-8 uses up to 6) */ #define UCNV_MAX_CHAR_LEN … /* converter options bits */ #define UCNV_OPTION_VERSION … #define UCNV_OPTION_SWAP_LFNL … #define UCNV_GET_VERSION(cnv) … U_CDECL_BEGIN /* We must declare the following as 'extern "C"' so that if ucnv itself is compiled under C++, the linkage of the funcptrs will work. */ UConverterTable; UConverterTable; struct UConverterImpl; UConverterImpl; /** values for the unicodeMask */ #define UCNV_HAS_SUPPLEMENTARY … #define UCNV_HAS_SURROGATES … UConverterStaticData; /* * Defines the UConverterSharedData struct, * the immutable, shared part of UConverter. */ struct UConverterSharedData { … }; /** UConverterSharedData initializer for static, non-reference-counted converters. */ #define UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(pStaticData, pImpl) … /* Defines a UConverter, the lightweight mutable part the user sees */ struct UConverter { … }; U_CDECL_END /* end of UConverter */ #define CONVERTER_FILE_EXTENSION … /** * Return the number of all converter names. * @param pErrorCode The error code * @return the number of all converter names */ U_CFUNC uint16_t ucnv_bld_countAvailableConverters(UErrorCode *pErrorCode); /** * Return the (n)th converter name in mixed case, or NULL * if there is none (typically, if the data cannot be loaded). * 0<=index<ucnv_io_countAvailableConverters(). * @param n The number specifies which converter name to get * @param pErrorCode The error code * @return the (n)th converter name in mixed case, or NULL if there is none. */ U_CFUNC const char * ucnv_bld_getAvailableConverter(uint16_t n, UErrorCode *pErrorCode); /** * Load a non-algorithmic converter. * If pkg==NULL, then this function must be called inside umtx_lock(&cnvCacheMutex). */ U_CAPI UConverterSharedData * ucnv_load(UConverterLoadArgs *pArgs, UErrorCode *err); /** * Unload a non-algorithmic converter. * It must be sharedData->isReferenceCounted * and this function must be called inside umtx_lock(&cnvCacheMutex). */ U_CAPI void ucnv_unload(UConverterSharedData *sharedData); /** * Swap ICU .cnv conversion tables. See udataswp.h. * @internal */ U_CAPI int32_t U_EXPORT2 ucnv_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *outData, UErrorCode *pErrorCode); U_CAPI void U_EXPORT2 ucnv_enableCleanup(void); #endif #endif /* _UCNV_BLD */