KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Romdisk

VFS driver for accessing romdisks binaries More...

Files

file  fs_romdisk.h
 ROMFS virtual file system.
 

Functions

int fs_romdisk_mount (const char *mountpoint, const uint8 *img, int own_buffer)
 Mount a ROMFS image as a new filesystem.
 
int fs_romdisk_unmount (const char *mountpoint)
 Unmount a ROMFS image.
 

Detailed Description

VFS driver for accessing romdisks binaries

Function Documentation

◆ fs_romdisk_mount()

int fs_romdisk_mount ( const char * mountpoint,
const uint8 * img,
int own_buffer )

Mount a ROMFS image as a new filesystem.

This function will mount a ROMFS image that has been loaded into memory to the specified mountpoint.

Parameters
mountpointThe directory to mount this romdisk on
imgThe ROMFS image
own_bufferIf 0, you are still responsible for img, and must free it if appropriate. If non-zero, img will be freed when it is unmounted
Return values
0On success
-1If fs_romdisk_init not called
-2If img is invalid
-3If a malloc fails

◆ fs_romdisk_unmount()

int fs_romdisk_unmount ( const char * mountpoint)

Unmount a ROMFS image.

This function unmounts a ROMFS image that has been previously mounted with fs_romdisk_mount(). This function does not check for open files on the fs, so make sure that all files have been closed before calling it. If the VFS owns the buffer (own_buffer was non-zero when you called the mount function) then this function will also free the buffer.

Parameters
mountpointThe ROMFS to unmount
Return values
0On success
-1On error
Error Conditions:
ENOENT - no such ROMFS was mounted