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
00276 U_STABLE const void * U_EXPORT2
00277 udata_getMemory(UDataMemory *pData);
00278
00297 U_STABLE void U_EXPORT2
00298 udata_getInfo(UDataMemory *pData, UDataInfo *pInfo);
00299
00343 U_STABLE void U_EXPORT2
00344 udata_setCommonData(const void *data, UErrorCode *err);
00345
00346
00374 U_STABLE void U_EXPORT2
00375 udata_setAppData(const char *packageName, const void *data, UErrorCode *err);
00376
00382 typedef enum UDataFileAccess {
00384 UDATA_FILES_FIRST,
00386 UDATA_DEFAULT_ACCESS = UDATA_FILES_FIRST,
00388 UDATA_ONLY_PACKAGES,
00391 UDATA_PACKAGES_FIRST,
00393 UDATA_NO_FILES,
00394 #ifndef U_HIDE_DEPRECATED_API
00395
00399 UDATA_FILE_ACCESS_COUNT
00400 #endif // U_HIDE_DEPRECATED_API
00401 } UDataFileAccess;
00402
00413 U_STABLE void U_EXPORT2
00414 udata_setFileAccess(UDataFileAccess access, UErrorCode *status);
00415
00416 U_CDECL_END
00417
00418 #if U_SHOW_CPLUSPLUS_API
00419
00420 U_NAMESPACE_BEGIN
00421
00431 U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close);
00432
00433 U_NAMESPACE_END
00434
00435 #endif // U_SHOW_CPLUSPLUS_API
00436
00437 #endif