2021-12-13 18:38:47 +01:00
|
|
|
#ifndef FS_FUGUE_FUGUE_H
|
|
|
|
#define FS_FUGUE_FUGUE_H
|
|
|
|
|
2021-12-21 19:01:00 +01:00
|
|
|
#include <gint/fs.h>
|
2021-12-13 18:38:47 +01:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
2021-12-21 19:01:00 +01:00
|
|
|
#include <dirent.h>
|
2021-12-30 18:17:13 +01:00
|
|
|
#include <sys/stat.h>
|
2021-12-21 19:01:00 +01:00
|
|
|
|
|
|
|
/* File descriptor type */
|
|
|
|
extern const fs_descriptor_type_t fugue_descriptor_type;
|
|
|
|
/* Directory descriptor type */
|
|
|
|
extern const fs_descriptor_type_t fugue_dir_descriptor_type;
|
|
|
|
|
2022-01-06 14:05:52 +01:00
|
|
|
/* Since on Graph 35+E II / fx-9860G III there is no (known) syscall to update
|
|
|
|
the file position, we need to track it ourselves, hopefully faithfully. */
|
|
|
|
typedef struct {
|
|
|
|
int fd;
|
|
|
|
int pos;
|
|
|
|
} fugue_fd_t;
|
|
|
|
|
2021-12-21 19:01:00 +01:00
|
|
|
/* Specific implementations of some standard functions */
|
2021-12-13 18:38:47 +01:00
|
|
|
|
|
|
|
int fugue_open(char const *path, int flags, mode_t mode);
|
|
|
|
|
|
|
|
int fugue_unlink(char const *path);
|
|
|
|
|
2021-12-21 19:01:00 +01:00
|
|
|
int fugue_mkdir(char const *path, mode_t mode);
|
|
|
|
|
|
|
|
int fugue_rmdir(char const *path);
|
|
|
|
|
2021-12-30 18:17:13 +01:00
|
|
|
int fugue_stat(char const * restrict path, struct stat * restrict statbuf);
|
|
|
|
|
2021-12-21 19:01:00 +01:00
|
|
|
/* Other functions */
|
|
|
|
|
|
|
|
void *fugue_dir_explore(char const *path);
|
|
|
|
|
2021-12-13 18:38:47 +01:00
|
|
|
#endif /* FS_FUGUE_FUGUE_H */
|