00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __UDATA_H__
00018 #define __UDATA_H__
00019
00020 #include "unicode/utypes.h"
00021 #include "unicode/localpointer.h"
00022
00023 U_CDECL_BEGIN
00024
00040 #ifndef U_HIDE_INTERNAL_API
00041
00045 #define U_TREE_SEPARATOR '-'
00046
00051 #define U_TREE_SEPARATOR_STRING "-"
00052
00057 #define U_TREE_ENTRY_SEP_CHAR '/'
00058
00063 #define U_TREE_ENTRY_SEP_STRING "/"
00064
00069 #define U_ICUDATA_ALIAS "ICUDATA"
00070
00071 #endif
00072
00111 typedef struct {
00114 uint16_t size;
00115
00118 uint16_t reservedWord;
00119
00120
00123 uint8_t isBigEndian;
00124
00127 uint8_t charsetFamily;
00128
00131 uint8_t sizeofUChar;
00132
00135 uint8_t reservedByte;
00136
00139 uint8_t dataFormat[4];
00140
00143 uint8_t formatVersion[4];
00144
00147 uint8_t dataVersion[4];
00148 } UDataInfo;
00149
00150
00151
00156 typedef struct UDataMemory UDataMemory;
00157
00171 typedef UBool U_CALLCONV
00172 UDataMemoryIsAcceptable(void *context,
00173 const char *type, const char *name,
00174 const UDataInfo *pInfo);
00175
00176
00198 U_STABLE UDataMemory * U_EXPORT2
00199 udata_open(const char *path, const char *type, const char *name,
00200 UErrorCode *pErrorCode);
00201
00250 U_STABLE UDataMemory * U_EXPORT2
00251 udata_openChoice(const char *path, const char *type, const char *name,
00252 UDataMemoryIsAcceptable *isAcceptable, void *context,
00253 UErrorCode *pErrorCode);
00254
00262 U_STABLE void U_EXPORT2
00263 udata_close(UDataMemory *pData);
00264
00265 #if U_SHOW_CPLUSPLUS_API
00266
00267 U_NAMESPACE_BEGIN
00268
00278 U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close);
00279
00280 U_NAMESPACE_END
00281
00282 #endif
00283
00293 U_STABLE const void * U_EXPORT2
00294 udata_getMemory(UDataMemory *pData);
00295
00314 U_STABLE void U_EXPORT2
00315 udata_getInfo(UDataMemory *pData, UDataInfo *pInfo);
00316
00360 U_STABLE void U_EXPORT2
00361 udata_setCommonData(const void *data, UErrorCode *err);
00362
00363
00391 U_STABLE void U_EXPORT2
00392 udata_setAppData(const char *packageName, const void *data, UErrorCode *err);
00393
00399 typedef enum UDataFileAccess {
00401 UDATA_FILES_FIRST,
00403 UDATA_DEFAULT_ACCESS = UDATA_FILES_FIRST,
00405 UDATA_ONLY_PACKAGES,
00408 UDATA_PACKAGES_FIRST,
00410 UDATA_NO_FILES,
00412 UDATA_FILE_ACCESS_COUNT
00413 } UDataFileAccess;
00414
00425 U_STABLE void U_EXPORT2
00426 udata_setFileAccess(UDataFileAccess access, UErrorCode *status);
00427
00428 U_CDECL_END
00429
00430 #endif