X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..b25be06635768807f8f693286fa73bb2297bb06c:/icuSources/common/umapfile.h diff --git a/icuSources/common/umapfile.h b/icuSources/common/umapfile.h index c8c3de93..f8bf77b9 100644 --- a/icuSources/common/umapfile.h +++ b/icuSources/common/umapfile.h @@ -1,12 +1,11 @@ /* ****************************************************************************** * -* Copyright (C) 1999-2004, International Business Machines +* Copyright (C) 1999-2010, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************/ - /*---------------------------------------------------------------------------------- * * Memory mapped file wrappers for use by the ICU Data Implementation @@ -24,9 +23,32 @@ #ifndef __UMAPFILE_H__ #define __UMAPFILE_H__ +#include "unicode/putil.h" #include "unicode/udata.h" -UBool uprv_mapFile(UDataMemory *pdm, const char *path); -void uprv_unmapFile(UDataMemory *pData); +U_CFUNC UBool uprv_mapFile(UDataMemory *pdm, const char *path); +U_CFUNC void uprv_unmapFile(UDataMemory *pData); + +/* MAP_NONE: no memory mapping, no file access at all */ +#define MAP_NONE 0 +#define MAP_WIN32 1 +#define MAP_POSIX 2 +#define MAP_STDIO 3 +#define MAP_390DLL 4 + +#if UCONFIG_NO_FILE_IO +# define MAP_IMPLEMENTATION MAP_NONE +#elif defined(U_WINDOWS) +# define MAP_IMPLEMENTATION MAP_WIN32 +#elif U_HAVE_MMAP || defined(OS390) +# if defined(OS390) && defined (OS390_STUBDATA) + /* No memory mapping for 390 batch mode. Fake it using dll loading. */ +# define MAP_IMPLEMENTATION MAP_390DLL +# else +# define MAP_IMPLEMENTATION MAP_POSIX +# endif +#else /* unknown platform, no memory map implementation: use stdio.h and uprv_malloc() instead */ +# define MAP_IMPLEMENTATION MAP_STDIO +#endif #endif