#include <types.h>
#include <fstream.h>
Go to the source code of this file.
Data Structures | |
struct | s_finfo |
File info struct. This is directly written as a file header in the file system. More... | |
struct | s_fpath |
File path specifier. More... | |
Defines | |
#define | FS_TYPE_DF 0x38 |
File type DF. More... | |
#define | FS_TYPE_EF 0x00 |
File type EF. More... | |
#define | FS_TYPE_EF_TRANSP 0x00 |
File type transparent EF. More... | |
#define | FS_TYPE_EF_FIXED 0x01 |
File type fixed record EF. More... | |
#define | FS_HEADER_SIZE sizeof(S_FINFO) |
Size of the file header, which is currently the same as S_FINFO. More... | |
Typedefs | |
typedef s_fpath | S_FPATH |
File path specifier. More... | |
typedef s_finfo | S_FINFO |
File info struct. This is directly written as a file header in the file system. More... | |
Functions | |
bool | fs_init (void) |
Initialize file system variables. More... | |
bool | fs_seek (iu16 fid, S_FSTREAM *fs, S_FINFO *fi, iu8 type) |
Look for a file in a stream. More... | |
bool | fs_seekEnd (S_FSTREAM *fs) |
Look for the end of files in the stream. More... | |
bool | fs_getData (S_FPATH *fp, S_FSTREAM *fs, S_FINFO *fi) |
Get stream and info for a file specified as a path. More... | |
bool | fs_getFPath (iu16 fid, S_FPATH *fp, S_FSTREAM *fs, S_FINFO *fi) |
Get path, stream and info for a file specified as a FID. More... | |
bool | fs_delete (iu16 fid) |
Delete file specified as fid. More... | |
bool | fs_create (S_FINFO *fi) |
The function creates a file. More... | |
Variables | |
S_FPATH | selected |
Path specified of the currently selected file. More... |
SOSSE implements a very simple file system. Each file starts with following header:
After the content area of a file, a content size of 0 must be writen as an end of data marker. This means the data capacity of a MF or DF is the total content size of it minus 2.
Currently the file system support only one level of DFs, i.e. the maximum depth is MF:DF:EF.
There are probably a lot optimization possibilities in this file system, but I think this is not bad for my first designed and implemented file system.
|
Size of the file header, which is currently the same as S_FINFO.
|
|
File type DF.
|
|
File type EF.
|
|
File type fixed record EF.
|
|
File type transparent EF.
|
|
File info struct. This is directly written as a file header in the file system.
|
|
File path specifier.
|
|
The function creates a file. The functions creates a file with the data in fi. The current file must be a MF or DF. In case the current file is a DF, the file, which should be created, can't be a DF.
|
|
Delete file specified as fid. The function looks for the fid in the current file, which must be a MF or DF. The file, which should be deleted must be the last one in the current MF or DF.
|
|
Get stream and info for a file specified as a path.
|
|
Get path, stream and info for a file specified as a FID. The file is searched for in the order described in the SELECT FILE documentation on the main page.
|
|
Initialize file system variables. This looks e.g. for the start of the file system and it's size. It must be called after each reset.
|
|
Look for a file in a stream.
|
|
Look for the end of files in the stream.
|
|
Path specified of the currently selected file.
|