fsysdef.h

来自「一个小型的FAT文件系统,支持FAT12/16和目录」· C头文件 代码 · 共 47 行

H
47
字号


#ifndef _FSYSDEF_H
#define	_FSYSDEF_H

#include	"filesys.h"


typedef struct fsys_api
{
	int (*init)(char);
	int (*create)(UCHAR, const UCHAR*);
	int	(*open)(UCHAR, const UCHAR*, int);
	int	(*close)(int);
	int	(*read)(UCHAR*, int, int);
	int	(*write)(const UCHAR *, int, int);
	int	(*flush)(int);
	int	(*mkdir)(UCHAR, const UCHAR*);
	int	(*rmdir)(UCHAR, const UCHAR*);
	int (*chdir)(UCHAR, const UCHAR*);
	int (*cwd)(UCHAR, UCHAR**);
	int	(*remove)(UCHAR, const UCHAR*);
	int	(*rename)(UCHAR, const UCHAR*, const UCHAR*);
	int	(*seek)(int, long, int, long*);
	int	(*setAttr)(UCHAR, const UCHAR*, UCHAR);
	int	(*getFirstEntry)(UCHAR, const UCHAR*, UCHAR*, FILE_INFO*);
	int	(*getNextEntry)(UCHAR*, FILE_INFO*);
	int	(*getFileInfo)(UCHAR, const UCHAR*, FILE_INFO*);
	int	(*getDriveInfo)(UCHAR, DRIVE_INFO*);
//	long (*getFileSize)(int);
	int (*execute)(UCHAR, UCHAR*);
} FSYS_API;


typedef struct drive_tbl {
	const FSYS_API	*fsysAPI;
	UCHAR		subDriveNum;
	char		*driveName;
}DRIVE_TBL;

extern const DRIVE_TBL driveTbl[];
extern const FSYS_API fsysTbl[];


#endif	/* _FSYSDEF_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?