diff --git a/include/coreinit/filesystem.h b/include/coreinit/filesystem.h index 2088c25..006ced5 100644 --- a/include/coreinit/filesystem.h +++ b/include/coreinit/filesystem.h @@ -32,40 +32,87 @@ typedef struct FSStateChangeInfo FSStateChangeInfo; typedef enum FSStatus { - FS_STATUS_OK = 0, - FS_STATUS_CANCELLED = -1, - FS_STATUS_END = -2, - FS_STATUS_MAX = -3, - FS_STATUS_ALREADY_OPEN = -4, - FS_STATUS_EXISTS = -5, - FS_STATUS_NOT_FOUND = -6, - FS_STATUS_NOT_FILE = -7, - FS_STATUS_NOT_DIR = -8, - FS_STATUS_ACCESS_ERROR = -9, - FS_STATUS_PERMISSION_ERROR = -10, - FS_STATUS_FILE_TOO_BIG = -11, - FS_STATUS_STORAGE_FULL = -12, - FS_STATUS_JOURNAL_FULL = -13, - FS_STATUS_UNSUPPORTED_CMD = -14, - FS_STATUS_MEDIA_NOT_READY = -15, - FS_STATUS_MEDIA_ERROR = -17, - FS_STATUS_CORRUPTED = -18, - FS_STATUS_FATAL_ERROR = -0x400, + FS_STATUS_OK = 0, + FS_STATUS_CANCELLED = -1, + FS_STATUS_END = -2, + FS_STATUS_MAX = -3, + FS_STATUS_ALREADY_OPEN = -4, + FS_STATUS_EXISTS = -5, + FS_STATUS_NOT_FOUND = -6, + FS_STATUS_NOT_FILE = -7, + FS_STATUS_NOT_DIR = -8, + FS_STATUS_ACCESS_ERROR = -9, + FS_STATUS_PERMISSION_ERROR = -10, + FS_STATUS_FILE_TOO_BIG = -11, + FS_STATUS_STORAGE_FULL = -12, + FS_STATUS_JOURNAL_FULL = -13, + FS_STATUS_UNSUPPORTED_CMD = -14, + FS_STATUS_MEDIA_NOT_READY = -15, + FS_STATUS_MEDIA_ERROR = -17, + FS_STATUS_CORRUPTED = -18, + FS_STATUS_FATAL_ERROR = -0x400, } FSStatus; typedef enum FSError { - FS_ERROR_NOT_INIT = -0x30001, + FS_ERROR_NOT_INIT = -0x30001, + FS_ERROR_BUSY = -0x30002, + FS_ERROR_CANCELLED = -0x30003, + FS_ERROR_END_OF_DIR = -0x30004, + FS_ERROR_END_OF_FILE = -0x30005, + FS_ERROR_MAX_MOUNT_POINTS = -0x30010, + FS_ERROR_MAX_VOLUMES = -0x30011, + FS_ERROR_MAX_CLIENTS = -0x30012, + FS_ERROR_MAX_FILES = -0x30013, + FS_ERROR_MAX_DIRS = -0x30014, + FS_ERROR_ALREADY_OPEN = -0x30015, + FS_ERROR_ALREADY_EXISTS = -0x30016, + FS_ERROR_NOT_FOUND = -0x30017, + FS_ERROR_NOT_EMPTY = -0x30018, + FS_ERROR_ACCESS_ERROR = -0x30019, + FS_ERROR_PERMISSION_ERROR = -0x3001A, + FS_ERROR_DATA_CORRUPTED = -0x3001B, + FS_ERROR_STORAGE_FULL = -0x3001C, + FS_ERROR_JOURNAL_FULL = -0x3001D, + FS_ERROR_UNAVAILABLE_COMMAND = -0x3001F, + FS_ERROR_UNSUPPORTED_COMMAND = -0x30020, + FS_ERROR_INVALID_PARAM = -0x30021, + FS_ERROR_INVALID_PATH = -0x30022, + FS_ERROR_INVALID_BUFFER = -0x30023, + FS_ERROR_INVALID_ALIGNMENT = -0x30024, + FS_ERROR_INVALID_CLIENTHANDLE = -0x30025, + FS_ERROR_INVALID_FILEHANDLE = -0x30026, + FS_ERROR_INVALID_DIRHANDLE = -0x30027, + FS_ERROR_NOT_FILE = -0x30028, + FS_ERROR_NOT_DIR = -0x30029, + FS_ERROR_FILE_TOO_BIG = -0x3002A, + FS_ERROR_OUT_OF_RANGE = -0x3002B, + FS_ERROR_OUT_OF_RESOURCES = -0x3002C, + FS_ERROR_MEDIA_NOT_READY = -0x30030, + FS_ERROR_MEDIA_ERROR = -0x30031, + FS_ERROR_WRITE_PROTECTED = -0x30032, + FS_ERROR_INVALID_MEDIA = -0x30033, } FSError; typedef enum FSStatFlags { - FS_STAT_DIRECTORY = 0x80000000, + FS_STAT_DIRECTORY = 0x80000000, } FSStatFlags; typedef enum FSVolumeState { - FS_VOLUME_STATE_INIT = 0, + FS_VOLUME_STATE_INITIAL = 0, + FS_VOLUME_STATE_READY = 1, + FS_VOLUME_STATE_NO_MEDIA = 2, + FS_VOLUME_STATE_INVALID_MEDIA = 3, + FS_VOLUME_STATE_DIRTY_MEDIA = 4, + FS_VOLUME_STATE_WRONG_MEDIA = 5, + FS_VOLUME_STATE_MEDIA_ERROR = 6, + FS_VOLUME_STATE_DATA_CORRUPTED = 7, + FS_VOLUME_STATE_WRITE_PROTECTED = 8, + FS_VOLUME_STATE_JOURNAL_FULL = 9, + FS_VOLUME_STATE_FATAL = 10, + FS_VOLUME_STATE_INVALID = 11, } FSVolumeState; typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);