intl/icu/source/common/udatamem.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial