]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/umapfile.h
2 ******************************************************************************
4 * Copyright (C) 1999-2011, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 ******************************************************************************/
9 /*----------------------------------------------------------------------------------
11 * Memory mapped file wrappers for use by the ICU Data Implementation
13 * Porting note: The implementation of these functions is very platform specific.
14 * Not all platforms can do real memory mapping. Those that can't
15 * still must implement these functions, getting the data into memory using
16 * whatever means are available.
18 * These functions are part of the ICU internal implementation, and
19 * are not inteded to be used directly by applications.
21 *----------------------------------------------------------------------------------*/
23 #ifndef __UMAPFILE_H__
24 #define __UMAPFILE_H__
26 #include "unicode/putil.h"
27 #include "unicode/udata.h"
30 U_CFUNC UBool
uprv_mapFile(UDataMemory
*pdm
, const char *path
);
31 U_CFUNC
void uprv_unmapFile(UDataMemory
*pData
);
33 /* MAP_NONE: no memory mapping, no file access at all */
40 #if UCONFIG_NO_FILE_IO
41 # define MAP_IMPLEMENTATION MAP_NONE
42 #elif U_PLATFORM_USES_ONLY_WIN32_API
43 # define MAP_IMPLEMENTATION MAP_WIN32
44 #elif U_HAVE_MMAP || U_PLATFORM == U_PF_OS390
45 # if U_PLATFORM == U_PF_OS390 && defined (OS390_STUBDATA)
46 /* No memory mapping for 390 batch mode. Fake it using dll loading. */
47 # define MAP_IMPLEMENTATION MAP_390DLL
49 # define MAP_IMPLEMENTATION MAP_POSIX
51 #else /* unknown platform, no memory map implementation: use stdio.h and uprv_malloc() instead */
52 # define MAP_IMPLEMENTATION MAP_STDIO