intl/icu/source/common/umapfile.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial