2 * Header file for using yaffs in an application via
16 //typedef unsigned long mode_t;
48 #define O_APPEND 02000
119 #define S_IFMT 0170000
123 #define S_IFLNK 0120000
127 #define S_IFDIR 0040000
131 #define S_IFREG 0100000
135 #define S_IREAD 0000400
139 #define S_IWRITE 0000200
146 long d_ino; /* inode number */
147 off_t d_off; /* offset to this dirent */
148 unsigned short d_reclen; /* length of this d_name */
149 char d_name [NAME_MAX+1]; /* file name (null-terminated) */
150 unsigned d_dont_use; /* debug pointer, not for public consumption */
153 typedef struct yaffs_dirent yaffs_dirent;
156 typedef struct __opaque yaffs_DIR;
161 int st_dev; /* device */
162 int st_ino; /* inode */
163 mode_t st_mode; /* protection */
164 int st_nlink; /* number of hard links */
165 int st_uid; /* user ID of owner */
166 int st_gid; /* group ID of owner */
167 unsigned st_rdev; /* device type (if inode device) */
168 off_t st_size; /* total size, in bytes */
169 unsigned long st_blksize; /* blocksize for filesystem I/O */
170 unsigned long st_blocks; /* number of blocks allocated */
171 unsigned long yst_atime; /* time of last access */
172 unsigned long yst_mtime; /* time of last modification */
173 unsigned long yst_ctime; /* time of last change */
176 int yaffs_open(const char *path, int oflag, int mode) ;
177 int yaffs_read(int fd, void *buf, unsigned int nbyte) ;
178 int yaffs_write(int fd, const void *buf, unsigned int nbyte) ;
179 int yaffs_close(int fd) ;
180 off_t yaffs_lseek(int fd, off_t offset, int whence) ;
181 int yaffs_truncate(int fd, off_t newSize);
183 int yaffs_unlink(const char *path) ;
184 int yaffs_rename(const char *oldPath, const char *newPath) ;
186 int yaffs_stat(const char *path, struct yaffs_stat *buf) ;
187 int yaffs_lstat(const char *path, struct yaffs_stat *buf) ;
188 int yaffs_fstat(int fd, struct yaffs_stat *buf) ;
190 int yaffs_chmod(const char *path, mode_t mode);
191 int yaffs_fchmod(int fd, mode_t mode);
193 int yaffs_mkdir(const char *path, mode_t mode) ;
194 int yaffs_rmdir(const char *path) ;
196 yaffs_DIR *yaffs_opendir(const char *dirname) ;
197 struct yaffs_dirent *yaffs_readdir(yaffs_DIR *dirp) ;
198 void yaffs_rewinddir(yaffs_DIR *dirp) ;
199 int yaffs_closedir(yaffs_DIR *dirp) ;
201 int yaffs_mount(const char *path) ;
202 int yaffs_unmount(const char *path) ;
204 int yaffs_symlink(const char *oldpath, const char *newpath);
205 int yaffs_readlink(const char *path, char *buf, int bufsiz);
207 int yaffs_link(const char *oldpath, const char *newpath);
208 int yaffs_mknod(const char *pathname, mode_t mode, dev_t dev);
210 loff_t yaffs_freespace(const char *path);
212 void yaffs_initialise(yaffsfs_DeviceConfiguration *configList);
214 int yaffs_StartUp(void);