ICU 4.8.1.1
4.8.1.1
|
00001 /* 00002 ****************************************************************************** 00003 * 00004 * Copyright (C) 1999-2010, International Business Machines 00005 * Corporation and others. All Rights Reserved. 00006 * 00007 ****************************************************************************** 00008 * file name: udata.h 00009 * encoding: US-ASCII 00010 * tab size: 8 (not used) 00011 * indentation:4 00012 * 00013 * created on: 1999oct25 00014 * created by: Markus W. Scherer 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 /* U_HIDE_INTERNAL_API */ 00072 00106 typedef struct { 00109 uint16_t size; 00110 00113 uint16_t reservedWord; 00114 00115 /* platform data properties */ 00118 uint8_t isBigEndian; 00119 00122 uint8_t charsetFamily; 00123 00126 uint8_t sizeofUChar; 00127 00130 uint8_t reservedByte; 00131 00134 uint8_t dataFormat[4]; 00135 00138 uint8_t formatVersion[4]; 00139 00142 uint8_t dataVersion[4]; 00143 } UDataInfo; 00144 00145 /* API for reading data -----------------------------------------------------*/ 00146 00151 typedef struct UDataMemory UDataMemory; 00152 00166 typedef UBool U_CALLCONV 00167 UDataMemoryIsAcceptable(void *context, 00168 const char *type, const char *name, 00169 const UDataInfo *pInfo); 00170 00171 00193 U_STABLE UDataMemory * U_EXPORT2 00194 udata_open(const char *path, const char *type, const char *name, 00195 UErrorCode *pErrorCode); 00196 00245 U_STABLE UDataMemory * U_EXPORT2 00246 udata_openChoice(const char *path, const char *type, const char *name, 00247 UDataMemoryIsAcceptable *isAcceptable, void *context, 00248 UErrorCode *pErrorCode); 00249 00257 U_STABLE void U_EXPORT2 00258 udata_close(UDataMemory *pData); 00259 00260 #if U_SHOW_CPLUSPLUS_API 00261 00262 U_NAMESPACE_BEGIN 00263 00273 U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close); 00274 00275 U_NAMESPACE_END 00276 00277 #endif 00278 00285 U_STABLE const void * U_EXPORT2 00286 udata_getMemory(UDataMemory *pData); 00287 00306 U_STABLE void U_EXPORT2 00307 udata_getInfo(UDataMemory *pData, UDataInfo *pInfo); 00308 00349 U_STABLE void U_EXPORT2 00350 udata_setCommonData(const void *data, UErrorCode *err); 00351 00352 00377 U_STABLE void U_EXPORT2 00378 udata_setAppData(const char *packageName, const void *data, UErrorCode *err); 00379 00385 typedef enum UDataFileAccess { 00387 UDATA_FILES_FIRST, 00389 UDATA_ONLY_PACKAGES, 00392 UDATA_PACKAGES_FIRST, 00394 UDATA_NO_FILES, 00396 UDATA_DEFAULT_ACCESS = UDATA_FILES_FIRST, 00397 UDATA_FILE_ACCESS_COUNT 00398 } UDataFileAccess; 00399 00410 U_STABLE void U_EXPORT2 00411 udata_setFileAccess(UDataFileAccess access, UErrorCode *status); 00412 00413 U_CDECL_END 00414 00415 #endif