mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-07 23:10:42 +01:00
Add devoptab support to crt
This commit is contained in:
parent
4675d484c1
commit
0aa7a3e021
@ -11,6 +11,9 @@
|
|||||||
* want to run in parallel. You must ensure the previous filesystem command
|
* want to run in parallel. You must ensure the previous filesystem command
|
||||||
* has been completed before reusing the same FSCmdBlock, you do not need to
|
* has been completed before reusing the same FSCmdBlock, you do not need to
|
||||||
* reinitialise an FSCmdBlock before reusing it.
|
* reinitialise an FSCmdBlock before reusing it.
|
||||||
|
*
|
||||||
|
* Calling fsDevInit initializes the stdlib devoptab, allowing for standard
|
||||||
|
* file IO.
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -93,6 +96,21 @@ typedef enum FSError
|
|||||||
FS_ERROR_INVALID_MEDIA = -0x30033,
|
FS_ERROR_INVALID_MEDIA = -0x30033,
|
||||||
} FSError;
|
} FSError;
|
||||||
|
|
||||||
|
typedef enum FSMode
|
||||||
|
{
|
||||||
|
FS_MODE_READ_OWNER = 0x400,
|
||||||
|
FS_MODE_WRITE_OWNER = 0x200,
|
||||||
|
FS_MODE_EXEC_OWNER = 0x100,
|
||||||
|
|
||||||
|
FS_MODE_READ_GROUP = 0x040,
|
||||||
|
FS_MODE_WRITE_GROUP = 0x020,
|
||||||
|
FS_MODE_EXEC_GROUP = 0x010,
|
||||||
|
|
||||||
|
FS_MODE_READ_OTHER = 0x004,
|
||||||
|
FS_MODE_WRITE_OTHER = 0x002,
|
||||||
|
FS_MODE_EXEC_OTHER = 0x001,
|
||||||
|
} FSMode;
|
||||||
|
|
||||||
typedef enum FSStatFlags
|
typedef enum FSStatFlags
|
||||||
{
|
{
|
||||||
FS_STAT_DIRECTORY = 0x80000000,
|
FS_STAT_DIRECTORY = 0x80000000,
|
||||||
@ -114,6 +132,12 @@ typedef enum FSVolumeState
|
|||||||
FS_VOLUME_STATE_INVALID = 11,
|
FS_VOLUME_STATE_INVALID = 11,
|
||||||
} FSVolumeState;
|
} FSVolumeState;
|
||||||
|
|
||||||
|
typedef enum FSMountSourceType
|
||||||
|
{
|
||||||
|
FS_MOUNT_SOURCE_SD = 0,
|
||||||
|
FS_MOUNT_SOURCE_UNK = 1,
|
||||||
|
} FSMountSourceType;
|
||||||
|
|
||||||
typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
|
typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
|
||||||
|
|
||||||
struct FSClient
|
struct FSClient
|
||||||
@ -131,7 +155,9 @@ CHECK_SIZE(FSCmdBlock, 0xA80);
|
|||||||
struct FSStat
|
struct FSStat
|
||||||
{
|
{
|
||||||
FSStatFlags flags;
|
FSStatFlags flags;
|
||||||
UNKNOWN(0xC);
|
FSMode mode;
|
||||||
|
uint32_t owner;
|
||||||
|
uint32_t group;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
UNKNOWN(0x50);
|
UNKNOWN(0x50);
|
||||||
};
|
};
|
||||||
@ -163,6 +189,12 @@ struct FSDirectoryEntry
|
|||||||
CHECK_OFFSET(FSDirectoryEntry, 0x64, name);
|
CHECK_OFFSET(FSDirectoryEntry, 0x64, name);
|
||||||
CHECK_SIZE(FSDirectoryEntry, 0x164);
|
CHECK_SIZE(FSDirectoryEntry, 0x164);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
fsDevInit();
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
fsDevExit();
|
||||||
|
|
||||||
void
|
void
|
||||||
FSInit();
|
FSInit();
|
||||||
|
|
||||||
@ -226,6 +258,20 @@ FSGetStatAsync(FSClient *client,
|
|||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSRemove(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
const char *path,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSRemoveAsync(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
const char *path,
|
||||||
|
uint32_t flags,
|
||||||
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSOpenFile(FSClient *client,
|
FSOpenFile(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
@ -271,6 +317,19 @@ FSOpenDirAsync(FSClient *client,
|
|||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSMakeDir(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
const char *path,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSMakeDirAsync(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
const char *path,
|
||||||
|
uint32_t flags,
|
||||||
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSReadDir(FSClient *client,
|
FSReadDir(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
@ -286,6 +345,12 @@ FSReadDirAsync(FSClient *client,
|
|||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSRewindDir(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
FSDirectoryHandle handle,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSCloseDir(FSClient *client,
|
FSCloseDir(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
@ -358,6 +423,50 @@ FSReadFileWithPosAsync(FSClient *client,
|
|||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSWriteFile(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
uint8_t *buffer,
|
||||||
|
uint32_t size,
|
||||||
|
uint32_t count,
|
||||||
|
FSFileHandle handle,
|
||||||
|
uint32_t unk1,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSWriteFileAsync(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
uint8_t *buffer,
|
||||||
|
uint32_t size,
|
||||||
|
uint32_t count,
|
||||||
|
FSFileHandle handle,
|
||||||
|
uint32_t unk1,
|
||||||
|
uint32_t flags,
|
||||||
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSWriteFileWithPos(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
uint8_t *buffer,
|
||||||
|
uint32_t size,
|
||||||
|
uint32_t count,
|
||||||
|
uint32_t pos,
|
||||||
|
FSFileHandle handle,
|
||||||
|
uint32_t unk1,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSWriteFileWithPosAsync(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
uint8_t *buffer,
|
||||||
|
uint32_t size,
|
||||||
|
uint32_t count,
|
||||||
|
uint32_t pos,
|
||||||
|
FSFileHandle handle,
|
||||||
|
uint32_t unk1,
|
||||||
|
uint32_t flags,
|
||||||
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSStatus
|
FSStatus
|
||||||
FSGetPosFile(FSClient *client,
|
FSGetPosFile(FSClient *client,
|
||||||
FSCmdBlock *block,
|
FSCmdBlock *block,
|
||||||
@ -388,12 +497,74 @@ FSSetPosFileAsync(FSClient *client,
|
|||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
FSAsyncData *asyncData);
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSFlushFile(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
FSFileHandle handle,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSFlushFileAsync(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
FSFileHandle handle,
|
||||||
|
uint32_t flags,
|
||||||
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSTruncateFile(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
FSFileHandle handle,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSTruncateFileAsync(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
FSFileHandle handle,
|
||||||
|
uint32_t flags,
|
||||||
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSRename(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
const char *oldPath,
|
||||||
|
const char *newPath,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSRenameAsync(FSClient *client,
|
||||||
|
FSCmdBlock *block,
|
||||||
|
const char *oldPath,
|
||||||
|
const char *newPath,
|
||||||
|
uint32_t flags,
|
||||||
|
FSAsyncData *asyncData);
|
||||||
|
|
||||||
FSVolumeState
|
FSVolumeState
|
||||||
FSGetVolumeState(FSClient *client);
|
FSGetVolumeState(FSClient *client);
|
||||||
|
|
||||||
FSError
|
FSError
|
||||||
FSGetLastErrorCodeForViewer(FSClient *client);
|
FSGetLastErrorCodeForViewer(FSClient *client);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSGetMountSource(FSClient *client,
|
||||||
|
FSCmdBlock *cmd,
|
||||||
|
FSMountSourceType type,
|
||||||
|
void *out,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSMount(FSClient *client,
|
||||||
|
FSCmdBlock *cmd,
|
||||||
|
void *source,
|
||||||
|
const char *target,
|
||||||
|
uint32_t bytes,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
FSStatus
|
||||||
|
FSUnmount(FSClient *client,
|
||||||
|
FSCmdBlock *cmd,
|
||||||
|
const char *target,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -129,14 +129,19 @@ EXPORT(FSChangeDir);
|
|||||||
EXPORT(FSChangeDirAsync);
|
EXPORT(FSChangeDirAsync);
|
||||||
EXPORT(FSGetStat);
|
EXPORT(FSGetStat);
|
||||||
EXPORT(FSGetStatAsync);
|
EXPORT(FSGetStatAsync);
|
||||||
|
EXPORT(FSRemove);
|
||||||
|
EXPORT(FSRemoveAsync);
|
||||||
EXPORT(FSOpenFile);
|
EXPORT(FSOpenFile);
|
||||||
EXPORT(FSOpenFileAsync);
|
EXPORT(FSOpenFileAsync);
|
||||||
EXPORT(FSCloseFile);
|
EXPORT(FSCloseFile);
|
||||||
EXPORT(FSCloseFileAsync);
|
EXPORT(FSCloseFileAsync);
|
||||||
EXPORT(FSOpenDir);
|
EXPORT(FSOpenDir);
|
||||||
EXPORT(FSOpenDirAsync);
|
EXPORT(FSOpenDirAsync);
|
||||||
|
EXPORT(FSMakeDir);
|
||||||
|
EXPORT(FSMakeDirAsync);
|
||||||
EXPORT(FSReadDir);
|
EXPORT(FSReadDir);
|
||||||
EXPORT(FSReadDirAsync);
|
EXPORT(FSReadDirAsync);
|
||||||
|
EXPORT(FSRewindDir);
|
||||||
EXPORT(FSCloseDir);
|
EXPORT(FSCloseDir);
|
||||||
EXPORT(FSCloseDirAsync);
|
EXPORT(FSCloseDirAsync);
|
||||||
EXPORT(FSGetStatFile);
|
EXPORT(FSGetStatFile);
|
||||||
@ -145,12 +150,25 @@ EXPORT(FSReadFile);
|
|||||||
EXPORT(FSReadFileAsync);
|
EXPORT(FSReadFileAsync);
|
||||||
EXPORT(FSReadFileWithPos);
|
EXPORT(FSReadFileWithPos);
|
||||||
EXPORT(FSReadFileWithPosAsync);
|
EXPORT(FSReadFileWithPosAsync);
|
||||||
|
EXPORT(FSWriteFile);
|
||||||
|
EXPORT(FSWriteFileAsync);
|
||||||
|
EXPORT(FSWriteFileWithPos);
|
||||||
|
EXPORT(FSWriteFileWithPosAsync);
|
||||||
EXPORT(FSGetPosFile);
|
EXPORT(FSGetPosFile);
|
||||||
EXPORT(FSGetPosFileAsync);
|
EXPORT(FSGetPosFileAsync);
|
||||||
EXPORT(FSSetPosFile);
|
EXPORT(FSSetPosFile);
|
||||||
EXPORT(FSSetPosFileAsync);
|
EXPORT(FSSetPosFileAsync);
|
||||||
|
EXPORT(FSFlushFile);
|
||||||
|
EXPORT(FSFlushFileAsync);
|
||||||
|
EXPORT(FSTruncateFile);
|
||||||
|
EXPORT(FSTruncateFileAsync);
|
||||||
|
EXPORT(FSRename);
|
||||||
|
EXPORT(FSRenameAsync);
|
||||||
EXPORT(FSGetVolumeState);
|
EXPORT(FSGetVolumeState);
|
||||||
EXPORT(FSGetLastErrorCodeForViewer);
|
EXPORT(FSGetLastErrorCodeForViewer);
|
||||||
|
EXPORT(FSGetMountSource);
|
||||||
|
EXPORT(FSMount);
|
||||||
|
EXPORT(FSUnmount);
|
||||||
|
|
||||||
// coreinit/foreground.h
|
// coreinit/foreground.h
|
||||||
EXPORT(OSEnableForegroundExit);
|
EXPORT(OSEnableForegroundExit);
|
||||||
|
1035
rpl/libcoreinit/fs_dev.c
Normal file
1035
rpl/libcoreinit/fs_dev.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user