WUT  0.1
Wii U Toolchain
Data Structures | Typedefs | Enumerations | Functions
Filesystem

Data Structures

struct  FSClient
 
struct  FSCmdBlock
 
struct  FSStat
 
struct  FSStateChangeInfo
 
struct  FSAsyncData
 
struct  FSDirectoryEntry
 

Typedefs

typedef uint32_t FSDirectoryHandle
 
typedef uint32_t FSFileHandle
 
typedef uint32_t FSPriority
 
typedef struct FSAsyncData FSAsyncData
 
typedef struct FSCmdBlock FSCmdBlock
 
typedef struct FSClient FSClient
 
typedef struct FSDirectoryEntry FSDirectoryEntry
 
typedef struct FSStat FSStat
 
typedef struct FSStateChangeInfo FSStateChangeInfo
 
typedef enum FSStatus FSStatus
 
typedef enum FSError FSError
 
typedef enum FSStatFlags FSStatFlags
 
typedef enum FSVolumeState FSVolumeState
 
typedef void(* FSAsyncCallback) (FSClient *, FSCmdBlock *, FSStatus, uint32_t)
 

Enumerations

enum  FSStatus
 
enum  FSError
 
enum  FSStatFlags
 
enum  FSVolumeState
 

Functions

void FSInit ()
 
void FSShutdown ()
 
FSStatus FSAddClient (FSClient *client, uint32_t flags)
 
FSStatus FSDelClient (FSClient *client, uint32_t flags)
 
uint32_t FSGetClientNum ()
 
void FSInitCmdBlock (FSCmdBlock *block)
 
FSStatus FSSetCmdPriority (FSCmdBlock *block, FSPriority priority)
 
void FSSetStateChangeNotification (FSClient *client, FSStateChangeInfo *info)
 
FSStatus FSGetCwd (FSClient *client, FSCmdBlock *block, char *buffer, uint32_t bufferSize, uint32_t flags)
 
FSStatus FSChangeDir (FSClient *client, FSCmdBlock *block, const char *path, uint32_t flags)
 
