ICU 4.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
udata.h
Go to the documentation of this file.
1 /*
2 ******************************************************************************
3 *
4 * Copyright (C) 1999-2008, International Business Machines
5 * Corporation and others. All Rights Reserved.
6 *
7 ******************************************************************************
8 * file name: udata.h
9 * encoding: US-ASCII
10 * tab size: 8 (not used)
11 * indentation:4
12 *
13 * created on: 1999oct25
14 * created by: Markus W. Scherer
15 */
16 
17 #ifndef __UDATA_H__
18 #define __UDATA_H__
19 
20 #include "unicode/utypes.h"
21 
23 
39 #ifndef U_HIDE_INTERNAL_API
40 
44 #define U_TREE_SEPARATOR '-'
45 
50 #define U_TREE_SEPARATOR_STRING "-"
51 
56 #define U_TREE_ENTRY_SEP_CHAR '/'
57 
62 #define U_TREE_ENTRY_SEP_STRING "/"
63 
68 #define U_ICUDATA_ALIAS "ICUDATA"
69 
70 #endif /* U_HIDE_INTERNAL_API */
71 
105 typedef struct {
109 
113 
114  /* platform data properties */
118 
122 
126 
130 
133  uint8_t dataFormat[4];
134 
137  uint8_t formatVersion[4];
138 
141  uint8_t dataVersion[4];
142 } UDataInfo;
143 
144 /* API for reading data -----------------------------------------------------*/
145 
150 typedef struct UDataMemory UDataMemory;
151 
165 typedef UBool U_CALLCONV
167  const char *type, const char *name,
168  const UDataInfo *pInfo);
169 
170 
193 udata_open(const char *path, const char *type, const char *name,
194  UErrorCode *pErrorCode);
195 
245 udata_openChoice(const char *path, const char *type, const char *name,
246  UDataMemoryIsAcceptable *isAcceptable, void *context,
247  UErrorCode *pErrorCode);
248 
256 U_STABLE void U_EXPORT2
257 udata_close(UDataMemory *pData);
258 
265 U_STABLE const void * U_EXPORT2
267 
286 U_STABLE void U_EXPORT2
287 udata_getInfo(UDataMemory *pData, UDataInfo *pInfo);
288 
323 U_STABLE void U_EXPORT2
324 udata_setCommonData(const void *data, UErrorCode *err);
325 
326 
351 U_STABLE void U_EXPORT2
352 udata_setAppData(const char *packageName, const void *data, UErrorCode *err);
353 
359 typedef enum UDataFileAccess {
371  UDATA_FILE_ACCESS_COUNT
373 
384 U_STABLE void U_EXPORT2
386 
388 
389 #endif
void udata_setAppData(const char *packageName, const void *data, UErrorCode *err)
This function bypasses the normal ICU data loading process for application-specific data and allows y...
void udata_getInfo(UDataMemory *pData, UDataInfo *pInfo)
Get the information from the data memory header.
uint8_t isBigEndian
0 for little-endian machine, 1 for big-endian
Definition: udata.h:117
void udata_setCommonData(const void *data, UErrorCode *err)
This function bypasses the normal ICU data loading process and allows you to force ICU's system data ...
#define U_CALLCONV
Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary in callback function typedefs to ma...
Definition: utypes.h:254
UDataFileAccess
Possible settings for udata_setFileAccess()
Definition: udata.h:359
uint8_t charsetFamily
see U_CHARSET_FAMILY values in utypes.h
Definition: udata.h:121
ICU loads data from packages first, and only from single files if the data cannot be found in a packa...
Definition: udata.h:366
unsigned char uint8_t
Define 64 bit limits.
Definition: pwin32.h:131
uint16_t size
sizeof(UDataInfo)
Definition: udata.h:108
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Definition: umachine.h:101
UDataMemory * udata_open(const char *path, const char *type, const char *name, UErrorCode *pErrorCode)
Convenience function.
ICU looks for data in single files first, then in packages.
Definition: udata.h:361
An alias for the default access mode.
Definition: udata.h:370
struct UDataMemory UDataMemory
Forward declaration of the data memory type.
Definition: udata.h:150
void udata_close(UDataMemory *pData)
Close the data memory.
UBool UDataMemoryIsAcceptable(void *context, const char *type, const char *name, const UDataInfo *pInfo)
Callback function for udata_openChoice().
Definition: udata.h:166
void udata_setFileAccess(UDataFileAccess access, UErrorCode *status)
This function may be called to control how ICU loads data.
#define U_EXPORT2
Definition: platform.h:338
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
Definition: umachine.h:102
ICU does not access the file system for data loading.
Definition: udata.h:368
const void * udata_getMemory(UDataMemory *pData)
Get the pointer to the actual data inside the data memory.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:593
UDataMemory * udata_openChoice(const char *path, const char *type, const char *name, UDataMemoryIsAcceptable *isAcceptable, void *context, UErrorCode *pErrorCode)
Data loading function.
UDataInfo contains the properties about the requested data.
Definition: udata.h:105
unsigned short uint16_t
Define 64 bit limits.
Definition: pwin32.h:139
uint8_t reservedByte
unused, set to 0
Definition: udata.h:129
Basic definitions for ICU, for both C and C++ APIs.
uint8_t sizeofUChar
sizeof(UChar), one of { 1, 2, 4 }
Definition: udata.h:125
ICU only loads data from packages, not from single files.
Definition: udata.h:363
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:117
int8_t UBool
The ICU boolean type.
Definition: umachine.h:208
uint16_t reservedWord
unused, set to 0
Definition: udata.h:112