1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/common/umapfile.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +/* 1.5 +****************************************************************************** 1.6 +* 1.7 +* Copyright (C) 1999-2011, International Business Machines 1.8 +* Corporation and others. All Rights Reserved. 1.9 +* 1.10 +******************************************************************************/ 1.11 + 1.12 +/*---------------------------------------------------------------------------------- 1.13 + * 1.14 + * Memory mapped file wrappers for use by the ICU Data Implementation 1.15 + * 1.16 + * Porting note: The implementation of these functions is very platform specific. 1.17 + * Not all platforms can do real memory mapping. Those that can't 1.18 + * still must implement these functions, getting the data into memory using 1.19 + * whatever means are available. 1.20 + * 1.21 + * These functions are part of the ICU internal implementation, and 1.22 + * are not inteded to be used directly by applications. 1.23 + * 1.24 + *----------------------------------------------------------------------------------*/ 1.25 + 1.26 +#ifndef __UMAPFILE_H__ 1.27 +#define __UMAPFILE_H__ 1.28 + 1.29 +#include "unicode/putil.h" 1.30 +#include "unicode/udata.h" 1.31 +#include "putilimp.h" 1.32 + 1.33 +U_CFUNC UBool uprv_mapFile(UDataMemory *pdm, const char *path); 1.34 +U_CFUNC void uprv_unmapFile(UDataMemory *pData); 1.35 + 1.36 +/* MAP_NONE: no memory mapping, no file access at all */ 1.37 +#define MAP_NONE 0 1.38 +#define MAP_WIN32 1 1.39 +#define MAP_POSIX 2 1.40 +#define MAP_STDIO 3 1.41 +#define MAP_390DLL 4 1.42 + 1.43 +#if UCONFIG_NO_FILE_IO 1.44 +# define MAP_IMPLEMENTATION MAP_NONE 1.45 +#elif U_PLATFORM_USES_ONLY_WIN32_API 1.46 +# define MAP_IMPLEMENTATION MAP_WIN32 1.47 +#elif U_HAVE_MMAP || U_PLATFORM == U_PF_OS390 1.48 +# if U_PLATFORM == U_PF_OS390 && defined (OS390_STUBDATA) 1.49 + /* No memory mapping for 390 batch mode. Fake it using dll loading. */ 1.50 +# define MAP_IMPLEMENTATION MAP_390DLL 1.51 +# else 1.52 +# define MAP_IMPLEMENTATION MAP_POSIX 1.53 +# endif 1.54 +#else /* unknown platform, no memory map implementation: use stdio.h and uprv_malloc() instead */ 1.55 +# define MAP_IMPLEMENTATION MAP_STDIO 1.56 +#endif 1.57 + 1.58 +#endif