fs.h

来自「文件系统在DSP上的实现」· C头文件 代码 · 共 75 行

H
75
字号
#ifndef FS_H
#define FS_H

#include "yaffsfs.h"

inline int open(const char* pathname, int flags, int mode)
{
    return yaffs_open(pathname, flags, mode);
}

inline int close(int fd)
{
    return yaffs_close(fd);
}

inline int unlink(const char *pathname)
{
	return yaffs_unlink(pathname);
}

inline int read(int fd, void *buf, unsigned int nbyte)
{
	return yaffs_read(fd, buf, nbyte);
}

inline int write(int fd, const void *buf, unsigned int nbyte)
{
	return yaffs_write(fd, buf, nbyte);
}

typedef yaffs_DIR DIR;

inline DIR* opendir(const char *pathname)
{
    return yaffs_opendir(pathname);
}

inline int closedir(DIR* dp)
{
    return yaffs_closedir(dp);
}


inline int mkdir(const char *pathname, mode_t mode)
{
	return yaffs_mkdir(pathname, mode);
}

inline int rmdir(const char *pathname) 
{
	return yaffs_rmdir(pathname);
}

typedef yaffs_dirent direct;

inline direct *yaffs_readdir(DIR *dp)
{
     return yaffs_readdir(dp);
}

typedef struct yaffs_stat stat;

inline int fstat(int fd, stat *sbuf)
{
    return yaffs_fstat(fd, sbuf);
}

inline off_t lseek(int fd, off_t offset, int whence) 
{
    return yaffs_lseek(fd, offset, whence); 
}
#endif  //FS_H


⌨️ 快捷键说明

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