picox  0.1
xfatfs.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_xfatfs_h_
40 #define picox_filesystem_xfatfs_h_
41 
42 
44 
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif /* __cplusplus */
49 
50 
70 #define X_FATFS_TAG (X_MAKE_TAG('X', 'F', 'A', 'F'))
71 
72 typedef struct
73 {
75  XTag m_tag;
76 } XFatFs;
77 
78 
86 void xfatfs_init(XFatFs* fs);
87 
88 
94 void xfatfs_deinit(XFatFs* fs);
95 
96 
103 void xfatfs_init_vfs(XFatFs* fs, XVirtualFs* vfs);
104 XStream* xfatfs_init_stream(XStream* stream, XFile* fp);
105 XError xfatfs_open(XFatFs* fs, const char* path, XOpenMode mode, XFile** o_fp);
106 XError xfatfs_close(XFile* fp);
107 XError xfatfs_read(XFile* fp, void* dst, size_t size, size_t* nread);
108 XError xfatfs_write(XFile* fp, const void* src, size_t size, size_t* nwritten);
109 XError xfatfs_seek(XFile* fp, XOffset pos, XSeekMode whence);
110 XError xfatfs_tell(XFile* fp, XSize* pos);
111 XError xfatfs_flush(XFile* fp);
112 XError xfatfs_mkdir(XFatFs* fs, const char* path);
113 XError xfatfs_opendir(XFatFs* fs, const char* path, XDir** o_dir);
114 XError xfatfs_readdir(XDir* dir, XDirEnt* dirent, XDirEnt** result);
115 XError xfatfs_closedir(XDir* dir);
116 XError xfatfs_chdir(XFatFs* fs, const char* path);
117 XError xfatfs_getcwd(XFatFs* fs, char* buf, size_t size);
118 XError xfatfs_remove(XFatFs* fs, const char* path);
119 XError xfatfs_rename(XFatFs* fs, const char* oldpath, const char* newpath);
120 XError xfatfs_stat(XFatFs* fs, const char* path, XStat* statbuf);
121 XError xfatfs_utime(XFatFs* fs, const char* path, XTime time);
122 
123 
129 #ifdef __cplusplus
130 }
131 #endif /* __cplusplus */
132 
133 
134 #endif /* picox_filesystem_xfatfs_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
void xfatfs_init_vfs(XFatFs *fs, XVirtualFs *vfs)
仮想ファイルシステムを初期化します
Definition: xfatfs.c:95
Definition: xfatfs.h:72
uint32_t XSize
何らかの大きさを表すのに十分なサイズを備えた符号なし整数型です
Definition: xstddef.h:251
ファイル操作のハンドル構造体です
Definition: xfscore.h:70
uint32_t XTag
何らかのIDを格納するための符号なし整数が型です
Definition: xstddef.h:269
int32_t XOffset
何らかのオフセットを表すのに十分な大きさをもった符号あり整数型です
Definition: xstddef.h:261
ストリームを表す抽象型です
Definition: xstream.h:152
XSeekMode
シークの起点を指定する列挙型です
Definition: xstddef.h:340
ディレクトリ操作のハンドル構造体です
Definition: xfscore.h:82
ファイル情報を格納する構造体です
Definition: xfscore.h:92
void xfatfs_deinit(XFatFs *fs)
ファイルシステムの終了処理を行います
Definition: xfatfs.c:88
void xfatfs_init(XFatFs *fs)
ファイルシステムを初期化します
Definition: xfatfs.c:81