FSStatus FSChangeDirAsync (FSClient *client, FSCmdBlock *block, const char *path, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSGetStat (FSClient *client, FSCmdBlock *block, const char *path, FSStat *stat, uint32_t flags)
 
FSStatus FSGetStatAsync (FSClient *client, FSCmdBlock *block, const char *path, FSStat *stat, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSOpenFile (FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSFileHandle *handle, uint32_t flags)
 
FSStatus FSOpenFileAsync (FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSFileHandle *outHandle, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSCloseFile (FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t flags)
 
FSStatus FSCloseFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSOpenDir (FSClient *client, FSCmdBlock *block, const char *path, FSDirectoryHandle *handle, uint32_t flags)
 
FSStatus FSOpenDirAsync (FSClient *client, FSCmdBlock *block, const char *path, FSDirectoryHandle *handle, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSReadDir (FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSDirectoryEntry *entry, uint32_t flags)
 
FSStatus FSReadDirAsync (FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSDirectoryEntry *entry, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSCloseDir (FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, uint32_t flags)
 
FSStatus FSCloseDirAsync (FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSGetStatFile (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSStat *stat, uint32_t flags)
 
FSStatus FSGetStatFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSStat *stat, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSReadFile (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, uint32_t flags)
 
FSStatus FSReadFileAsync (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSReadFileWithPos (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 FSReadFileWithPosAsync (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 FSGetPosFile (FSClient *client, FSCmdBlock *block, FSFileHandle fileHandle, uint32_t *pos, uint32_t flags)
 
FSStatus FSGetPosFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle fileHandle, uint32_t *pos, uint32_t flags, FSAsyncData *asyncData)
 
FSStatus FSSetPosFile (FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t pos, uint32_t flags)
 
FSStatus FSSetPosFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t pos, uint32_t flags, FSAsyncData *asyncData)
 
FSVolumeState FSGetVolumeState (FSClient *client)
 
FSError FSGetLastErrorCodeForViewer (FSClient *client)
 

Detailed Description

First call FSInit to initialise the file system library, then call FSAddClient to initialise your FSClient structure, then you need to use FSInitCmdBlock to initialise an FSCmdBlock structure for each command you 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 reinitialise an FSCmdBlock before reusing it.

Typedef Documentation

typedef uint32_t FSDirectoryHandle

Definition at line 22 of file filesystem.h.

typedef uint32_t FSFileHandle

Definition at line 23 of file filesystem.h.

typedef uint32_t FSPriority

Definition at line 24 of file filesystem.h.

typedef struct FSAsyncData FSAsyncData

Definition at line 26 of file filesystem.h.

typedef struct FSCmdBlock FSCmdBlock

Definition at line 27 of file filesystem.h.

typedef struct FSClient FSClient

Definition at line 28 of file filesystem.h.

Definition at line 29 of file filesystem.h.

typedef struct FSStat FSStat

Definition at line 30 of file filesystem.h.

Definition at line 31 of file filesystem.h.

typedef enum FSStatus FSStatus
typedef enum FSError FSError
typedef enum FSStatFlags FSStatFlags
typedef void(* FSAsyncCallback) (FSClient *, FSCmdBlock *, FSStatus, uint32_t)

Definition at line 118 of file filesystem.h.

Enumeration Type Documentation

enum FSStatus
Enumerator
FS_STATUS_OK 
FS_STATUS_CANCELLED 
FS_STATUS_END 
FS_STATUS_MAX 
FS_STATUS_ALREADY_OPEN 
FS_STATUS_EXISTS 
FS_STATUS_NOT_FOUND 
FS_STATUS_NOT_FILE 
FS_STATUS_NOT_DIR 
FS_STATUS_ACCESS_ERROR 
FS_STATUS_PERMISSION_ERROR 
FS_STATUS_FILE_TOO_BIG 
FS_STATUS_STORAGE_FULL 
FS_STATUS_JOURNAL_FULL 
FS_STATUS_UNSUPPORTED_CMD 
FS_STATUS_MEDIA_NOT_READY 
FS_STATUS_MEDIA_ERROR 
FS_STATUS_CORRUPTED 
FS_STATUS_FATAL_ERROR 

Definition at line 33 of file filesystem.h.

enum FSError
Enumerator
FS_ERROR_NOT_INIT 
FS_ERROR_BUSY 
FS_ERROR_CANCELLED 
FS_ERROR_END_OF_DIR 
FS_ERROR_END_OF_FILE 
FS_ERROR_MAX_MOUNT_POINTS 
FS_ERROR_MAX_VOLUMES 
FS_ERROR_MAX_CLIENTS 
FS_ERROR_MAX_FILES 
FS_ERROR_MAX_DIRS 
FS_ERROR_ALREADY_OPEN 
FS_ERROR_ALREADY_EXISTS 
FS_ERROR_NOT_FOUND 
FS_ERROR_NOT_EMPTY 
FS_ERROR_ACCESS_ERROR 
FS_ERROR_PERMISSION_ERROR 
FS_ERROR_DATA_CORRUPTED 
FS_ERROR_STORAGE_FULL 
FS_ERROR_JOURNAL_FULL 
FS_ERROR_UNAVAILABLE_COMMAND 
FS_ERROR_UNSUPPORTED_COMMAND 
FS_ERROR_INVALID_PARAM 
FS_ERROR_INVALID_PATH 
FS_ERROR_INVALID_BUFFER 
FS_ERROR_INVALID_ALIGNMENT 
FS_ERROR_INVALID_CLIENTHANDLE 
FS_ERROR_INVALID_FILEHANDLE 
FS_ERROR_INVALID_DIRHANDLE 
FS_ERROR_NOT_FILE 
FS_ERROR_NOT_DIR 
FS_ERROR_FILE_TOO_BIG 
FS_ERROR_OUT_OF_RANGE 
FS_ERROR_OUT_OF_RESOURCES 
FS_ERROR_MEDIA_NOT_READY 
FS_ERROR_MEDIA_ERROR 
FS_ERROR_WRITE_PROTECTED 
FS_ERROR_INVALID_MEDIA 

Definition at line 56 of file filesystem.h.

Enumerator
FS_STAT_DIRECTORY 

Definition at line 97 of file filesystem.h.

Enumerator
FS_VOLUME_STATE_INITIAL 
FS_VOLUME_STATE_READY 
FS_VOLUME_STATE_NO_MEDIA 
FS_VOLUME_STATE_INVALID_MEDIA 
FS_VOLUME_STATE_DIRTY_MEDIA 
FS_VOLUME_STATE_WRONG_MEDIA 
FS_VOLUME_STATE_MEDIA_ERROR 
FS_VOLUME_STATE_DATA_CORRUPTED 
FS_VOLUME_STATE_WRITE_PROTECTED 
FS_VOLUME_STATE_JOURNAL_FULL 
FS_VOLUME_STATE_FATAL 
FS_VOLUME_STATE_INVALID 

Definition at line 102 of file filesystem.h.

Function Documentation

void FSInit ( )
void FSShutdown ( )
FSStatus FSAddClient ( FSClient client,
uint32_t  flags 
)
FSStatus FSDelClient ( FSClient client,
uint32_t  flags 
)
uint32_t FSGetClientNum ( )
void FSInitCmdBlock ( FSCmdBlock block)
FSStatus FSSetCmdPriority ( FSCmdBlock block,
FSPriority  priority 
)
void FSSetStateChangeNotification ( FSClient client,
FSStateChangeInfo info 
)
FSStatus FSGetCwd ( FSClient client,
FSCmdBlock block,
char *  buffer,
uint32_t  bufferSize,
uint32_t  flags 
)
FSStatus FSChangeDir ( FSClient client,
FSCmdBlock block,
const char *  path,
uint32_t  flags 
)
FSStatus FSChangeDirAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSGetStat ( FSClient client,
FSCmdBlock block,
const char *  path,
FSStat stat,
uint32_t  flags 
)
FSStatus FSGetStatAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
FSStat stat,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSOpenFile ( FSClient client,
FSCmdBlock block,
const char *  path,
const char *  mode,
FSFileHandle handle,
uint32_t  flags 
)
FSStatus FSOpenFileAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
const char *  mode,
FSFileHandle outHandle,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSCloseFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
uint32_t  flags 
)
FSStatus FSCloseFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSOpenDir ( FSClient client,
FSCmdBlock block,
const char *  path,
FSDirectoryHandle handle,
uint32_t  flags 
)
FSStatus FSOpenDirAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
FSDirectoryHandle handle,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSReadDir ( FSClient client,
FSCmdBlock block,
FSDirectoryHandle  handle,
FSDirectoryEntry entry,
uint32_t  flags 
)
FSStatus FSReadDirAsync ( FSClient client,
FSCmdBlock block,
FSDirectoryHandle  handle,
FSDirectoryEntry entry,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSCloseDir ( FSClient client,
FSCmdBlock block,
FSDirectoryHandle  handle,
uint32_t  flags 
)
FSStatus FSCloseDirAsync ( FSClient client,
FSCmdBlock block,
FSDirectoryHandle  handle,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSGetStatFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSStat stat,
uint32_t  flags 
)
FSStatus FSGetStatFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSStat stat,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSReadFile ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
FSFileHandle  handle,
uint32_t  unk1,
uint32_t  flags 
)
FSStatus FSReadFileAsync ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
FSFileHandle  handle,
uint32_t  unk1,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSReadFileWithPos ( 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 FSReadFileWithPosAsync ( 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 FSGetPosFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  fileHandle,
uint32_t *  pos,
uint32_t  flags 
)
FSStatus FSGetPosFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  fileHandle,
uint32_t *  pos,
uint32_t  flags,
FSAsyncData asyncData 
)
FSStatus FSSetPosFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
uint32_t  pos,
uint32_t  flags 
)
FSStatus FSSetPosFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
uint32_t  pos,
uint32_t  flags,
FSAsyncData asyncData 
)
FSVolumeState FSGetVolumeState ( FSClient client)
FSError FSGetLastErrorCodeForViewer ( FSClient client)