2001-09-07 18:42:29 +00:00
|
|
|
/*
|
|
|
|
******************************************************************************
|
|
|
|
*
|
2010-01-15 20:47:28 +00:00
|
|
|
* Copyright (C) 1999-2010, International Business Machines
|
2001-09-07 18:42:29 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
2001-09-25 16:43:20 +00:00
|
|
|
******************************************************************************/
|
2001-09-07 18:42:29 +00:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* Memory mapped file wrappers for use by the ICU Data Implementation
|
|
|
|
*
|
|
|
|
* Porting note: The implementation of these functions is very platform specific.
|
|
|
|
* Not all platforms can do real memory mapping. Those that can't
|
|
|
|
* still must implement these functions, getting the data into memory using
|
|
|
|
* whatever means are available.
|
|
|
|
*
|
|
|
|
* These functions are part of the ICU internal implementation, and
|
|
|
|
* are not inteded to be used directly by applications.
|
|
|
|
*
|
|
|
|
*----------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#ifndef __UMAPFILE_H__
|
|
|
|
#define __UMAPFILE_H__
|
|
|
|
|
2010-01-15 20:47:28 +00:00
|
|
|
#include "unicode/putil.h"
|
2001-09-08 00:27:05 +00:00
|
|
|
#include "unicode/udata.h"
|
2001-09-07 18:42:29 +00:00
|
|
|
|
2010-05-21 04:39:19 +00:00
|
|
|
U_CFUNC UBool uprv_mapFile(UDataMemory *pdm, const char *path);
|
|
|
|
U_CFUNC void uprv_unmapFile(UDataMemory *pData);
|
2001-09-07 18:42:29 +00:00
|
|
|
|
2010-01-15 20:47:28 +00:00
|
|
|
/* 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
|
|
|
|
|
2001-09-07 18:42:29 +00:00
|
|
|
#endif
|