00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef __EFS_LIB_H__
00046 #define __EFS_LIB_H__
00047
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051
00052 #include <stdio.h>
00053 #include <stdlib.h>
00054 #include <dirent.h>
00055
00056
00057
00058
00059 #define EFS_MAXPATHLEN 768
00060 #define EFS_MAXNAMELEN 128
00061
00062
00063 extern char efs_path[EFS_MAXPATHLEN];
00064
00065
00066 typedef enum {
00067 EFS_ONLY = 0,
00068 EFS_AND_FAT = 1,
00069 EFS_DEFAULT_DEVICE = 2
00070
00071 } EFS_Init_Options;
00072
00073
00074
00075
00076
00077 int EFS_Init(int options, char *path);
00078
00079
00080
00081 DIR_ITER* EFS_DirOpen(struct _reent *r, DIR_ITER *dirState, const char *path);
00082 int EFS_DirReset(struct _reent *r, DIR_ITER *dirState);
00083 int EFS_DirNext(struct _reent *r, DIR_ITER *dirState, char *filename, struct stat *st);
00084 int EFS_DirClose(struct _reent *r, DIR_ITER *dirState);
00085 int EFS_Open(struct _reent *r, void *fileStruct, const char *path, int flags, int mode);
00086 int EFS_Close(struct _reent *r, int fd);
00087 int EFS_Read(struct _reent *r, int fd, char *ptr, size_t len);
00088 int EFS_Write(struct _reent *r, int fd, const char *ptr, size_t len);
00089 off_t EFS_Seek(struct _reent *r, int fd, off_t pos, int dir);
00090 int EFS_Fstat(struct _reent *r, int fd, struct stat *st);
00091 int EFS_Stat(struct _reent *r, const char *file, struct stat *st);
00092 int EFS_ChDir(struct _reent *r, const char *name);
00093
00094
00095 #ifdef __cplusplus
00096 }
00097 #endif
00098
00099 #endif // define __EFS_LIB_H__