coreinit/filesystem: Add FSErrorFlag

This commit is contained in:
Maschell 2020-12-29 10:01:56 +01:00 committed by fincs
parent 79b8597a68
commit aa31f61966

View File

@ -35,6 +35,24 @@ typedef struct FSMountSource FSMountSource;
typedef struct FSStat FSStat; typedef struct FSStat FSStat;
typedef struct FSStateChangeInfo FSStateChangeInfo; typedef struct FSStateChangeInfo FSStateChangeInfo;
typedef enum FSErrorFlag
{
FS_ERROR_FLAG_NONE = 0x0,
FS_ERROR_FLAG_MAX = 0x1,
FS_ERROR_FLAG_ALREADY_OPEN = 0x2,
FS_ERROR_FLAG_EXISTS = 0x4,
FS_ERROR_FLAG_NOT_FOUND = 0x8,
FS_ERROR_FLAG_NOT_FILE = 0x10,
FS_ERROR_FLAG_NOT_DIR = 0x20,
FS_ERROR_FLAG_ACCESS_ERROR = 0x40,
FS_ERROR_FLAG_PERMISSION_ERROR = 0x80,
FS_ERROR_FLAG_FILE_TOO_BIG = 0x100,
FS_ERROR_FLAG_STORAGE_FULL = 0x200,
FS_ERROR_FLAG_UNSUPPORTED_CMD = 0x400,
FS_ERROR_FLAG_JOURNAL_FULL = 0x800,
FS_ERROR_FLAG_ALL = 0xFFFFFFFF,
} FSErrorFlag;
typedef enum FSStatus typedef enum FSStatus
{ {
FS_STATUS_OK = 0, FS_STATUS_OK = 0,
@ -261,11 +279,11 @@ FSShutdown();
FSStatus FSStatus
FSAddClient(FSClient *client, FSAddClient(FSClient *client,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSDelClient(FSClient *client, FSDelClient(FSClient *client,
uint32_t flags); FSErrorFlag errorMask);
uint32_t uint32_t
FSGetClientNum(); FSGetClientNum();
@ -286,19 +304,19 @@ FSGetCwd(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
char *buffer, char *buffer,
uint32_t bufferSize, uint32_t bufferSize,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSChangeDir(FSClient *client, FSChangeDir(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSChangeDirAsync(FSClient *client, FSChangeDirAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSAsyncResult * FSAsyncResult *
@ -309,27 +327,27 @@ FSGetStat(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
FSStat *stat, FSStat *stat,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSGetStatAsync(FSClient *client, FSGetStatAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
FSStat *stat, FSStat *stat,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
FSRemove(FSClient *client, FSRemove(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSRemoveAsync(FSClient *client, FSRemoveAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
@ -339,7 +357,7 @@ FSOpenFile(FSClient *client,
const char *path, const char *path,
const char *mode, const char *mode,
FSFileHandle *handle, FSFileHandle *handle,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSOpenFileAsync(FSClient *client, FSOpenFileAsync(FSClient *client,
@ -347,20 +365,20 @@ FSOpenFileAsync(FSClient *client,
const char *path, const char *path,
const char *mode, const char *mode,
FSFileHandle *outHandle, FSFileHandle *outHandle,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
FSCloseFile(FSClient *client, FSCloseFile(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSCloseFileAsync(FSClient *client, FSCloseFileAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -368,27 +386,27 @@ FSOpenDir(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
FSDirectoryHandle *handle, FSDirectoryHandle *handle,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSOpenDirAsync(FSClient *client, FSOpenDirAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
FSDirectoryHandle *handle, FSDirectoryHandle *handle,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
FSMakeDir(FSClient *client, FSMakeDir(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSMakeDirAsync(FSClient *client, FSMakeDirAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *path, const char *path,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -396,47 +414,47 @@ FSReadDir(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSDirectoryHandle handle, FSDirectoryHandle handle,
FSDirectoryEntry *entry, FSDirectoryEntry *entry,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSReadDirAsync(FSClient *client, FSReadDirAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSDirectoryHandle handle, FSDirectoryHandle handle,
FSDirectoryEntry *entry, FSDirectoryEntry *entry,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
FSRewindDir(FSClient *client, FSRewindDir(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSDirectoryHandle handle, FSDirectoryHandle handle,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSCloseDir(FSClient *client, FSCloseDir(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSDirectoryHandle handle, FSDirectoryHandle handle,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSCloseDirAsync(FSClient *client, FSCloseDirAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSDirectoryHandle handle, FSDirectoryHandle handle,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
FSChangeMode(FSClient *client, FSChangeMode(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
char *path, char *path,
FSMode mode, FSMode mode,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSChangeModeAsync(FSClient *client, FSChangeModeAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
char *path, char *path,
FSMode mode, FSMode mode,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -444,14 +462,14 @@ FSGetFreeSpaceSize(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
char *path, char *path,
uint64_t *outSize, uint64_t *outSize,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSGetFreeSpaceSizeAsync(FSClient *client, FSGetFreeSpaceSizeAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
char *path, char *path,
uint64_t *outSize, uint64_t *outSize,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -459,14 +477,14 @@ FSGetStatFile(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
FSStat *stat, FSStat *stat,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSGetStatFileAsync(FSClient *client, FSGetStatFileAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
FSStat *stat, FSStat *stat,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -477,7 +495,7 @@ FSReadFile(FSClient *client,
uint32_t count, uint32_t count,
FSFileHandle handle, FSFileHandle handle,
uint32_t unk1, uint32_t unk1,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSReadFileAsync(FSClient *client, FSReadFileAsync(FSClient *client,
@ -487,7 +505,7 @@ FSReadFileAsync(FSClient *client,
uint32_t count, uint32_t count,
FSFileHandle handle, FSFileHandle handle,
uint32_t unk1, uint32_t unk1,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -499,7 +517,7 @@ FSReadFileWithPos(FSClient *client,
uint32_t pos, uint32_t pos,
FSFileHandle handle, FSFileHandle handle,
uint32_t unk1, uint32_t unk1,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSReadFileWithPosAsync(FSClient *client, FSReadFileWithPosAsync(FSClient *client,
@ -510,7 +528,7 @@ FSReadFileWithPosAsync(FSClient *client,
uint32_t pos, uint32_t pos,
FSFileHandle handle, FSFileHandle handle,
uint32_t unk1, uint32_t unk1,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -521,7 +539,7 @@ FSWriteFile(FSClient *client,
uint32_t count, uint32_t count,
FSFileHandle handle, FSFileHandle handle,
uint32_t unk1, uint32_t unk1,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSWriteFileAsync(FSClient *client, FSWriteFileAsync(FSClient *client,
@ -531,7 +549,7 @@ FSWriteFileAsync(FSClient *client,
uint32_t count, uint32_t count,
FSFileHandle handle, FSFileHandle handle,
uint32_t unk1, uint32_t unk1,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -543,7 +561,7 @@ FSWriteFileWithPos(FSClient *client,
uint32_t pos, uint32_t pos,
FSFileHandle handle, FSFileHandle handle,
uint32_t unk1, uint32_t unk1,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSWriteFileWithPosAsync(FSClient *client, FSWriteFileWithPosAsync(FSClient *client,
@ -554,7 +572,7 @@ FSWriteFileWithPosAsync(FSClient *client,
uint32_t pos, uint32_t pos,
FSFileHandle handle, FSFileHandle handle,
uint32_t unk1, uint32_t unk1,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -562,14 +580,14 @@ FSGetPosFile(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle fileHandle, FSFileHandle fileHandle,
uint32_t *pos, uint32_t *pos,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSGetPosFileAsync(FSClient *client, FSGetPosFileAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle fileHandle, FSFileHandle fileHandle,
uint32_t *pos, uint32_t *pos,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -577,40 +595,40 @@ FSSetPosFile(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
uint32_t pos, uint32_t pos,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSSetPosFileAsync(FSClient *client, FSSetPosFileAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
uint32_t pos, uint32_t pos,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
FSFlushFile(FSClient *client, FSFlushFile(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSFlushFileAsync(FSClient *client, FSFlushFileAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
FSTruncateFile(FSClient *client, FSTruncateFile(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSTruncateFileAsync(FSClient *client, FSTruncateFileAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
FSFileHandle handle, FSFileHandle handle,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSStatus FSStatus
@ -618,14 +636,14 @@ FSRename(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *oldPath, const char *oldPath,
const char *newPath, const char *newPath,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSRenameAsync(FSClient *client, FSRenameAsync(FSClient *client,
FSCmdBlock *block, FSCmdBlock *block,
const char *oldPath, const char *oldPath,
const char *newPath, const char *newPath,
uint32_t flags, FSErrorFlag errorMask,
FSAsyncData *asyncData); FSAsyncData *asyncData);
FSVolumeState FSVolumeState
@ -639,7 +657,7 @@ FSGetMountSource(FSClient *client,
FSCmdBlock *cmd, FSCmdBlock *cmd,
FSMountSourceType type, FSMountSourceType type,
FSMountSource *out, FSMountSource *out,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSMount(FSClient *client, FSMount(FSClient *client,
@ -647,26 +665,26 @@ FSMount(FSClient *client,
FSMountSource *source, FSMountSource *source,
const char *target, const char *target,
uint32_t bytes, uint32_t bytes,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSUnmount(FSClient *client, FSUnmount(FSClient *client,
FSCmdBlock *cmd, FSCmdBlock *cmd,
const char *target, const char *target,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSBindMount(FSClient *client, FSBindMount(FSClient *client,
FSCmdBlock *cmd, FSCmdBlock *cmd,
const char *source, const char *source,
const char *target, const char *target,
uint32_t flags); FSErrorFlag errorMask);
FSStatus FSStatus
FSbindUnmount(FSClient *client, FSbindUnmount(FSClient *client,
FSCmdBlock *cmd, FSCmdBlock *cmd,
const char *target, const char *target,
uint32_t flags); FSErrorFlag errorMask);
#ifdef __cplusplus #ifdef __cplusplus
} }