|
|
|
|
/* Where does filesystem start */
|
/* Where does filesystem start */
|
extern unsigned char *root_file;
|
extern unsigned char *root_file;
|
#define ROOT_FILE ((struct file_struct *)root_file)//0x20000)
|
#define ROOT_FILE ((struct file_struct *)root_file)//0x20000)
|
|
|
enum enum_file_type {
|
enum enum_file_type {
|
/* Must be first file. */
|
/* Must be first file. */
|
FT_ROOT,
|
FT_ROOT,
|
/* Track number. */
|
/* Track number. */
|
FT_TRACK_NO,
|
FT_TRACK_NO,
|
/* Track name. */
|
/* Track name. */
|
FT_TRACK_NAME,
|
FT_TRACK_NAME,
|
/* Track data. */
|
/* Track data. */
|
FT_TRACK_DATA,
|
FT_TRACK_DATA,
|
/* Last record. */
|
/* Last record. */
|
FT_END
|
FT_END
|
};
|
};
|
|
|
struct file_struct {
|
struct file_struct {
|
/* Length of file, including header. */
|
/* Length of file, including header. */
|
unsigned int length;
|
unsigned int length;
|
|
|
/* File type. */
|
/* File type. */
|
enum enum_file_type type;
|
enum enum_file_type type;
|
|
|
/* Actual file data. */
|
/* Actual file data. */
|
unsigned int data[1];
|
unsigned int data[1];
|
};
|
};
|
|
|
#define HEADER_SIZE (sizeof (struct file_struct) - sizeof (unsigned int))
|
#define HEADER_SIZE (sizeof (struct file_struct) - sizeof (unsigned int))
|
|
|
/* Returns file, that holds track number. */
|
/* Returns file, that holds track number. */
|
extern struct file_struct *find_track_no (int no, struct file_struct *root);
|
extern struct file_struct *find_track_no (int no, struct file_struct *root);
|
|
|
/* Returns track name from file struct, pointing at FT_TRACK_NO. */
|
/* Returns track name from file struct, pointing at FT_TRACK_NO. */
|
extern char *track_name (struct file_struct *fs);
|
extern char *track_name (struct file_struct *fs);
|
|
|
/* Returns track data from file struct, pointing at FT_TRACK_NO. */
|
/* Returns track data from file struct, pointing at FT_TRACK_NO. */
|
extern struct file_struct *track_data (struct file_struct *fs);
|
extern struct file_struct *track_data (struct file_struct *fs);
|
|
|
/* Finds last record. */
|
/* Finds last record. */
|
extern struct file_struct * end_file (struct file_struct *root);
|
extern struct file_struct * end_file (struct file_struct *root);
|
|
|
/* Adds file to the end of file list. Returns new file address, if
|
/* Adds file to the end of file list. Returns new file address, if
|
sucessful, otherwise NULL. */
|
sucessful, otherwise NULL. */
|
extern struct file_struct *add_file (struct file_struct *root,
|
extern struct file_struct *add_file (struct file_struct *root,
|
struct file_struct *file);
|
struct file_struct *file);
|
/* Initializes filesystem at root. */
|
/* Initializes filesystem at root. */
|
extern void init_fsyst (struct file_struct *root);
|
extern void init_fsyst (struct file_struct *root);
|
|
|
#ifdef EMBED
|
#ifdef EMBED
|
#define swap(x) (x)
|
#define swap(x) (x)
|
#else
|
#else
|
extern unsigned int swap (unsigned int x);
|
extern unsigned int swap (unsigned int x);
|
#endif
|
#endif
|
|
|