picox  0.1
xposixfs.h
[詳解]
1 
14 /*
15  * License: MIT license
16  * Copyright (c) <2016> <MaskedW [maskedw00@gmail.com]>
17  *
18  * Permission is hereby granted, free of charge, to any person
19  * obtaining a copy of this software and associated documentation
20  * files (the "Software"), to deal in the Software without
21  * restriction, including without limitation the rights to use, copy,
22  * modify, merge, publish, distribute, sublicense, and/or sell copies
23  * of the Software, and to permit persons to whom the Software is
24  * furnished to do so, subject to the following conditions:
25  *
26  * The above copyright notice and this permission notice shall be
27  * included in all copies or substantial portions of the Software.
28  *
29  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
32  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
33  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
34  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
35  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36  * SOFTWARE.
37  */
38 
39 #ifndef picox_filesystem_xposixfs_h_
40 #define picox_filesystem_xposixfs_h_
41 
42 
44 
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif /* __cplusplus */
49 
50 
72 #define X_POSIXFS_TAG (X_MAKE_TAG('X', 'P', 'O', 'F'))
73 typedef struct
74 {
76  XTag m_tag;
77 } XPosixFs;
78 
79 
85 void xposixfs_init(XPosixFs* fs);
86 
87 
93 void xposixfs_deinit(XPosixFs* fs);
94 
95 
102 void xposixfs_init_vfs(XPosixFs* fs, XVirtualFs* vfs);
103 XError xposixfs_open(XPosixFs* fs, const char* path, XOpenMode mode, XFile** o_fp);
104 XError xposixfs_close(XFile* fp);
105 XError xposixfs_read(XFile* fp, void* dst, size_t size, size_t* nread);
106 XError xposixfs_write(XFile* fp, const void* src, size_t size, size_t* nwritten);
107 XError xposixfs_seek(XFile* fp, XOffset pos, XSeekMode whence);
108 XError xposixfs_tell(XFile* fp, XSize* pos);
109 XError xposixfs_flush(XFile* fp);
110 XError xposixfs_mkdir(XPosixFs* fs, const char* path);
111 XError xposixfs_opendir(XPosixFs* fs, const char* path, XDir** o_dir);
112 XError xposixfs_readdir(XDir* dir, XDirEnt* dirent, XDirEnt** result);
113 XError xposixfs_closedir(XDir* dir);
114 XError xposixfs_chdir(XPosixFs* fs, const char* path);
115 XError xposixfs_getcwd(XPosixFs* fs, char* buf, size_t size);
116 XError xposixfs_remove(XPosixFs* fs, const char* path);
117 XError xposixfs_rename(XPosixFs* fs, const char* oldpath, const char* newpath);
118 XError xposixfs_stat(XPosixFs* fs, const char* path, XStat* statbuf);
119 XError xposixfs_utime(XPosixFs* fs, const char* path, XTime time);
120 XError xposixfs_rmtree(XPosixFs* fs, const char* path);
121 
122 
128 #ifdef __cplusplus
129 }
130 #endif /* __cplusplus */
131 
132 
133 #endif /* picox_filesystem_xposixfs_h_ */
Definition: xfscore.h:182
uint32_t XTime
time_tの代替をするシステム時刻を格納するための型です
Definition: xtime.h:80
XOpenMode
ファイルオープン等のモードです
Definition: xstddef.h:435
XError
errnoの代替として使用する共通のエラーコードを表す列挙型です
Definition: xstddef.h:367
ディレクトリエントリ情報を格納する構造体です
Definition: xfscore.h:109
uint32_t XSize
何らかの大きさを表すのに十分なサイズを備えた符号なし整数型です
Definition: xstddef.h:251
ファイル操作のハンドル構造体です
Definition: xfscore.h:70
void xposixfs_init(XPosixFs *fs)
ファイルシステムを初期化します
Definition: xposixfs.c:72
uint32_t XTag
何らかのIDを格納するための符号なし整数が型です
Definition: xstddef.h:269
void xposixfs_init_vfs(XPosixFs *fs, XVirtualFs *vfs)
仮想ファイルシステムを初期化します
Definition: xposixfs.c:85
int32_t XOffset
何らかのオフセットを表すのに十分な大きさをもった符号あり整数型です
Definition: xstddef.h:261
void xposixfs_deinit(XPosixFs *fs)
ファイルシステムの終了処理を行います
Definition: xposixfs.c:79
XSeekMode
シークの起点を指定する列挙型です
Definition: xstddef.h:340
ディレクトリ操作のハンドル構造体です
Definition: xfscore.h:82
ファイル情報を格納する構造体です
Definition: xfscore.h:92
Definition: xposixfs.h:73