libdragon
dragonfs.h
Go to the documentation of this file.
00001 
00006 #ifndef __LIBDRAGON_DRAGONFS_H
00007 #define __LIBDRAGON_DRAGONFS_H
00008 
00019 #define DFS_DEFAULT_LOCATION    0xB0101000
00020 
00024 #define MAX_OPEN_FILES      4
00025 
00031 #define MAX_FILENAME_LEN    243
00032 
00036 #define MAX_DIRECTORY_DEPTH 100
00037 
00043 #define DFS_ESUCCESS        0
00044 
00045 #define DFS_EBADINPUT       -1
00046 
00047 #define DFS_ENOFILE         -2
00048 
00049 #define DFS_EBADFS          -3
00050 
00051 #define DFS_ENOMEM          -4
00052 
00053 #define DFS_EBADHANDLE      -5
00054 
00064 #define FILETYPE(x)         ((x) & 3)
00065 
00071 #define FLAGS_FILE          0x0
00072 
00073 #define FLAGS_DIR           0x1
00074 
00075 #define FLAGS_EOF           0x2
00076 
00080 #ifdef __cplusplus
00081 extern "C" {
00082 #endif
00083 
00084 int dfs_init(uint32_t base_fs_loc);
00085 int dfs_chdir(const char * const path);
00086 int dfs_dir_findfirst(const char * const path, char *buf);
00087 int dfs_dir_findnext(char *buf);
00088 
00089 int dfs_open(const char * const path);
00090 int dfs_read(void * const buf, int size, int count, uint32_t handle);
00091 int dfs_seek(uint32_t handle, int offset, int origin);
00092 int dfs_tell(uint32_t handle);
00093 int dfs_close(uint32_t handle);
00094 int dfs_eof(uint32_t handle);
00095 int dfs_size(uint32_t handle);
00096 
00097 #ifdef __cplusplus
00098 }
00099 #endif
00100 
00101 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines