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