GadgetSeed  0.9.6
file.h
[詳解]
1 /** @file
2  @brief ファイル
3 
4  @date 2008.03.20
5  @author Takashi SHUDO
6 */
7 
8 #ifndef FILE_H
9 #define FILE_H
10 
11 #include "fs.h"
12 #include "str.h"
13 
14 extern void init_file(void);
15 extern struct st_filesystem * get_filesystem(const uchar *path);
16 extern int open_file(const uchar *path, int flags);
17 extern t_ssize read_file(int fd, void *buf, t_size count);
18 extern t_ssize write_file(int fd, const void *buf, t_size count);
19 extern t_ssize seek_file(int fd, t_ssize offset, int whence);
20 extern t_size tell_file(int fd);
21 extern int close_file(int fd);
22 extern FS_DIR * opendir_file(const uchar *name);
23 extern int readdir_file(FS_DIR *dir, FS_FILEINFO *finfo);
24 extern int closedir_file(FS_DIR *dir);
25 extern int stat_file(const uchar *path, FS_FILEINFO *finfo);
26 extern int getfree_file(const uchar *path, unsigned long *sect, void **fs);
27 extern int sync_file(int fd);
28 extern int unlink_file(const uchar *path);
29 extern int mkdir_file(const uchar *path);
30 extern int chmod_file(const uchar *path, unsigned char flag);
31 extern int rename_file(const uchar *oldpath, const uchar *newpath);
32 extern int mkfs_file(const uchar *path, unsigned char part, unsigned short alloc);
33 
34 extern uchar *get_last_filename(uchar *filename, const uchar *fullpath, unsigned int len);
35 extern uchar *get_filename_extension(uchar *ext, const uchar *filename, unsigned int len);
36 
37 #define SIZE_STR "X.XM"
38 #define SIZE_STR_LEN ((unsigned int)sizeof(SIZE_STR))
39 char *size2str(char *str, t_size size);
40 
41 #endif // FILE_H
unsigned char uchar
GadgetSeedの文字(列)は unsigned char 型となる
Definition: str.h:13
ファイルシステム構造体
Definition: fs.h:56
Definition: fs.h:44
t_ssize seek_file(int fd, t_ssize offset, int whence)
ファイルアクセス位置の設定
Definition: file.c:244
struct st_filesystem * get_filesystem(const uchar *path)
ファイル名からファイルシステムを調べる
Definition: file.c:120
int stat_file(const uchar *path, FS_FILEINFO *finfo)
ファイルステータスを読み出す
Definition: file.c:409
int rename_file(const uchar *oldpath, const uchar *newpath)
ファイル/ディレクトリ名を変更する
Definition: file.c:573
ファイルシステムAPI
文字列処理
t_ssize write_file(int fd, const void *buf, t_size count)
ファイルにデータを書き込む
Definition: file.c:216
int close_file(int fd)
ファイルを閉じる
Definition: file.c:297
t_size tell_file(int fd)
ファイルアクセス位置の取得
Definition: file.c:270
FS_DIR * opendir_file(const uchar *name)
ディレクトリを開く
Definition: file.c:329
int mkdir_file(const uchar *path)
ディレクトリを作成する
Definition: file.c:515
int closedir_file(FS_DIR *dir)
ディレクトリを閉じる
Definition: file.c:382
int open_file(const uchar *path, int flags)
ファイルを開く
Definition: file.c:144
void init_file(void)
全てのファイルディスクリプタを初期化する
Definition: file.c:84
int sync_file(int fd)
キャッシュされたデータをフラッシュする
Definition: file.c:463
int readdir_file(FS_DIR *dir, FS_FILEINFO *finfo)
ディレクトリを読み出す
Definition: file.c:356
Definition: fs.h:37
uchar * get_last_filename(uchar *filename, const uchar *fullpath, unsigned int len)
ファイルパスからファイル名のみを取得する
Definition: file.c:633
int getfree_file(const uchar *path, unsigned long *sect, void **fs)
論理ドライブの未使用クラスタ数を取得する
Definition: file.c:437
t_ssize read_file(int fd, void *buf, t_size count)
ファイルからデータを読み出す
Definition: file.c:188
uchar * get_filename_extension(uchar *ext, const uchar *filename, unsigned int len)
ファイル拡張子を取得する
Definition: file.c:676
int unlink_file(const uchar *path)
ファイルを消去する
Definition: file.c:489