#include <stdint.h>
#include "Path.hpp"
#include "drivers/disk/disk.h"
Go to the source code of this file.
|
| typedef unsigned int | FILE_SEEK_MODE |
| typedef unsigned int | FILE_MODE |
| typedef unsigned int | FILE_STAT_FLAGS |
| typedef int(* | FS_RESOLVE_FUNCTION) (struct disk *disk) |
| typedef void *(* | FS_OPEN_FUNCTION) (void *private_fs, struct path_part *path, FILE_MODE mode) |
| typedef int(* | FS_READ_FUNCTION) (void *private_fs, void *descriptor, uint32_t size, uint32_t nmemb, char *out) |
| typedef int(* | FS_SEEK_FUNCTION) (void *private_fs, uint32_t offset, FILE_SEEK_MODE seek_mode) |
| typedef int(* | FS_STAT_FUNCTION) (void *private_fs, struct file_stat *stat) |
| typedef int(* | FS_CLOSE_FUNCTION) (void *private_fs) |
| typedef int(* | FS_WRITE_FUNCTION) (void *private_fs, void *descriptor, uint32_t size, uint32_t nmemb, char *in) |
|
| void | fs_init () |
| | Initializes internal filesystem arrays.
|
| void | fs_insert_filesystem (struct filesystem *filesystem) |
| | Inserts filesystem struct into internal array.
|
| struct filesystem * | fs_resolve (struct disk *disk) |
| | Resolves filesystem for given disk.
|
| int | fopen (const char *filename, const char *mode) |
| | Opens file.
|
| int | fread (void *ptr, uint32_t size, uint32_t nmemb, int fd) |
| | Reads from file.
|
| int | fwrite (void *ptr, uint32_t size, uint32_t nmemb, int fd) |
| | Writes to file.
|
| int | fseek (int fd, int offset, FILE_SEEK_MODE whence) |
| | Seeks into file.
|
| int | fstat (int fd, struct file_stat *stat) |
| | Returns file status.
|
| int | fclose (int fd) |
| | Closes file descriptor.
|
| void | mount (const char *filename, struct filesystem *fs, void *data) |
◆ MAX_FILEDESCRIPTORS
| #define MAX_FILEDESCRIPTORS 1024 |
◆ MAX_FILESYSTEM_NAME
| #define MAX_FILESYSTEM_NAME 20 |
◆ MAX_FILESYSTEMS
| #define MAX_FILESYSTEMS 12 |
◆ MAX_MOUNTED
| #define MAX_MOUNTED 16384 |
◆ FILE_MODE
◆ FILE_SEEK_MODE
◆ FILE_STAT_FLAGS
◆ FS_CLOSE_FUNCTION
| typedef int(* FS_CLOSE_FUNCTION) (void *private_fs) |
◆ FS_OPEN_FUNCTION
| typedef void *(* FS_OPEN_FUNCTION) (void *private_fs, struct path_part *path, FILE_MODE mode) |
◆ FS_READ_FUNCTION
| typedef int(* FS_READ_FUNCTION) (void *private_fs, void *descriptor, uint32_t size, uint32_t nmemb, char *out) |
◆ FS_RESOLVE_FUNCTION
| typedef int(* FS_RESOLVE_FUNCTION) (struct disk *disk) |
◆ FS_SEEK_FUNCTION
◆ FS_STAT_FUNCTION
| typedef int(* FS_STAT_FUNCTION) (void *private_fs, struct file_stat *stat) |
◆ FS_WRITE_FUNCTION
| typedef int(* FS_WRITE_FUNCTION) (void *private_fs, void *descriptor, uint32_t size, uint32_t nmemb, char *in) |
◆ FILE_OPEN_MODES
| Enumerator |
|---|
| FILE_MODE_READ | |
| FILE_MODE_WRITE | |
| FILE_MODE_APPEND | |
| FILE_MODE_INVALID | |
◆ FILE_SEEK_MODES
| Enumerator |
|---|
| SEEK_SET | Absolute position from 0.
|
| SEEK_CUR | Relative position.
|
| SEEK_END | Absolute position from the end of file.
|
◆ FILE_STAT_FLAGS_ENUM
| Enumerator |
|---|
| FILE_STAT_READ_ONLY | |
| FILE_STAT_FOLDER | |
◆ fclose()
Closes file descriptor.
- Parameters
-
- Returns
- int Status
◆ fopen()
| int fopen |
( |
const char * | filename, |
|
|
const char * | str_mode ) |
Opens file.
- Parameters
-
- Returns
- int Status
◆ fread()
| int fread |
( |
void * | ptr, |
|
|
uint32_t | size, |
|
|
uint32_t | nmemb, |
|
|
int | fd ) |
Reads from file.
- Parameters
-
| ptr | Output buffer |
| size | Size in bytes of block |
| nmemb | Number of blocks to read |
| fd | File descriptor |
- Returns
- int Status
◆ fs_init()
◆ fs_insert_filesystem()
| void fs_insert_filesystem |
( |
struct filesystem * | filesystem | ) |
|
◆ fs_resolve()
◆ fseek()
Seeks into file.
- Parameters
-
| fd | File descriptor |
| offset | Seek offset |
| whence | File seek mode (SEEK_SET for absolute, SEEK_CUR for relative) |
- Returns
- int Status
◆ fstat()
| int fstat |
( |
int | fd, |
|
|
struct file_stat * | stat ) |
Returns file status.
- Parameters
-
| fd | File descriptor |
| stat | Output file status struct |
- Returns
- int Status
◆ fwrite()
| int fwrite |
( |
void * | ptr, |
|
|
uint32_t | size, |
|
|
uint32_t | nmemb, |
|
|
int | fd ) |
Writes to file.
- Parameters
-
| ptr | Input buffer |
| size | Size in bytes of block |
| nmemb | Number of blocks to read |
| fd | File descriptor |
- Returns
- int Status
◆ mount()
| void mount |
( |
const char * | filename, |
|
|
struct filesystem * | fs, |
|
|
void * | data ) |
References data, mounted_file::data, filename, mounted_file::filename, fs, mounted_file::fs, kdebug, kernel_panic(), kzalloc(), MAX_MOUNTED, and mounted.