]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/umapfile.h
2 ******************************************************************************
4 * Copyright (C) 1999-2010, 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"
29 U_CFUNC UBool
uprv_mapFile(UDataMemory
*pdm
, const char *path
);
30 U_CFUNC
void uprv_unmapFile(UDataMemory
*pData
);
32 /* MAP_NONE: no memory mapping, no file access at all */
39 #if UCONFIG_NO_FILE_IO
40 # define MAP_IMPLEMENTATION MAP_NONE
41 #elif defined(U_WINDOWS)
42 # define MAP_IMPLEMENTATION MAP_WIN32
43 #elif U_HAVE_MMAP || defined(OS390)
44 # if defined(OS390) && defined (OS390_STUBDATA)
45 /* No memory mapping for 390 batch mode. Fake it using dll loading. */
46 # define MAP_IMPLEMENTATION MAP_390DLL
48 # define MAP_IMPLEMENTATION MAP_POSIX
50 #else /* unknown platform, no memory map implementation: use stdio.h and uprv_malloc() instead */
51 # define MAP_IMPLEMENTATION MAP_STDIO