1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
104
105
106
110
111
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/* ... */
#ifndef IP_FS_H
#define IP_FS_H
#include "SEGGER.h"
#if defined(__cplusplus)
extern "C" {
#endif
/* ... */
typedef struct {
void* (*pfOpenFile) (const char* sFilename);
int (*pfCloseFile) (void* hFile);
int (*pfReadAt) (void* hFile, void* pBuffer, U32 Pos, U32 NumBytes);
long (*pfGetLen) (void* hFile);
void (*pfForEachDirEntry) (void* pContext, const char* sDir, void (*pf)(void*, void*));
void (*pfGetDirEntryFileName) (void* pFileEntry, char* sFileName, U32 SizeOfBuffer);
U32 (*pfGetDirEntryFileSize) (void* pFileEntry, U32* pFileSizeHigh);
U32 (*pfGetDirEntryFileTime) (void* pFileEntry);
int (*pfGetDirEntryAttributes)(void* pFileEntry);
void* (*pfCreate) (const char* sFileName);
void* (*pfDeleteFile) (const char* sFilename);
int (*pfRenameFile) (const char* sOldFilename, const char* sNewFilename);
int (*pfWriteAt) (void* hFile, void* pBuffer, U32 Pos, U32 NumBytes);
int (*pfMKDir) (const char* sDirName);
int (*pfRMDir) (const char* sDirName);
int (*pfIsFolder) (const char* sPath);
int (*pfMove) (const char* sOldFilename, const char* sNewFilename);
...} IP_FS_API;
typedef struct {
const char* sPath;
const unsigned char* pData;
unsigned int FileSize;
...} IP_FS_READ_ONLY_FILE_ENTRY;
typedef struct IP_FS_READ_ONLY_FILE_HOOK_STRUCT IP_FS_READ_ONLY_FILE_HOOK;
struct IP_FS_READ_ONLY_FILE_HOOK_STRUCT {
IP_FS_READ_ONLY_FILE_HOOK* pNext;
IP_FS_READ_ONLY_FILE_ENTRY FileEntry;
...};
/* ... */
#define IP_FS_FS IP_FS_emFile
#define IP_FS_FS_AllowHiddenAccess IP_FS_emFile_AllowHiddenAccess
#define IP_FS_FS_DenyHiddenAccess IP_FS_emFile_DenyHiddenAccess
extern const IP_FS_API IP_FS_ReadOnly;
extern const IP_FS_API IP_FS_Win32;
extern const IP_FS_API IP_FS_Linux;
extern const IP_FS_API IP_FS_emFile;
extern const IP_FS_API IP_FS_emFile_AllowHiddenAccess;
extern const IP_FS_API IP_FS_emFile_DenyHiddenAccess;
void IP_FS_READ_ONLY_ClrFileHooks(void);
void IP_FS_READ_ONLY_AddFileHook (IP_FS_READ_ONLY_FILE_HOOK* pHook, const char* sPath, const unsigned char* pData, unsigned int FileSize);
void IP_FS_WIN32_ConfigBaseDir(const char* sDir);
#if defined(__cplusplus)
}extern "C" { ... }
#endif
/* ... */
#endif