Jo Engine
2024.04.28
Jo Sega Saturn Engine
|
Jo Engine File System function prototypes. More...
Go to the source code of this file.
Macros | |
#define | JO_ROOT_DIR |
Specify the root directory (on the CD) for jo_fs_read_file(), jo_map_load_from_file(), etc. More... | |
#define | JO_CURRENT_DIR |
Specify the current directory (on the CD) for jo_fs_read_file(), jo_map_load_from_file(), etc. More... | |
#define | JO_PARENT_DIR |
Specify the parent directory for jo_fs_read_file(), jo_map_load_from_file(), etc. More... | |
Typedefs | |
typedef void(* | jo_fs_async_read_callback) (char *contents, int length, int optional_token) |
Function prototype for () More... | |
Functions | |
void | jo_fs_cd (const char *const sub_dir) |
Change the current directory (equivalent of Unix cd command) More... | |
char * | jo_fs_read_file_in_dir (const char *const filename, const char *const sub_dir, int *len) |
Read a file on the CD. More... | |
char * | jo_fs_read_file_ptr (const char *const filename, void *buf, int *len) |
Read a file on the CD and put the contents to "buf". More... | |
static __jo_force_inline char * | jo_fs_read_file (const char *const filename, int *len) |
Read a file on the CD. More... | |
bool | jo_fs_read_file_async_ptr (const char *const filename, jo_fs_async_read_callback callback, int optional_token, void *buf) |
Read a file on the CD asynchronously and put the contents to "buf". More... | |
static __jo_force_inline bool | jo_fs_read_file_async (const char *const filename, jo_fs_async_read_callback callback, int optional_token) |
Read a file on the CD asynchronously. More... | |
bool | jo_fs_open (jo_file *const file, const char *const filename) |
Open a file. More... | |
void | jo_fs_close (jo_file *const file) |
Close a file. More... | |
int | jo_fs_read_next_bytes (jo_file *const file, char *buffer, unsigned int nbytes) |
Read bytes from a file. More... | |
bool | jo_fs_seek_forward (jo_file *const file, unsigned int nbytes) |
Seek forward from current position of a file. More... | |
Jo Engine File System function prototypes.
#define JO_CURRENT_DIR |
Specify the current directory (on the CD) for jo_fs_read_file(), jo_map_load_from_file(), etc.
#define JO_PARENT_DIR |
Specify the parent directory for jo_fs_read_file(), jo_map_load_from_file(), etc.
#define JO_ROOT_DIR |
Specify the root directory (on the CD) for jo_fs_read_file(), jo_map_load_from_file(), etc.
typedef void(* jo_fs_async_read_callback) (char *contents, int length, int optional_token) |
Function prototype for ()
void jo_fs_cd | ( | const char *const | sub_dir | ) |
Change the current directory (equivalent of Unix cd command)
sub_dir | Sub directory name (use JO_PARENT_DIR for parent directory) |
void jo_fs_close | ( | jo_file *const | file | ) |
Close a file.
file | Pointer to an allocated and valid jo_file struct |
bool jo_fs_open | ( | jo_file *const | file, |
const char *const | filename | ||
) |
Open a file.
file | Pointer to an allocated jo_file struct |
filename | Filename (upper case and shorter as possible like "A.TXT") |
|
static |
Read a file on the CD.
filename | Filename (upper case and shorter as possible like "A.TXT") |
len | return the file length |
|
static |
Read a file on the CD asynchronously.
filename | Filename (upper case and shorter as possible like "A.TXT") |
callback | Callback called when the file is loaded |
optional_token | User value to identify the file |
bool jo_fs_read_file_async_ptr | ( | const char *const | filename, |
jo_fs_async_read_callback | callback, | ||
int | optional_token, | ||
void * | buf | ||
) |
Read a file on the CD asynchronously and put the contents to "buf".
filename | Filename (upper case and shorter as possible like "A.TXT") |
callback | Callback called when the file is loaded |
optional_token | User value to identify the file |
buf | Output buffer |
char* jo_fs_read_file_in_dir | ( | const char *const | filename, |
const char *const | sub_dir, | ||
int * | len | ||
) |
Read a file on the CD.
filename | Filename (upper case and shorter as possible like "A.TXT") |
sub_dir | Sub directory name (use JO_ROOT_DIR if the file is on the root directory) |
len | return the file length |
char* jo_fs_read_file_ptr | ( | const char *const | filename, |
void * | buf, | ||
int * | len | ||
) |
Read a file on the CD and put the contents to "buf".
filename | Filename (upper case and shorter as possible like "A.TXT") |
buf | Output buffer |
len | return the file length |
int jo_fs_read_next_bytes | ( | jo_file *const | file, |
char * | buffer, | ||
unsigned int | nbytes | ||
) |
Read bytes from a file.
file | Pointer to an allocated and valid jo_file struct |
buffer | Pointer to an allocated buffer (length >= nbytes) |
nbytes | number of bytes to read |