equal
deleted
inserted
replaced
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #if !defined(__MEMMAPUTILS_H__) |
19 #if !defined(__MEMMAPUTILS_H__) |
20 #define __MEMMAPUTILS_H__ |
20 #define __MEMMAPUTILS_H__ |
21 |
21 #include "h_utl.h" |
22 #ifdef WIN32 |
22 #ifdef WIN32 |
|
23 #ifdef _STLP_INTERNAL_WINDOWS_H |
|
24 #define __INTERLOCKED_DECLARED |
|
25 #endif |
23 #include <windows.h> |
26 #include <windows.h> |
24 #include <io.h> |
27 #include <io.h> |
25 #endif |
28 #endif |
26 |
29 |
27 #include <fcntl.h> |
30 #include <fcntl.h> |
28 #include <sys/types.h> |
31 #include <sys/types.h> |
29 #include <sys/stat.h> |
32 #include <sys/stat.h> |
30 #include <stdio.h> |
33 #include <stdio.h> |
31 #include <string> |
34 |
32 #include <fstream> |
|
33 |
|
34 #include "h_utl.h" |
|
35 |
|
36 typedef std::string String; |
|
37 typedef std::ofstream Ofstream; |
|
38 |
35 |
39 const int KStatTrue = 1; |
36 const int KStatTrue = 1; |
40 const int KStatFalse = 0; |
37 const int KStatFalse = 0; |
41 |
38 |
42 /** |
39 /** |
54 #ifdef WIN32 |
51 #ifdef WIN32 |
55 // Windows specific Memory map object handle |
52 // Windows specific Memory map object handle |
56 HANDLE iHMMFile; |
53 HANDLE iHMMFile; |
57 #endif |
54 #endif |
58 // Map file name |
55 // Map file name |
59 String iMapFileName; |
56 string iMapFileName; |
60 |
57 |
61 public: |
58 public: |
62 MemmapUtils(); |
59 MemmapUtils(); |
63 ~MemmapUtils(); |
60 ~MemmapUtils(); |
64 |
61 |
65 // Generate temporary file name |
62 // Generate temporary file name |
66 void GetMapFileName(String& aFile); |
63 void GetMapFileName(string& aFile); |
67 |
64 |
68 // Create the memory map |
65 // Create the memory map |
69 void* OpenMemMapPointer(unsigned long aOffset, unsigned long aSize); |
66 void* OpenMemMapPointer(unsigned long aOffset, unsigned long aSize); |
70 // Close the memory map |
67 // Close the memory map |
71 int CloseMemMapPointer(void* aData, unsigned long aSize); |
68 int CloseMemMapPointer(void* aData, unsigned long aSize); |