00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __UDATA_H__
00020 #define __UDATA_H__
00021
00022 #include "unicode/utypes.h"
00023 #include "unicode/localpointer.h"
00024
00025 U_CDECL_BEGIN
00026
00042 #ifndef U_HIDE_INTERNAL_API
00043
00047 #define U_TREE_SEPARATOR '-'
00048
00053 #define U_TREE_SEPARATOR_STRING "-"
00054
00059 #define U_TREE_ENTRY_SEP_CHAR '/'
00060
00065 #define U_TREE_ENTRY_SEP_STRING "/"
00066
00071 #define U_ICUDATA_ALIAS "ICUDATA"
00072
00073 #endif
00074
00113 typedef struct {
00116 uint16_t size;
00117
00120 uint16_t reservedWord;
00121
00122
00125 uint8_t isBigEndian;
00126
00129 uint8_t charsetFamily;
00130
00133 uint8_t sizeofUChar;
00134
00137 uint8_t reservedByte;
00138
00141 uint8_t dataFormat[4];
00142
00145 uint8_t formatVersion[4];
00146
00149 uint8_t dataVersion[4];
00150 } UDataInfo;
00151
00152
00153
00158 typedef struct UDataMemory UDataMemory;
00159
00173 typedef UBool U_CALLCONV
00174 UDataMemoryIsAcceptable(void *context,
00175 const char *type, const char *name,
00176 const UDataInfo *pInfo);
00177
00178
00200 U_STABLE UDataMemory * U_EXPORT2
00201 udata_open(const char *path, const char *type, const char *name,
00202 UErrorCode *pErrorCode);
00203
00252 U_STABLE UDataMemory * U_EXPORT2
00253 udata_openChoice(const char *path, const char *type, const char *name,
00254 UDataMemoryIsAcceptable *isAcceptable, void *context,
00255 UErrorCode *pErrorCode);
00256
00264 U_STABLE void U_EXPORT2
00265 udata_close(UDataMemory *pData);
00266
00267 #if U_SHOW_CPLUSPLUS_API
00268
00269 U_NAMESPACE_BEGIN
00270
00280 U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close);
00281
00282 U_NAMESPACE_END
00283
00284 #endif
00285
00295 U_STABLE const void * U_EXPORT2
00296 udata_getMemory(UDataMemory *pData);
00297
00316 U_STABLE void U_EXPORT2
00317 udata_getInfo(UDataMemory *pData, UDataInfo *pInfo);
00318
00362 U_STABLE void U_EXPORT2
00363 udata_setCommonData(const void *data, UErrorCode *err);
00364
00365
00393 U_STABLE void U_EXPORT2
00394 udata_setAppData(const char *packageName, const void *data, UErrorCode *err);
00395
00401 typedef enum UDataFileAccess {
00403 UDATA_FILES_FIRST,
00405 UDATA_DEFAULT_ACCESS = UDATA_FILES_FIRST,
00407 UDATA_ONLY_PACKAGES,
00410 UDATA_PACKAGES_FIRST,
00412 UDATA_NO_FILES,
00413 #ifndef U_HIDE_DEPRECATED_API
00414
00418 UDATA_FILE_ACCESS_COUNT
00419 #endif // U_HIDE_DEPRECATED_API
00420 } UDataFileAccess;
00421
00432 U_STABLE void U_EXPORT2
00433 udata_setFileAccess(UDataFileAccess access, UErrorCode *status);
00434
00435 U_CDECL_END
00436
00437 #endif