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