00001 /* 00002 ******************************************************************************* 00003 * 00004 * Copyright (C) 1999-2000, 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 00022 U_CDECL_BEGIN 00023 00054 typedef struct { 00056 uint16_t size; 00057 00059 uint16_t reservedWord; 00060 00061 /* platform data properties */ 00063 uint8_t isBigEndian; 00064 00066 uint8_t charsetFamily; 00067 00069 uint8_t sizeofUChar; 00070 00072 uint8_t reservedByte; 00073 00075 uint8_t dataFormat[4]; 00076 00078 uint8_t formatVersion[4]; 00079 uint8_t dataVersion[4]; 00080 } UDataInfo; 00081 00082 /* API for reading data -----------------------------------------------------*/ 00083 00087 typedef struct UDataMemory UDataMemory; 00088 00102 typedef UBool 00103 UDataMemoryIsAcceptable(void *context, 00104 const char *type, const char *name, 00105 const UDataInfo *pInfo); 00106 00107 00115 U_CAPI UDataMemory * U_EXPORT2 00116 udata_open(const char *path, const char *type, const char *name, 00117 UErrorCode *pErrorCode); 00118 00177 U_CAPI UDataMemory * U_EXPORT2 00178 udata_openChoice(const char *path, const char *type, const char *name, 00179 UDataMemoryIsAcceptable *isAcceptable, void *context, 00180 UErrorCode *pErrorCode); 00181 00188 U_CAPI void U_EXPORT2 00189 udata_close(UDataMemory *pData); 00190 00196 U_CAPI const void * U_EXPORT2 00197 udata_getMemory(UDataMemory *pData); 00198 00217 U_CAPI void U_EXPORT2 00218 udata_getInfo(UDataMemory *pData, UDataInfo *pInfo); 00219 00259 U_CAPI void U_EXPORT2 00260 udata_setCommonData(const void *data, UErrorCode *err); 00261 00262 U_CDECL_END 00263 00264 #endif