]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /* |
2 | ****************************************************************************** | |
3 | * | |
374ca955 | 4 | * Copyright (C) 1999-2004, International Business Machines |
b75a7d8f A |
5 | * Corporation and others. All Rights Reserved. |
6 | * | |
7 | ******************************************************************************/ | |
8 | ||
9 | ||
10 | /*---------------------------------------------------------------------------------- | |
11 | * | |
12 | * UDataMemory A class-like struct that serves as a handle to a piece of memory | |
13 | * that contains some ICU data (resource, converters, whatever.) | |
14 | * | |
15 | * When an application opens ICU data (with udata_open, for example, | |
16 | * a UDataMemory * is returned. | |
17 | * | |
18 | *----------------------------------------------------------------------------------*/ | |
19 | #ifndef __UDATAMEM_H__ | |
20 | #define __UDATAMEM_H__ | |
21 | ||
22 | #include "unicode/udata.h" | |
23 | #include "ucmndata.h" | |
24 | ||
25 | struct UDataMemory { | |
26 | const commonDataFuncs *vFuncs; /* Function Pointers for accessing TOC */ | |
27 | ||
28 | const DataHeader *pHeader; /* Header of the memory being described by this */ | |
29 | /* UDataMemory object. */ | |
30 | const void *toc; /* For common memory, table of contents for */ | |
31 | /* the pieces within. */ | |
32 | UBool heapAllocated; /* True if this UDataMemory Object is on the */ | |
33 | /* heap and thus needs to be deleted when closed. */ | |
34 | ||
35 | void *mapAddr; /* For mapped or allocated memory, the start addr. */ | |
36 | /* Only non-null if a close operation should unmap */ | |
37 | /* the associated data. */ | |
38 | void *map; /* Handle, or other data, OS dependent. */ | |
39 | /* Only non-null if a close operation should unmap */ | |
40 | /* the associated data, and additional info */ | |
41 | /* beyond the mapAddr is needed to do that. */ | |
374ca955 | 42 | int32_t length; /* Length of the data in bytes; -1 if unknown. */ |
b75a7d8f A |
43 | }; |
44 | ||
45 | UDataMemory *UDataMemory_createNewInstance(UErrorCode *pErr); | |
46 | void UDatamemory_assign (UDataMemory *dest, UDataMemory *source); | |
47 | void UDataMemory_init (UDataMemory *This); | |
48 | UBool UDataMemory_isLoaded(UDataMemory *This); | |
49 | void UDataMemory_setData (UDataMemory *This, const void *dataAddr); | |
50 | ||
51 | ||
52 | const DataHeader *UDataMemory_normalizeDataPointer(const void *p); | |
374ca955 A |
53 | |
54 | U_CAPI int32_t U_EXPORT2 | |
55 | udata_getLength(const UDataMemory *pData); | |
56 | ||
57 | U_CAPI const void * U_EXPORT2 | |
58 | udata_getRawMemory(const UDataMemory *pData); | |
59 | ||
b75a7d8f A |
60 | #endif |
61 |