libctru  v2.3.1
Data Structures | Functions
romfs.h File Reference

RomFS driver. More...

#include <3ds/types.h>
#include <3ds/services/fs.h>

Go to the source code of this file.

Data Structures

struct  romfs_header
 RomFS header. More...
 
struct  romfs_dir
 RomFS directory. More...
 
struct  romfs_file
 RomFS file. More...
 

Functions

Result romfsMountSelf (const char *name)
 Mounts the Application's RomFS. More...
 
Result romfsMountFromFile (Handle fd, u32 offset, const char *name)
 Mounts RomFS from an open file. More...
 
Result romfsMountFromCurrentProcess (const char *name)
 Mounts RomFS using the current process host program RomFS. More...
 
Result romfsMountFromTitle (u64 tid, FS_MediaType mediatype, const char *name)
 Mounts RomFS from the specified title. More...
 
Result romfsUnmount (const char *name)
 Unmounts the RomFS device.
 
static Result romfsInit (void)
 Wrapper for romfsMountSelf with the default "romfs" device name.
 
static Result romfsExit (void)
 Wrapper for romfsUnmount with the default "romfs" device name.
 

Detailed Description

RomFS driver.

Function Documentation

◆ romfsMountFromCurrentProcess()

Result romfsMountFromCurrentProcess ( const char *  name)

Mounts RomFS using the current process host program RomFS.

Parameters
nameDevice mount name.

◆ romfsMountFromFile()

Result romfsMountFromFile ( Handle  fd,
u32  offset,
const char *  name 
)

Mounts RomFS from an open file.

Parameters
fdFSFILE handle of the RomFS image.
offsetOffset of the RomFS within the file.
nameDevice mount name.

◆ romfsMountFromTitle()

Result romfsMountFromTitle ( u64  tid,
FS_MediaType  mediatype,
const char *  name 
)

Mounts RomFS from the specified title.

Parameters
tidTitle ID
mediatypeMediatype
nameDevice mount name.

◆ romfsMountSelf()

Result romfsMountSelf ( const char *  name)

Mounts the Application's RomFS.

Parameters
nameDevice mount name.
Remarks
This function is intended to be used to access one's own RomFS. If the application is running as 3DSX, it mounts the embedded RomFS section inside the 3DSX. If on the other hand it's an NCCH, it behaves identically to romfsMountFromCurrentProcess.