2#ifndef CPAKFS_UTILS__H__
3#define CPAKFS_UTILS__H__
19#define FS_BLOCK_DIVIDER (8 * 32)
25#define MAX_NUM_NOTES 16
139 const char *desired_name,
140 char *out_fullpath,
size_t outsz,
141 int (*exists_fullpath)(
const char *fullpath));
int extract_title_from_absolute_path(const char *path, char *outbuf, size_t outbuf_size)
Extract the title from an absolute file path.
Definition cpakfs_utils.c:118
const char *const CPAK_MOUNT_ARRAY[4]
Array of Controller Pak mount point strings (e.g., "cpak1:/").
Definition cpakfs_utils.c:18
int pick_unique_fullname_with_mount(const char *mount_prefix, const char *desired_name, char *out_fullpath, size_t outsz, int(*exists_fullpath)(const char *fullpath))
Pick a unique full filename with mount prefix, avoiding collisions.
Definition cpakfs_utils.c:335
int parse_cpakfs_fullname(const char *fullname, cpakfs_path_strings_t *out)
Parse a Controller Pak full filename into its components.
Definition cpakfs_utils.c:156
int mount_cpakfs(int controller)
Mount the Controller Pak file system for a given controller.
Definition cpakfs_utils.c:100
int inc_index_note(int current_index)
Increment a note index, wrapping around MAX_NUM_NOTES.
Definition cpakfs_utils.c:80
int file_exists_full(const char *full_mounted_path)
Check if a file exists at the given full mounted path.
Definition cpakfs_utils.c:396
bool has_cpak(int controller)
Check if a Controller Pak is present in the given controller.
Definition cpakfs_utils.c:28
int get_file_size_from_fs_path(const char *filename_cpak)
Get the file size from a Controller Pak file system path.
Definition cpakfs_utils.c:49
int get_block_size_from_fs_path(const char *filename_cpak)
Get the block size from a Controller Pak file system path.
Definition cpakfs_utils.c:39
void unmount_all_cpakfs(void)
Unmount all Controller Pak file systems.
Definition cpakfs_utils.c:63
int dec_index_note(int current_index)
Decrement a note index, wrapping around MAX_NUM_NOTES.
Definition cpakfs_utils.c:90
Structure holding parsed components of a Controller Pak file path.
Definition cpakfs_utils.h:34