Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* |
michael@0 | 2 | ****************************************************************************** |
michael@0 | 3 | * |
michael@0 | 4 | * Copyright (C) 1999-2011, 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 | * Memory mapped file wrappers for use by the ICU Data Implementation |
michael@0 | 12 | * |
michael@0 | 13 | * Porting note: The implementation of these functions is very platform specific. |
michael@0 | 14 | * Not all platforms can do real memory mapping. Those that can't |
michael@0 | 15 | * still must implement these functions, getting the data into memory using |
michael@0 | 16 | * whatever means are available. |
michael@0 | 17 | * |
michael@0 | 18 | * These functions are part of the ICU internal implementation, and |
michael@0 | 19 | * are not inteded to be used directly by applications. |
michael@0 | 20 | * |
michael@0 | 21 | *----------------------------------------------------------------------------------*/ |
michael@0 | 22 | |
michael@0 | 23 | #ifndef __UMAPFILE_H__ |
michael@0 | 24 | #define __UMAPFILE_H__ |
michael@0 | 25 | |
michael@0 | 26 | #include "unicode/putil.h" |
michael@0 | 27 | #include "unicode/udata.h" |
michael@0 | 28 | #include "putilimp.h" |
michael@0 | 29 | |
michael@0 | 30 | U_CFUNC UBool uprv_mapFile(UDataMemory *pdm, const char *path); |
michael@0 | 31 | U_CFUNC void uprv_unmapFile(UDataMemory *pData); |
michael@0 | 32 | |
michael@0 | 33 | /* MAP_NONE: no memory mapping, no file access at all */ |
michael@0 | 34 | #define MAP_NONE 0 |
michael@0 | 35 | #define MAP_WIN32 1 |
michael@0 | 36 | #define MAP_POSIX 2 |
michael@0 | 37 | #define MAP_STDIO 3 |
michael@0 | 38 | #define MAP_390DLL 4 |
michael@0 | 39 | |
michael@0 | 40 | #if UCONFIG_NO_FILE_IO |
michael@0 | 41 | # define MAP_IMPLEMENTATION MAP_NONE |
michael@0 | 42 | #elif U_PLATFORM_USES_ONLY_WIN32_API |
michael@0 | 43 | # define MAP_IMPLEMENTATION MAP_WIN32 |
michael@0 | 44 | #elif U_HAVE_MMAP || U_PLATFORM == U_PF_OS390 |
michael@0 | 45 | # if U_PLATFORM == U_PF_OS390 && defined (OS390_STUBDATA) |
michael@0 | 46 | /* No memory mapping for 390 batch mode. Fake it using dll loading. */ |
michael@0 | 47 | # define MAP_IMPLEMENTATION MAP_390DLL |
michael@0 | 48 | # else |
michael@0 | 49 | # define MAP_IMPLEMENTATION MAP_POSIX |
michael@0 | 50 | # endif |
michael@0 | 51 | #else /* unknown platform, no memory map implementation: use stdio.h and uprv_malloc() instead */ |
michael@0 | 52 | # define MAP_IMPLEMENTATION MAP_STDIO |
michael@0 | 53 | #endif |
michael@0 | 54 | |
michael@0 | 55 | #endif |