FreeCalypso > hg > ffs-editor
annotate src/cs/drivers/drv_app/ffs/ffs.h @ 26:680f6fdb5e62
add target for Sony Ericsson K200/K220
author | Vadim Yanitskiy <fixeria@osmocom.org> |
---|---|
date | Wed, 20 Dec 2023 01:59:09 +0700 |
parents | 92470e5d0b9e |
children |
rev | line source |
---|---|
0
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /****************************************************************************** |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * Flash File System (ffs) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * Idea, design and coding by Mads Meisner-Jensen, mmj@ti.com |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * FFS Types and globals |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * $Id: ffs.h 1.19.1.45.1.26 Mon, 28 Apr 2003 11:27:14 +0200 cm $ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 * |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 ******************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #ifndef _FFS_H_ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #define _FFS_H_ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #ifndef TARGET |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "ffs.cfg" |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #endif |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #ifdef _RVF |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #include "rvf/rvf_api.h" |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 #include "rvm/rvm_use_id_list.h" |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 #endif |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 /****************************************************************************** |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 * Types |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 ******************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #ifndef BASIC_TYPES |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #define BASIC_TYPES |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 typedef signed char int8; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 typedef unsigned char uint8; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 typedef signed short int16; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 typedef unsigned short uint16; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 typedef signed int int32; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 typedef unsigned int uint32; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 #endif |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #if (TARGET == 1) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 // Unique message offset returned in the header of each mail (msg_id). |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #define FFS_MESSAGE_OFFSET BUILD_MESSAGE_OFFSET(FFS_USE_ID) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #endif |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 typedef int8 effs_t; // error type |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 //typedef int effs_t; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 typedef int32 req_id_t; // request id |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 typedef int32 offset_t; // offset from first address of ffs. |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 typedef uint32 location_t; // object location offset |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 typedef int32 blocksize_t; // can hold size of a block |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 typedef uint8 objflags_t; // object flags |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 typedef uint8 objtype_t; // object type |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 typedef int16 iref_t; // inode reference |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 typedef int8 bref_t; // block reference |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 typedef int32 fd_t; // file descriptor |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 typedef uint16 ffs_options_t; // option flags to open() and file_write() |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 // For directory operations |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 struct dir_s { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 iref_t this; // iref of dir that was opened |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 iref_t index; // last inode returned by ffs_readdir() |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 // File stat structure |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 struct stat_s { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 objtype_t type; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 objflags_t flags; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 iref_t inode; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 int size; // size of data space occupied by object |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 // File xstat structure |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 struct xstat_s { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 objtype_t type; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 objflags_t flags; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 iref_t inode; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 int size; // size of data space occupied by object |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 int space; // size of physical data space occupied by object |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 location_t location; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 uint8 reserved; // only for debug |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 bref_t block; // only for debug |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 uint16 sequence; // only for debug |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 uint16 updates; // only for debug |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 #if (TARGET == 0) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 // Only use to run on PC and not in target. Must be syncron with the typedef |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 // from rv_general.h |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 typedef void (*CALLBACK_FUNC)(void *); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 typedef uint16 T_RVF_ADDR_ID; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 /* define return_path */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 typedef struct |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 T_RVF_ADDR_ID addr_id; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 void (*callback_func)(void *); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 } T_RV_RETURN; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 /* Define the header of each message used in Riviera. */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 typedef struct { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 uint32 msg_id; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 void (*callback_func)(void *); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 T_RVF_ADDR_ID src_addr_id; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 T_RVF_ADDR_ID dest_addr_id; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 } T_RV_HDR; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 // Used riviera types |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 typedef uint16 UINT16; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 typedef int8 INT8; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 #endif |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 // Confirm mail sent from FFS task to caller (application) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 struct ffs_file_cnf_s { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 T_RV_HDR header; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 int error; // error code of FFS operation |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 req_id_t request_id; // Unique id number |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 char *path; // path name of object operation was performed on |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 struct ffs_stream_cnf_s { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 T_RV_HDR header; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 int error; // error code of FFS operation |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 req_id_t request_id; // Unique id number |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 fd_t fdi; // file descriptor |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 /****************************************************************************** |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 * RVF Types |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 ******************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 typedef ffs_options_t T_FFS_OPEN_FLAGS; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 typedef int T_FFS_SIZE; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 typedef offset_t T_FFS_OFFSET; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 typedef effs_t T_FFS_RET; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 typedef req_id_t T_FFS_REQ_ID; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 typedef int T_FFS_WHENCE; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 typedef fd_t T_FFS_FD; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 typedef objtype_t T_FFS_OBJECT_TYPE; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 typedef objflags_t T_FFS_FLAGS; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 typedef struct stat_s T_FFS_STAT; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 typedef struct xstat_s T_FFS_XSTAT; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 typedef struct dir_s T_FFS_DIR; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 typedef struct ffs_file_cnf_s T_FFS_FILE_CNF; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 typedef struct ffs_stream_cnf_s T_FFS_STREAM_CNF; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 /****************************************************************************** |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 * Errors |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 ******************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 enum FFS_ERRORS { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 EFFS_OK = 0, /* ok */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 EFFS_NODEVICE = -1, /* flash device unknown */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 EFFS_CORRUPTED = -2, /* filesystem corrupted!? */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 EFFS_NOPREFORMAT = -3, /* ffs not preformatted */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 EFFS_NOFORMAT = -4, /* ffs not formatted */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 EFFS_BADFORMAT = -5, /* incompatible ffs version, re-format needed */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 EFFS_MAGIC = -6, /* bad magic */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 EFFS_AGAIN = -7, /* not ready, try again later */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 EFFS_NOSYS = -8, /* function not implemented */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 EFFS_DRIVER = -9, /* ffs device driver error */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 EFFS_NOSPACE = -10, /* out of data space */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 EFFS_FSFULL = -11, /* file system full, no free inodes */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 EFFS_BADNAME = -12, /* bad filename */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 EFFS_NOTFOUND = -13, /* object not found */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 EFFS_EXISTS = -14, /* object exists */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 EFFS_ACCESS = -15, /* access permission violation */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 EFFS_NAMETOOLONG = -16, /* filename too long */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 EFFS_INVALID = -17, /* invalid argument */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 EFFS_DIRNOTEMPTY = -18, /* directory not empty */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 EFFS_NOTADIR = -19, /* object is not a directory */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 EFFS_SPARE = -20, /* SPARE */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 EFFS_FILETOOBIG = -21, /* file too big */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 EFFS_NOTAFILE = -22, /* object is not a file */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 EFFS_PATHTOODEEP = -23, /* path too deep */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 EFFS_NUMFD = -24, /* Max number of open files reached */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 EFFS_BADFD = -25, /* Bad file descriptor */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 EFFS_BADOP = -26, /* Bad operation */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 EFFS_LOCKED = -27, /* The file is locked */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 EFFS_TOOBIG = -30, /* too big (tmffs buffer overflow) */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 EFFS_MEMORY = -31, /* out of memory */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 EFFS_MSGSEND = -32, /* message send failed */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 /* debug errors */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 EFFS_SIBLINGLOOP = -40, /* directory sibling loop */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 EFFS_NOBLOCKS = -41, /* No more blocks!? */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 EFFS_DBR = -42, /* Data reclaim did not finish!? */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 EFFS_RECLAIMLOOP = -43 /* Data reclaim loop */ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 /****************************************************************************** |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 * Enumerations |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 ******************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 enum FFS_OBJECT_CONTROL_ACTION { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 OC_FLAGS = 1 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 enum FFS_OBJECT_TYPE { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 OT_FILE = 1, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 OT_DIR = 2, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 OT_LINK = 3, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 OT_SEGMENT = 4 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 enum FFS_OBJECT_FLAGS { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 OF_READONLY = 1<<4 // object cannot be modified |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 enum FFS_OPEN { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 FFS_O_EMPTY = 0x00, // Okay? |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 FFS_O_CREATE = 0x01, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 FFS_O_APPEND = 0x02, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 FFS_O_EXCL = 0x04, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 FFS_O_TRUNC = 0x08, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 FFS_O_RDONLY = 0x10, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 FFS_O_WRONLY = 0x20, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 FFS_O_RDWR = FFS_O_RDONLY | FFS_O_WRONLY |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 enum FFS_SEEK { |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 FFS_SEEK_SET = 0, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 FFS_SEEK_CUR = 1, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 FFS_SEEK_END = 2 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 // FIXME: debug indices to go into core.h |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 enum FFS_QUERY { // data size, description |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 Q_BYTES_FREE = 1, // 4, number of free bytes in FFS |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 Q_BYTES_USED = 2, // 4, number of used bytes in FFS |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 Q_BYTES_LOST = 3, // 4, number of lost bytes in FFS |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 Q_BYTES_MAX = 4, // 4, number of max available bytes in FFS |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 Q_BYTES_FREE_RAW = 5, // 4, number of free raw bytes in FFS (used internal) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 Q_FD_BUF_SIZE = 10, // 4, size of buffer used by stream functions |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 Q_TM_BUFADDR = 11, // 4, testmode buffer addr |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 Q_TM_BUFSIZE = 12, // 4, testmode ffs buffer size |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 Q_DEV_BASE = 13, // 4, FFS device base address |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 Q_CHUNK_SIZE_MAX = 14, // 4, max size of chunks made by non stream fkt. |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 // FFS versions |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 Q_FFS_API_VERSION = 16, // 2, FFS API Version |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 Q_FFS_DRV_VERSION = 17, // 2, FFS Driver Version |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 Q_FFS_REVISION = 18, // 2, FFS Revision (from PRCS) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 Q_FFS_FORMAT_READ = 19, // 2, FFS version as read from ffs |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 Q_FFS_LASTERROR = 20, // 2, FFS last error (from init) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 Q_FFS_FORMAT_WRITE = 21, // 2, FFS version as written to ffs on format |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 Q_FFS_TM_VERSION = 22, // 2, FFS Testmode version |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 // File system queries |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 Q_FILENAME_MAX = 24, // 2, max filename length |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 Q_PATH_DEPTH_MAX = 25, // 2, max path/directory nesting depth |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 Q_FD_MAX = 26, // 2, max numbers of simultaneous open files |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 Q_OBJECTS_FREE = 32, // 2, number of objects that can be created |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 Q_INODES_USED = 33, // 2, number of inodes used |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 Q_INODES_LOST = 34, // 2, number of inodes lost |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 Q_OBJECTS_USED = 33, // 2, DEPRECATED: old name for Q_INODES_USED |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 Q_OBJECTS_LOST = 34, // 2, DEPRECATED: old name for Q_INODES_LOST |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 Q_OBJECTS_MAX = 35, // 2, max number of valid objects allowed |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 Q_INODES_MAX = 36, // 2, physical total max number of inodes |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 Q_INODES_HIGH = 37, // 2, watermark for when inodes will be reclaimed |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 Q_LOST_HIGH = 38, // 2, watermark for when data block will be reclaimed |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 // Device queries |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 Q_DEV_MANUFACTURER = 48, // 2, flash manufacturer ID |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 Q_DEV_DEVICE = 49, // 2, flash device ID |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
274 Q_DEV_BLOCKS = 50, // 2, number of FFS blocks in device |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
275 Q_DEV_ATOMSIZE = 51, // 2, atomsize used by FFS for this device |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 Q_DEV_DRIVER = 52, // 2, flash device driver |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 // All queries below here are for debug purpose only, are unsupported |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 // and can change at any time without notice! |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
280 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 // Miscellaneous/Internal |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
282 Q_BLOCKS_FREE_MIN = 64, // 2, Number of spare blocks (0 or 1) |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
283 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 Q_BLOCKS_FREE = 70, // 2, number of free blocks |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
286 // Debug queries |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
287 Q_FS_FLAGS = 80, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
288 Q_FS_INODES = 81, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
289 Q_FS_ROOT = 82, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
290 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 Q_OBJECTS_TOTAL = 90, // 2, Accumulated number of valid objects |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 Q_TOTAL_OBJECTS = 90, // 2, DEPRECATED: old name for Q_OBJECTS_TOTAL |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 Q_STATS_FIRST = 100, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 Q_STATS_DRECLAIMS = 100, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 Q_STATS_IRECLAIMS = 101, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 Q_STATS_BRECLAIMS = 102, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 Q_STATS_DATA_RECLAIMED = 103, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 Q_STATS_INODES_RECLAIMED = 104, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 Q_STATS_DATA_ALLOCATED = 105, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
302 Q_REQUEST_ID_LAST = 110, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
303 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 Q_DEBUG_FIRST = 120, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 Q_DEBUG_0 = 120, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
306 Q_DEBUG_1 = 121, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
307 Q_DEBUG_2 = 122, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 Q_DEBUG_3 = 123, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 Q_DEBUG_LAST = 127, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 // individual lines of the bstat array can be returned by the following |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 // id plus the bstat index of the line wanted. |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 Q_BSTAT = -128 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
314 }; |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 /****************************************************************************** |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 * Function prototypes |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 ******************************************************************************/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 #ifdef _ETM_ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 /* Used by PC EMT only*/ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
323 int FEXPORT ffs_initialize(void); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 int FEXPORT ffs_preformat(uint16 magic); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
325 int FEXPORT ffs_format(const char *name, uint16 magic); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
326 int FEXPORT ffs_file_write(const char *name, void *buf, int size, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
327 ffs_options_t flags); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
328 int FEXPORT ffs_file_read(const char *name, void *buf, int size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
329 int FEXPORT ffs_readlink(const char *name, char *buf, int size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
330 int FEXPORT ffs_mkdir(const char *name); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
331 int FEXPORT ffs_opendir(const char *name, struct dir_s *dir); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
332 int FEXPORT ffs_readdir(struct dir_s *dir, char *name, int size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
333 int FEXPORT ffs_symlink(const char *name, const char *actualpath); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
334 int FEXPORT ffs_stat(const char *name, struct stat_s *stat); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
335 int FEXPORT ffs_xlstat(const char *name, struct xstat_s *xstat); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
336 int FEXPORT ffs_query(int8 query, void *pt); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
337 int FEXPORT ffs_fcontrol(const char *name, int8 action, int param); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
338 int FEXPORT ffs_remove(const char *name); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
339 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
340 int FEXPORT ffs_open(const char *pathname, ffs_options_t option); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
341 int FEXPORT ffs_close(fd_t fdi); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
342 int FEXPORT ffs_write(fd_t fdi, void *src, int size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
343 int FEXPORT ffs_read(fd_t fdi, void *src, int size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
344 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
345 int FEXPORT ffs_tffs(const char *string); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
346 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
347 #else |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
348 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
349 // Call-back function prototypes |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 T_FFS_REQ_ID ffs_fcreate_nb(const char *name, void *addr, T_FFS_SIZE size, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 T_FFS_REQ_ID ffs_fupdate_nb(const char *name, void *addr, T_FFS_SIZE size, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
353 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 T_FFS_REQ_ID ffs_fwrite_nb(const char *name, void *addr, T_FFS_SIZE size, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 T_FFS_REQ_ID ffs_file_write_nb(const char *name, void *addr, T_FFS_SIZE size, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
357 T_FFS_OPEN_FLAGS flags, T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
358 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
359 T_FFS_REQ_ID ffs_mkdir_nb(const char *name, T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
360 T_FFS_REQ_ID ffs_symlink_nb(const char *name, const char *actualpath, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
361 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 T_FFS_REQ_ID ffs_remove_nb(const char *namestruct, T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
364 T_FFS_REQ_ID ffs_fcontrol_nb(const char *pathname, INT8 action, int param, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
365 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 T_FFS_REQ_ID ffs_rename_nb(const char *oldname, const char *newname, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 T_FFS_REQ_ID ffs_preformat_nb(UINT16 magic, T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 T_FFS_REQ_ID ffs_format_nb(const char *name, UINT16 magic, T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 T_FFS_REQ_ID ffs_open_nb(const char *name, T_FFS_OPEN_FLAGS option, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 T_FFS_REQ_ID ffs_close_nb(T_FFS_FD fdi, T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 T_FFS_REQ_ID ffs_write_nb(T_FFS_FD fdi, void *src, T_FFS_SIZE size, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 T_FFS_REQ_ID ffs_seek_nb(T_FFS_FD fdi, T_FFS_SIZE offset, T_FFS_WHENCE whence |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
378 , T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
379 T_FFS_REQ_ID ffs_truncate_nb(const char *path, T_FFS_OFFSET length, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
380 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 T_FFS_REQ_ID ffs_ftruncate_nb(T_FFS_FD fdi, T_FFS_OFFSET length, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
383 T_FFS_REQ_ID ffs_fdatasync_nb(T_FFS_FD fdi, T_RV_RETURN *cp); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
384 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 // No-call-back function prototypes |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
386 T_FFS_RET ffs_fcreate(const char *name, void *addr, T_FFS_SIZE size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
387 T_FFS_RET ffs_fupdate(const char *name, void *addr, T_FFS_SIZE size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
388 T_FFS_RET ffs_fwrite(const char *name, void *addr, T_FFS_SIZE size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 T_FFS_RET ffs_file_write(const char *name, void *addr, T_FFS_SIZE size, |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
390 T_FFS_OPEN_FLAGS flags); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
391 T_FFS_SIZE ffs_fread(const char *name, void *addr, T_FFS_SIZE size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
392 T_FFS_SIZE ffs_file_read(const char *name, void *addr, T_FFS_SIZE size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
393 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
394 T_FFS_RET ffs_mkdir(const char *name); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
395 T_FFS_SIZE ffs_opendir(const char *name, T_FFS_DIR *dir); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
396 T_FFS_SIZE ffs_readdir (T_FFS_DIR *dir, char *name, T_FFS_SIZE size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
398 T_FFS_RET ffs_symlink(const char *name, const char *actualpath); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
399 T_FFS_SIZE ffs_readlink(const char *name, char *addr, T_FFS_SIZE size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
400 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
401 T_FFS_RET ffs_stat(const char *name, T_FFS_STAT *stat); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
402 T_FFS_RET ffs_linkstat(const char *name, T_FFS_STAT *stat); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
403 T_FFS_RET ffs_lstat(const char *name, T_FFS_STAT *stat); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
404 T_FFS_RET ffs_xlstat(const char *name, T_FFS_XSTAT *stat); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
405 T_FFS_RET ffs_fstat(T_FFS_FD fdi, T_FFS_STAT *stat); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
406 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
407 T_FFS_RET ffs_remove(const char *name); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
408 T_FFS_RET ffs_fcontrol(const char *pathname, INT8 action, int param); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
409 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
410 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
411 T_FFS_RET ffs_rename(const char *oldname, const char *newname); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
412 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
413 T_FFS_RET ffs_query(INT8 query, void *p); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
414 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
415 T_FFS_RET ffs_preformat(UINT16 magic); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
416 T_FFS_RET ffs_format(const char *name, UINT16 magic); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
417 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
418 T_FFS_FD ffs_open(const char *name, T_FFS_OPEN_FLAGS option); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
419 T_FFS_RET ffs_close(T_FFS_FD fdi); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
420 T_FFS_SIZE ffs_write(T_FFS_FD fdi, void *src, T_FFS_SIZE amount); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
421 T_FFS_SIZE ffs_seek(T_FFS_FD fdi, T_FFS_SIZE offset, T_FFS_WHENCE whence); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
422 T_FFS_SIZE ffs_read(T_FFS_FD fdi, void *src, T_FFS_SIZE size); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
423 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
424 T_FFS_RET ffs_truncate(const char *path, T_FFS_OFFSET length); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
425 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
426 T_FFS_RET ffs_ftruncate(T_FFS_FD fdi, T_FFS_OFFSET length); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
427 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
428 T_FFS_RET ffs_fdatasync(T_FFS_FD fdi); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
429 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
430 // This function is to be implemented by user. It is defined in cfgffs.c. |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
431 extern T_FFS_RET ffs_is_modifiable(const char *name); |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
432 #endif |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
433 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
434 #endif //_FFS_H_ |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
435 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
436 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
437 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
438 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
439 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
440 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
441 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
442 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
443 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
444 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
445 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
446 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
447 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
448 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
449 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
450 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
451 |
92470e5d0b9e
src: partial import from FC Selenite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
452 |