wut  v1.7.0
Wii U Toolchain
filesystem.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
4 #include <coreinit/time.h>
5 #include <coreinit/ios.h>
6 #include <coreinit/fastmutex.h>
7 #include <coreinit/alarm.h>
8 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #define FS_MAX_PATH (0x27F)
29 #define FS_MODE_LENGTH (0x10)
30 
31 typedef uint32_t FSDirectoryHandle;
32 typedef uint32_t FSFileHandle;
33 typedef uint32_t FSPriority;
34 typedef uint64_t FSTime;
35 
36 typedef struct FSFsm FSFsm;
37 typedef struct FSCmdQueue FSCmdQueue;
38 typedef struct FSClientBodyLink FSClientBodyLink;
39 typedef struct FSAsyncData FSAsyncData;
40 typedef struct FSAsyncResult FSAsyncResult;
41 typedef struct FSClientBody FSClientBody;
42 typedef struct FSClient FSClient;
43 typedef struct FSCmdBlockBody FSCmdBlockBody;
44 typedef struct FSCmdBlock FSCmdBlock;
45 typedef struct FSDirectoryEntry FSDirectoryEntry;
46 typedef struct FSMessage FSMessage;
47 typedef struct FSMountSource FSMountSource;
48 typedef struct FSStat FSStat;
51 typedef struct FSVolumeInfo FSVolumeInfo;
52 
53 typedef enum FSErrorFlag
54 {
68  FS_ERROR_FLAG_ALL = 0xFFFFFFFF,
70 
71 typedef enum FSStatus
72 {
93 
94 typedef enum FSError
95 {
97  FS_ERROR_NOT_INIT = -0x30001,
98  FS_ERROR_BUSY = -0x30002,
99  FS_ERROR_CANCELLED = -0x30003,
105  FS_ERROR_MAX_FILES = -0x30013,
106  FS_ERROR_MAX_DIRS = -0x30014,
109  FS_ERROR_NOT_FOUND = -0x30017,
110  FS_ERROR_NOT_EMPTY = -0x30018,
125  FS_ERROR_NOT_FILE = -0x30028,
126  FS_ERROR_NOT_DIR = -0x30029,
135 
136 typedef enum FSMode
137 {
141 
145 
150 
153 typedef enum FSStatFlags
154 {
156  FS_STAT_DIRECTORY = 0x80000000,
158  FS_STAT_QUOTA = 0x60000000,
160  FS_STAT_FILE = 0x01000000,
165  FS_STAT_LINK = 0x00010000,
167 
168 typedef enum FSVolumeState
169 {
183 
184 typedef enum FSMediaState {
191 
192 typedef enum FSMountSourceType {
196 
197 typedef enum FSOpenFileFlags
198 {
200  FS_OPEN_FLAG_NONE = (0 << 0),
204  FS_OPEN_FLAG_PREALLOC_SIZE = (1 << 1)
206 
207 typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
208 typedef void(*FSStateChangeCallback)(FSClient *, FSVolumeState, void *);
209 
210 struct FSFsm
211 {
212  WUT_UNKNOWN_BYTES(0x38);
213 };
214 WUT_CHECK_SIZE(FSFsm, 0x38);
215 
217 {
218  WUT_UNKNOWN_BYTES(0x44);
219 };
220 WUT_CHECK_SIZE(FSCmdQueue, 0x44);
221 
222 struct FSMessage
223 {
225  void *data;
226 
227  WUT_UNKNOWN_BYTES(8);
228 
231 };
232 WUT_CHECK_OFFSET(FSMessage, 0x00, data);
233 WUT_CHECK_OFFSET(FSMessage, 0x0C, type);
234 WUT_CHECK_SIZE(FSMessage, 0x10);
235 
240 {
243 };
244 WUT_CHECK_OFFSET(FSClientBodyLink, 0x00, next);
245 WUT_CHECK_OFFSET(FSClientBodyLink, 0x04, prev);
246 WUT_CHECK_SIZE(FSClientBodyLink, 0x8);
247 
249 {
250  WUT_UNKNOWN_BYTES(0x1444);
251 
254 
257 
260 
263 
266 
267  WUT_UNKNOWN_BYTES(0x1560 - 0x14CC);
268 
271 
272  WUT_UNKNOWN_BYTES(4);
273 
276 
279 
281 
284 
287 
290 
293 
296 };
297 WUT_CHECK_OFFSET(FSClientBody, 0x1444, clientHandle);
298 WUT_CHECK_OFFSET(FSClientBody, 0x1448, fsm);
299 WUT_CHECK_OFFSET(FSClientBody, 0x1480, cmdQueue);
300 WUT_CHECK_OFFSET(FSClientBody, 0x14C4, lastDequeuedCommand);
301 WUT_CHECK_OFFSET(FSClientBody, 0x14C8, emulatedError);
302 WUT_CHECK_OFFSET(FSClientBody, 0x1560, mutex);
303 WUT_CHECK_OFFSET(FSClientBody, 0x1590, fsmAlarm);
304 WUT_CHECK_OFFSET(FSClientBody, 0x15E8, lastError);
305 WUT_CHECK_OFFSET(FSClientBody, 0x15EC, isLastErrorWithoutVolume);
306 WUT_CHECK_OFFSET(FSClientBody, 0x15F0, fsCmdHandlerMsg);
307 WUT_CHECK_OFFSET(FSClientBody, 0x1600, lastMountSourceDevice);
308 WUT_CHECK_OFFSET(FSClientBody, 0x1610, findMountSourceType);
309 WUT_CHECK_OFFSET(FSClientBody, 0x1614, link);
310 WUT_CHECK_OFFSET(FSClientBody, 0x161C, client);
311 WUT_CHECK_SIZE(FSClientBody, 0x1620);
312 
313 struct FSClient
314 {
315  WUT_UNKNOWN_BYTES(0x1700);
316 };
317 WUT_CHECK_SIZE(FSClient, 0x1700);
318 
320 {
321  WUT_UNKNOWN_BYTES(0xA80);
322 };
323 WUT_CHECK_SIZE(FSCmdBlock, 0xA80);
324 
325 struct WUT_PACKED FSStat
326 {
329  uint32_t owner;
330  uint32_t group;
331  uint32_t size;
332  uint32_t allocSize;
333  uint64_t quotaSize;
334  uint32_t entryId;
337  WUT_UNKNOWN_BYTES(0x30);
338 };
339 WUT_CHECK_OFFSET(FSStat, 0x00, flags);
340 WUT_CHECK_OFFSET(FSStat, 0x04, mode);
341 WUT_CHECK_OFFSET(FSStat, 0x08, owner);
342 WUT_CHECK_OFFSET(FSStat, 0x0C, group);
343 WUT_CHECK_OFFSET(FSStat, 0x10, size);
344 WUT_CHECK_OFFSET(FSStat, 0x14, allocSize);
345 WUT_CHECK_OFFSET(FSStat, 0x18, quotaSize);
346 WUT_CHECK_OFFSET(FSStat, 0x20, entryId);
347 WUT_CHECK_OFFSET(FSStat, 0x24, created);
348 WUT_CHECK_OFFSET(FSStat, 0x2C, modified);
349 WUT_CHECK_SIZE(FSStat, 0x64);
350 
352 {
354  void *param;
356 };
357 WUT_CHECK_OFFSET(FSStateChangeParams, 0x00, callback);
358 WUT_CHECK_OFFSET(FSStateChangeParams, 0x04, param);
359 WUT_CHECK_OFFSET(FSStateChangeParams, 0x08, ioMsgQueue);
360 WUT_CHECK_SIZE(FSStateChangeParams, 0x0C);
361 
363 {
365  uint32_t param;
367 };
368 WUT_CHECK_OFFSET(FSAsyncData, 0x00, callback);
369 WUT_CHECK_OFFSET(FSAsyncData, 0x04, param);
370 WUT_CHECK_OFFSET(FSAsyncData, 0x08, ioMsgQueue);
371 WUT_CHECK_SIZE(FSAsyncData, 0x0C);
372 
377 {
380 
383 
386 
389 
392 };
393 WUT_CHECK_OFFSET(FSAsyncResult, 0x00, asyncData);
394 WUT_CHECK_OFFSET(FSAsyncResult, 0x0c, ioMsg);
395 WUT_CHECK_OFFSET(FSAsyncResult, 0x1c, client);
396 WUT_CHECK_OFFSET(FSAsyncResult, 0x20, block);
397 WUT_CHECK_OFFSET(FSAsyncResult, 0x24, status);
398 WUT_CHECK_SIZE(FSAsyncResult, 0x28);
399 
401  WUT_UNKNOWN_BYTES(0x96C);
403  WUT_UNKNOWN_BYTES(0x68);
404 };
405 WUT_CHECK_OFFSET(FSCmdBlockBody, 0x96C, asyncResult);
406 WUT_CHECK_SIZE(FSCmdBlockBody, 0x9FC);
407 
409 {
411  char name[256];
412 };
413 WUT_CHECK_OFFSET(FSDirectoryEntry, 0x64, name);
414 WUT_CHECK_SIZE(FSDirectoryEntry, 0x164);
415 
417 {
418  WUT_UNKNOWN_BYTES(0x300);
419 };
420 WUT_CHECK_SIZE(FSMountSource, 0x300);
421 
422 struct WUT_PACKED FSVolumeInfo {
423  uint32_t flags;
425  WUT_UNKNOWN_BYTES(0x4);
426  uint32_t unk0x0C;
427  uint32_t unk0x10;
428  int32_t unk0x14;
429  int32_t unk0x18;
430  WUT_UNKNOWN_BYTES(0x10);
431  char volumeLabel[128];
432  char volumeId[128];
433  char devicePath[16];
434  char mountPath[128];
435 };
436 WUT_CHECK_OFFSET(FSVolumeInfo, 0x00, flags);
437 WUT_CHECK_OFFSET(FSVolumeInfo, 0x04, mediaState);
438 WUT_CHECK_OFFSET(FSVolumeInfo, 0x0C, unk0x0C);
439 WUT_CHECK_OFFSET(FSVolumeInfo, 0x10, unk0x10);
440 WUT_CHECK_OFFSET(FSVolumeInfo, 0x14, unk0x14);
441 WUT_CHECK_OFFSET(FSVolumeInfo, 0x18, unk0x18);
442 WUT_CHECK_OFFSET(FSVolumeInfo, 0x2C, volumeLabel);
443 WUT_CHECK_OFFSET(FSVolumeInfo, 0xAC, volumeId);
444 WUT_CHECK_OFFSET(FSVolumeInfo, 0x12C, devicePath);
445 WUT_CHECK_OFFSET(FSVolumeInfo, 0x13C, mountPath);
446 WUT_CHECK_SIZE(FSVolumeInfo, 444);
447 
448 
452 static inline FSClientBody *
454  if (!client) {
455  return NULL;
456  }
457  return (FSClientBody *) ((((uint32_t) client) + 0x3F) & ~0x3F);
458 }
459 
463 static inline FSCmdBlockBody *
465  if (!cmdBlock) {
466  return NULL;
467  }
468  return (FSCmdBlockBody *) ((((uint32_t) cmdBlock) + 0x3F) & ~0x3F);
469 }
470 
471 void
473 
474 void
476 
477 FSStatus
479  FSErrorFlag errorMask);
480 
481 FSStatus
483  FSErrorFlag errorMask);
484 
485 uint32_t
487 
488 void
490 
491 FSStatus
493  FSPriority priority);
494 
495 void
497  FSStateChangeParams *info);
498 
499 FSStatus
501  FSCmdBlock *block,
502  char *buffer,
503  uint32_t bufferSize,
504  FSErrorFlag errorMask);
505 
506 FSStatus
508  FSCmdBlock *block,
509  const char *path,
510  FSErrorFlag errorMask);
511 
512 FSStatus
514  FSCmdBlock *block,
515  const char *path,
516  FSErrorFlag errorMask,
517  FSAsyncData *asyncData);
518 
521 
522 FSStatus
524  FSCmdBlock *block,
525  const char *path,
526  FSStat *stat,
527  FSErrorFlag errorMask);
528 
529 FSStatus
531  FSCmdBlock *block,
532  const char *path,
533  FSStat *stat,
534  FSErrorFlag errorMask,
535  FSAsyncData *asyncData);
536 
537 FSStatus
539  FSCmdBlock *block,
540  const char *path,
541  FSErrorFlag errorMask);
542 
543 FSStatus
545  FSCmdBlock *block,
546  const char *path,
547  FSErrorFlag errorMask,
548  FSAsyncData *asyncData);
549 
550 
551 FSStatus
553  FSCmdBlock *block,
554  const char *path,
555  const char *mode,
556  FSFileHandle *handle,
557  FSErrorFlag errorMask);
558 
559 FSStatus
561  FSCmdBlock *block,
562  const char *path,
563  const char *mode,
564  FSFileHandle *outHandle,
565  FSErrorFlag errorMask,
566  FSAsyncData *asyncData);
567 
568 FSStatus
570  FSCmdBlock *block,
571  FSFileHandle handle,
572  FSErrorFlag errorMask);
573 
574 FSStatus
576  FSCmdBlock *block,
577  FSFileHandle handle,
578  FSErrorFlag errorMask,
579  FSAsyncData *asyncData);
580 
581 FSStatus
583  FSCmdBlock *block,
584  const char *path,
585  const char *mode,
586  FSMode createMode,
587  FSOpenFileFlags openFlag,
588  uint32_t preallocSize,
589  FSFileHandle *handle,
590  FSErrorFlag errorMask);
591 
592 FSStatus
594  FSCmdBlock *block,
595  const char *path,
596  const char *mode,
597  FSMode createMode,
598  FSOpenFileFlags openFlag,
599  uint32_t preallocSize,
600  FSFileHandle *handle,
601  FSErrorFlag errorMask,
602  FSAsyncData *asyncData);
603 
604 FSStatus
606  FSCmdBlock *block,
607  const char *path,
608  FSDirectoryHandle *handle,
609  FSErrorFlag errorMask);
610 
611 FSStatus
613  FSCmdBlock *block,
614  const char *path,
615  FSDirectoryHandle *handle,
616  FSErrorFlag errorMask,
617  FSAsyncData *asyncData);
618 
619 FSStatus
621  FSCmdBlock *block,
622  const char *path,
623  FSErrorFlag errorMask);
624 
625 FSStatus
627  FSCmdBlock *block,
628  const char *path,
629  FSErrorFlag errorMask,
630  FSAsyncData *asyncData);
631 
632 FSStatus
634  FSCmdBlock *block,
635  FSDirectoryHandle handle,
636  FSDirectoryEntry *entry,
637  FSErrorFlag errorMask);
638 
639 FSStatus
641  FSCmdBlock *block,
642  FSDirectoryHandle handle,
643  FSDirectoryEntry *entry,
644  FSErrorFlag errorMask,
645  FSAsyncData *asyncData);
646 
647 FSStatus
649  FSCmdBlock *block,
650  FSDirectoryHandle handle,
651  FSErrorFlag errorMask);
652 
653 FSStatus
655  FSCmdBlock *block,
656  FSDirectoryHandle handle,
657  FSErrorFlag errorMask);
658 
659 FSStatus
661  FSCmdBlock *block,
662  const char *path,
663  FSVolumeInfo *volumeInfo,
664  FSErrorFlag errorMask);
665 
666 FSStatus
668  FSCmdBlock *block,
669  const char *path,
670  FSVolumeInfo *volumeInfo,
671  FSErrorFlag errorMask,
672  FSAsyncData *asyncData);
673 
674 FSStatus
676  FSCmdBlock *block,
677  FSDirectoryHandle handle,
678  FSErrorFlag errorMask,
679  FSAsyncData *asyncData);
680 FSStatus
682  FSCmdBlock *block,
683  const char *path,
684  FSMode mode,
685  FSMode modeMask,
686  FSErrorFlag errorMask);
687 
688 FSStatus
690  FSCmdBlock *block,
691  const char *path,
692  FSMode mode,
693  FSMode modeMask,
694  FSErrorFlag errorMask,
695  FSAsyncData *asyncData);
696 
697 FSStatus
699  FSCmdBlock *block,
700  const char *path,
701  uint64_t *outSize,
702  FSErrorFlag errorMask);
703 
704 FSStatus
706  FSCmdBlock *block,
707  const char *path,
708  uint64_t *outSize,
709  FSErrorFlag errorMask,
710  FSAsyncData *asyncData);
711 
712 FSStatus
714  FSCmdBlock *block,
715  FSFileHandle handle,
716  FSStat *stat,
717  FSErrorFlag errorMask);
718 
719 FSStatus
721  FSCmdBlock *block,
722  FSFileHandle handle,
723  FSStat *stat,
724  FSErrorFlag errorMask,
725  FSAsyncData *asyncData);
726 
727 FSStatus
729  FSCmdBlock *block,
730  uint8_t *buffer,
731  uint32_t size,
732  uint32_t count,
733  FSFileHandle handle,
734  uint32_t unk1,
735  FSErrorFlag errorMask);
736 
737 FSStatus
739  FSCmdBlock *block,
740  uint8_t *buffer,
741  uint32_t size,
742  uint32_t count,
743  FSFileHandle handle,
744  uint32_t unk1,
745  FSErrorFlag errorMask,
746  FSAsyncData *asyncData);
747 
748 FSStatus
750  FSCmdBlock *block,
751  uint8_t *buffer,
752  uint32_t size,
753  uint32_t count,
754  uint32_t pos,
755  FSFileHandle handle,
756  uint32_t unk1,
757  FSErrorFlag errorMask);
758 
759 FSStatus
761  FSCmdBlock *block,
762  uint8_t *buffer,
763  uint32_t size,
764  uint32_t count,
765  uint32_t pos,
766  FSFileHandle handle,
767  uint32_t unk1,
768  FSErrorFlag errorMask,
769  FSAsyncData *asyncData);
770 
771 FSStatus
773  FSCmdBlock *block,
774  uint8_t *buffer,
775  uint32_t size,
776  uint32_t count,
777  FSFileHandle handle,
778  uint32_t unk1,
779  FSErrorFlag errorMask);
780 
781 FSStatus
783  FSCmdBlock *block,
784  uint8_t *buffer,
785  uint32_t size,
786  uint32_t count,
787  FSFileHandle handle,
788  uint32_t unk1,
789  FSErrorFlag errorMask,
790  FSAsyncData *asyncData);
791 
792 FSStatus
794  FSCmdBlock *block,
795  uint8_t *buffer,
796  uint32_t size,
797  uint32_t count,
798  uint32_t pos,
799  FSFileHandle handle,
800  uint32_t unk1,
801  FSErrorFlag errorMask);
802 
803 FSStatus
805  FSCmdBlock *block,
806  uint8_t *buffer,
807  uint32_t size,
808  uint32_t count,
809  uint32_t pos,
810  FSFileHandle handle,
811  uint32_t unk1,
812  FSErrorFlag errorMask,
813  FSAsyncData *asyncData);
814 
815 FSStatus
817  FSCmdBlock *block,
818  FSFileHandle fileHandle,
819  uint32_t *pos,
820  FSErrorFlag errorMask);
821 
822 FSStatus
824  FSCmdBlock *block,
825  FSFileHandle fileHandle,
826  uint32_t *pos,
827  FSErrorFlag errorMask,
828  FSAsyncData *asyncData);
829 
830 FSStatus
832  FSCmdBlock *block,
833  FSFileHandle handle,
834  uint32_t pos,
835  FSErrorFlag errorMask);
836 
837 FSStatus
839  FSCmdBlock *block,
840  FSFileHandle handle,
841  uint32_t pos,
842  FSErrorFlag errorMask,
843  FSAsyncData *asyncData);
844 
845 FSStatus
847  FSCmdBlock *block,
848  FSFileHandle handle,
849  FSErrorFlag errorMask);
850 
851 FSStatus
853  FSCmdBlock *block,
854  FSFileHandle handle,
855  FSErrorFlag errorMask,
856  FSAsyncData *asyncData);
857 
858 FSStatus
860  FSCmdBlock *block,
861  FSFileHandle handle,
862  FSErrorFlag errorMask);
863 
864 FSStatus
866  FSCmdBlock *block,
867  FSFileHandle handle,
868  FSErrorFlag errorMask,
869  FSAsyncData *asyncData);
870 
871 FSStatus
873  FSCmdBlock *block,
874  const char *oldPath,
875  const char *newPath,
876  FSErrorFlag errorMask);
877 
878 FSStatus
880  FSCmdBlock *block,
881  const char *oldPath,
882  const char *newPath,
883  FSErrorFlag errorMask,
884  FSAsyncData *asyncData);
885 
888 
889 FSError
891 
892 FSError
894 
895 FSStatus
897  FSCmdBlock *cmd,
898  FSMountSourceType type,
899  FSMountSource *out,
900  FSErrorFlag errorMask);
901 
902 FSStatus
904  FSCmdBlock *cmd,
905  FSMountSource *source,
906  const char *target,
907  uint32_t bytes,
908  FSErrorFlag errorMask);
909 
910 FSStatus
912  FSCmdBlock *cmd,
913  const char *target,
914  FSErrorFlag errorMask);
915 
916 FSStatus
918  FSCmdBlock *cmd,
919  const char *source,
920  const char *target,
921  FSErrorFlag errorMask);
922 
923 FSStatus
925  FSCmdBlock *cmd,
926  const char *target,
927  FSErrorFlag errorMask);
928 
930 void
932  OSCalendarTime *outCalendarTime);
933 
934 #ifdef __cplusplus
935 }
936 #endif
937 
Definition: alarm.h:63
FSClientBodyLink link
Link used for linked list of clients.
Definition: filesystem.h:292
uint32_t group
Definition: filesystem.h:330
FSCmdBlock * block
FSCmdBlock which owns this result.
Definition: filesystem.h:388
uint32_t owner
Definition: filesystem.h:329
FSClient * client
Pointer to unaligned FSClient structure.
Definition: filesystem.h:295
FSTime modified
Definition: filesystem.h:336
FSMediaState mediaState
Definition: filesystem.h:424
FSStatus status
The result of the command.
Definition: filesystem.h:391
OSAlarm fsmAlarm
Alarm used by fsm for unknown reasons.
Definition: filesystem.h:272
FSAsyncResult asyncResult
Definition: filesystem.h:401
OSMessageQueue * ioMsgQueue
Definition: filesystem.h:355
bool isLastErrorWithoutVolume
Definition: filesystem.h:280
uint32_t entryId
Definition: filesystem.h:334
FSMessage fsCmdHandlerMsg
Message used to send FsCmdHandler message when FSA async callback is received.
Definition: filesystem.h:283
FSError emulatedError
Emulated error, set with FSSetEmulatedError.
Definition: filesystem.h:265
FSClientBody * prev
Definition: filesystem.h:242
FSFsm fsm
State machine.
Definition: filesystem.h:256
IOSHandle clientHandle
IOSHandle returned from fsaShimOpen.
Definition: filesystem.h:250
FSCmdQueue cmdQueue
Command queue of FS commands.
Definition: filesystem.h:259
void * data
Message data.
Definition: filesystem.h:225
uint32_t flags
Definition: filesystem.h:423
char lastMountSourceDevice[0x10]
Device name of the last mount source returned by FSGetMountSourceNext.
Definition: filesystem.h:286
FSMessage ioMsg
Message to put into asyncdata.ioMsgQueue.
Definition: filesystem.h:382
uint32_t unk0x0C
Definition: filesystem.h:425
OSFastMutex mutex
Mutex used to protect FSClientBody data.
Definition: filesystem.h:267
char name[256]
Definition: filesystem.h:411
FSClientBody * next
Definition: filesystem.h:241
uint32_t unk0x10
Definition: filesystem.h:427
uint32_t allocSize
Definition: filesystem.h:332
FSStatFlags flags
Definition: filesystem.h:327
uint32_t size
Definition: filesystem.h:331
int32_t unk0x18
Definition: filesystem.h:429
uint32_t param
Definition: filesystem.h:365
FSTime created
Definition: filesystem.h:335
uint64_t quotaSize
Definition: filesystem.h:333
FSMountSourceType findMountSourceType
Mount source type to find with FSGetMountSourceNext.
Definition: filesystem.h:289
FSAsyncCallback callback
Definition: filesystem.h:364
FSStateChangeCallback callback
Definition: filesystem.h:353
FSAsyncData asyncData
User supplied async data.
Definition: filesystem.h:379
FSCmdBlockBody * lastDequeuedCommand
The last dequeued command.
Definition: filesystem.h:262
int32_t unk0x14
Definition: filesystem.h:428
OSFunctionType type
Type of message.
Definition: filesystem.h:227
FSMode mode
Definition: filesystem.h:328
FSError lastError
Error of last FS command.
Definition: filesystem.h:278
FSError FSGetLastErrorCodeForViewer(FSClient *client)
FSStatus FSOpenFileEx(FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSMode createMode, FSOpenFileFlags openFlag, uint32_t preallocSize, FSFileHandle *handle, FSErrorFlag errorMask)
uint32_t FSFileHandle
Definition: filesystem.h:32
FSErrorFlag
Definition: filesystem.h:54
FSOpenFileFlags
Definition: filesystem.h:198
FSMountSourceType
Definition: filesystem.h:192
FSStatus FSGetVolumeInfoAsync(FSClient *client, FSCmdBlock *block, const char *path, FSVolumeInfo *volumeInfo, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSGetStatFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSStat *stat, FSErrorFlag errorMask, FSAsyncData *asyncData)
void FSInitCmdBlock(FSCmdBlock *block)
FSStatus FSReadFileAsync(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSChangeModeAsync(FSClient *client, FSCmdBlock *block, const char *path, FSMode mode, FSMode modeMask, FSErrorFlag errorMask, FSAsyncData *asyncData)
uint32_t FSPriority
Definition: filesystem.h:33
FSStatus
Definition: filesystem.h:72
void(* FSStateChangeCallback)(FSClient *, FSVolumeState, void *)
Definition: filesystem.h:208
FSStatus FSUnmount(FSClient *client, FSCmdBlock *cmd, const char *target, FSErrorFlag errorMask)
FSStatus FSGetPosFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle fileHandle, uint32_t *pos, FSErrorFlag errorMask, FSAsyncData *asyncData)
static FSCmdBlockBody * FSGetCmdBlockBody(FSCmdBlock *cmdBlock)
Get an aligned FSCmdBlockBody from an FSCmdBlock.
Definition: filesystem.h:464
FSStatus FSRemoveAsync(FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask, FSAsyncData *asyncData)
uint32_t FSDirectoryHandle
Definition: filesystem.h:31
FSStatus FSGetFreeSpaceSizeAsync(FSClient *client, FSCmdBlock *block, const char *path, uint64_t *outSize, FSErrorFlag errorMask, FSAsyncData *asyncData)
uint32_t FSGetClientNum()
void FSShutdown()
FSStatus FSRewindDir(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSErrorFlag errorMask)
FSAsyncResult * FSGetAsyncResult(FSMessage *message)
FSStatus FSOpenFile(FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSFileHandle *handle, FSErrorFlag errorMask)
FSStatus FSRemove(FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask)
FSStatFlags
Flags for FSStat.
Definition: filesystem.h:154
static FSClientBody * FSGetClientBody(FSClient *client)
Get an aligned FSClientBody from an FSClient.
Definition: filesystem.h:453
FSMediaState
Definition: filesystem.h:184
FSError FSGetLastError(FSClient *client)
FSStatus FSBindMount(FSClient *client, FSCmdBlock *cmd, const char *source, const char *target, FSErrorFlag errorMask)
FSStatus FSSetCmdPriority(FSCmdBlock *block, FSPriority priority)
FSStatus FSWriteFileWithPosAsync(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSRenameAsync(FSClient *client, FSCmdBlock *block, const char *oldPath, const char *newPath, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSMode
Definition: filesystem.h:137
FSStatus FSChangeDir(FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask)
FSStatus FSFlushFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
uint64_t FSTime
Definition: filesystem.h:34
FSStatus FSReadFileWithPos(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask)
FSStatus FSSetPosFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t pos, FSErrorFlag errorMask)
FSStatus FSAddClient(FSClient *client, FSErrorFlag errorMask)
FSStatus FSFlushFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask)
FSStatus FSTruncateFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSOpenFileAsync(FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSFileHandle *outHandle, FSErrorFlag errorMask, FSAsyncData *asyncData)
void FSSetStateChangeNotification(FSClient *client, FSStateChangeParams *info)
FSStatus FSReadFileWithPosAsync(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSOpenDirAsync(FSClient *client, FSCmdBlock *block, const char *path, FSDirectoryHandle *handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSReadDir(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSDirectoryEntry *entry, FSErrorFlag errorMask)
FSVolumeState
Definition: filesystem.h:169
FSStatus FSMount(FSClient *client, FSCmdBlock *cmd, FSMountSource *source, const char *target, uint32_t bytes, FSErrorFlag errorMask)
FSStatus FSWriteFileAsync(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSGetStat(FSClient *client, FSCmdBlock *block, const char *path, FSStat *stat, FSErrorFlag errorMask)
FSVolumeState FSGetVolumeState(FSClient *client)
FSStatus FSChangeMode(FSClient *client, FSCmdBlock *block, const char *path, FSMode mode, FSMode modeMask, FSErrorFlag errorMask)
FSStatus FSMakeDirAsync(FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSRename(FSClient *client, FSCmdBlock *block, const char *oldPath, const char *newPath, FSErrorFlag errorMask)
FSError
Definition: filesystem.h:95
FSStatus FSCloseFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSGetStatFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSStat *stat, FSErrorFlag errorMask)
FSStatus FSGetVolumeInfo(FSClient *client, FSCmdBlock *block, const char *path, FSVolumeInfo *volumeInfo, FSErrorFlag errorMask)
FSStatus FSMakeDir(FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask)
FSStatus FSGetPosFile(FSClient *client, FSCmdBlock *block, FSFileHandle fileHandle, uint32_t *pos, FSErrorFlag errorMask)
FSStatus FSGetFreeSpaceSize(FSClient *client, FSCmdBlock *block, const char *path, uint64_t *outSize, FSErrorFlag errorMask)
FSStatus FSOpenFileExAsync(FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSMode createMode, FSOpenFileFlags openFlag, uint32_t preallocSize, FSFileHandle *handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
void(* FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t)
Definition: filesystem.h:207
FSStatus FSReadDirAsync(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSDirectoryEntry *entry, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSDelClient(FSClient *client, FSErrorFlag errorMask)
FSStatus FSCloseDirAsync(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSCloseFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask)
FSStatus FSChangeDirAsync(FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSCloseDir(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSErrorFlag errorMask)
FSStatus FSWriteFile(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask)
FSStatus FSReadFile(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask)
FSStatus FSGetStatAsync(FSClient *client, FSCmdBlock *block, const char *path, FSStat *stat, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSSetPosFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t pos, FSErrorFlag errorMask, FSAsyncData *asyncData)
FSStatus FSGetMountSource(FSClient *client, FSCmdBlock *cmd, FSMountSourceType type, FSMountSource *out, FSErrorFlag errorMask)
FSStatus FSGetCwd(FSClient *client, FSCmdBlock *block, char *buffer, uint32_t bufferSize, FSErrorFlag errorMask)
FSStatus FSOpenDir(FSClient *client, FSCmdBlock *block, const char *path, FSDirectoryHandle *handle, FSErrorFlag errorMask)
void FSTimeToCalendarTime(FSTime time, OSCalendarTime *outCalendarTime)
File times aren't always available in which case it returns the default 1980-01-01.
FSStatus FSBindUnmount(FSClient *client, FSCmdBlock *cmd, const char *target, FSErrorFlag errorMask)
FSStatus FSWriteFileWithPos(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask)
void FSInit()
FSStatus FSTruncateFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask)
@ FS_ERROR_FLAG_EXISTS
Definition: filesystem.h:58
@ FS_ERROR_FLAG_PERMISSION_ERROR
Definition: filesystem.h:63
@ FS_ERROR_FLAG_NOT_FOUND
Definition: filesystem.h:59
@ FS_ERROR_FLAG_UNSUPPORTED_CMD
Definition: filesystem.h:66
@ FS_ERROR_FLAG_STORAGE_FULL
Definition: filesystem.h:65
@ FS_ERROR_FLAG_JOURNAL_FULL
Definition: filesystem.h:67
@ FS_ERROR_FLAG_NONE
Definition: filesystem.h:55
@ FS_ERROR_FLAG_ALL
Definition: filesystem.h:68
@ FS_ERROR_FLAG_NOT_FILE
Definition: filesystem.h:60
@ FS_ERROR_FLAG_ALREADY_OPEN
Definition: filesystem.h:57
@ FS_ERROR_FLAG_FILE_TOO_BIG
Definition: filesystem.h:64
@ FS_ERROR_FLAG_MAX
Definition: filesystem.h:56
@ FS_ERROR_FLAG_NOT_DIR
Definition: filesystem.h:61
@ FS_ERROR_FLAG_ACCESS_ERROR
Definition: filesystem.h:62
@ FS_OPEN_FLAG_NONE
Open file normally.
Definition: filesystem.h:200
@ FS_OPEN_FLAG_UNENCRYPTED
Open (new) unencrypted file. Used for vWii files since it allows for direct access without the Wii U ...
Definition: filesystem.h:202
@ FS_OPEN_FLAG_PREALLOC_SIZE
Preallocates new file size using given size.
Definition: filesystem.h:204
@ FS_MOUNT_SOURCE_SD
Definition: filesystem.h:193
@ FS_MOUNT_SOURCE_UNK
Definition: filesystem.h:194
@ FS_STATUS_ACCESS_ERROR
Definition: filesystem.h:82
@ FS_STATUS_UNSUPPORTED_CMD
Definition: filesystem.h:87
@ FS_STATUS_FATAL_ERROR
Definition: filesystem.h:91
@ FS_STATUS_NOT_FILE
Definition: filesystem.h:80
@ FS_STATUS_CORRUPTED
Definition: filesystem.h:90
@ FS_STATUS_EXISTS
Definition: filesystem.h:78
@ FS_STATUS_PERMISSION_ERROR
Definition: filesystem.h:83
@ FS_STATUS_ALREADY_OPEN
Definition: filesystem.h:77
@ FS_STATUS_NOT_FOUND
Definition: filesystem.h:79
@ FS_STATUS_MEDIA_ERROR
Definition: filesystem.h:89
@ FS_STATUS_MAX
Definition: filesystem.h:76
@ FS_STATUS_JOURNAL_FULL
Definition: filesystem.h:86
@ FS_STATUS_CANCELLED
Definition: filesystem.h:74
@ FS_STATUS_MEDIA_NOT_READY
Definition: filesystem.h:88
@ FS_STATUS_FILE_TOO_BIG
Definition: filesystem.h:84
@ FS_STATUS_STORAGE_FULL
Definition: filesystem.h:85
@ FS_STATUS_NOT_DIR
Definition: filesystem.h:81
@ FS_STATUS_OK
Definition: filesystem.h:73
@ FS_STATUS_END
Definition: filesystem.h:75
@ FS_STAT_FILE
The retrieved file entry is a (link to a) file.
Definition: filesystem.h:160
@ FS_STAT_LINK
The retrieved file entry also is a link to a different file on the filesystem.
Definition: filesystem.h:165
@ FS_STAT_QUOTA
The retrieved file entry also has a quota set.
Definition: filesystem.h:158
@ FS_STAT_ENCRYPTED_FILE
The retrieved file entry also is encrypted and can't be opened (see vWii files for example).
Definition: filesystem.h:162
@ FS_STAT_DIRECTORY
The retrieved file entry is a (link to a) directory.
Definition: filesystem.h:156
@ FS_MEDIA_STATE_NO_MEDIA
Definition: filesystem.h:186
@ FS_MEDIA_STATE_READY
Definition: filesystem.h:185
@ FS_MEDIA_STATE_INVALID_MEDIA
Definition: filesystem.h:187
@ FS_MEDIA_STATE_MEDIA_ERROR
Definition: filesystem.h:189
@ FS_MEDIA_STATE_DIRTY_MEDIA
Definition: filesystem.h:188
@ FS_MODE_EXEC_GROUP
Definition: filesystem.h:144
@ FS_MODE_WRITE_OTHER
Definition: filesystem.h:147
@ FS_MODE_READ_GROUP
Definition: filesystem.h:142
@ FS_MODE_WRITE_OWNER
Definition: filesystem.h:139
@ FS_MODE_EXEC_OTHER
Definition: filesystem.h:148
@ FS_MODE_WRITE_GROUP
Definition: filesystem.h:143
@ FS_MODE_READ_OWNER
Definition: filesystem.h:138
@ FS_MODE_EXEC_OWNER
Definition: filesystem.h:140
@ FS_MODE_READ_OTHER
Definition: filesystem.h:146
@ FS_VOLUME_STATE_INVALID_MEDIA
Definition: filesystem.h:173
@ FS_VOLUME_STATE_JOURNAL_FULL
Definition: filesystem.h:179
@ FS_VOLUME_STATE_DIRTY_MEDIA
Definition: filesystem.h:174
@ FS_VOLUME_STATE_DATA_CORRUPTED
Definition: filesystem.h:177
@ FS_VOLUME_STATE_READY
Definition: filesystem.h:171
@ FS_VOLUME_STATE_FATAL
Definition: filesystem.h:180
@ FS_VOLUME_STATE_WRONG_MEDIA
Definition: filesystem.h:175
@ FS_VOLUME_STATE_NO_MEDIA
Definition: filesystem.h:172
@ FS_VOLUME_STATE_WRITE_PROTECTED
Definition: filesystem.h:178
@ FS_VOLUME_STATE_MEDIA_ERROR
Definition: filesystem.h:176
@ FS_VOLUME_STATE_INITIAL
Definition: filesystem.h:170
@ FS_VOLUME_STATE_INVALID
Definition: filesystem.h:181
@ FS_ERROR_DATA_CORRUPTED
Definition: filesystem.h:113
@ FS_ERROR_UNSUPPORTED_COMMAND
Definition: filesystem.h:117
@ FS_ERROR_MEDIA_NOT_READY
Definition: filesystem.h:130
@ FS_ERROR_NOT_INIT
Definition: filesystem.h:97
@ FS_ERROR_PERMISSION_ERROR
Definition: filesystem.h:112
@ FS_ERROR_STORAGE_FULL
Definition: filesystem.h:114
@ FS_ERROR_INVALID_FILEHANDLE
Definition: filesystem.h:123
@ FS_ERROR_MAX_MOUNT_POINTS
Definition: filesystem.h:102
@ FS_ERROR_MAX_DIRS
Definition: filesystem.h:106
@ FS_ERROR_INVALID_DIRHANDLE
Definition: filesystem.h:124
@ FS_ERROR_MEDIA_ERROR
Definition: filesystem.h:131
@ FS_ERROR_ALREADY_OPEN
Definition: filesystem.h:107
@ FS_ERROR_INVALID_ALIGNMENT
Definition: filesystem.h:121
@ FS_ERROR_MAX_VOLUMES
Definition: filesystem.h:103
@ FS_ERROR_CANCELLED
Definition: filesystem.h:99
@ FS_ERROR_INVALID_BUFFER
Definition: filesystem.h:120
@ FS_ERROR_INVALID_CLIENTHANDLE
Definition: filesystem.h:122
@ FS_ERROR_OUT_OF_RANGE
Definition: filesystem.h:128
@ FS_ERROR_ALREADY_EXISTS
Definition: filesystem.h:108
@ FS_ERROR_OUT_OF_RESOURCES
Definition: filesystem.h:129
@ FS_ERROR_INVALID_MEDIA
Definition: filesystem.h:133
@ FS_ERROR_END_OF_FILE
Definition: filesystem.h:101
@ FS_ERROR_FILE_TOO_BIG
Definition: filesystem.h:127
@ FS_ERROR_OK
Definition: filesystem.h:96
@ FS_ERROR_END_OF_DIR
Definition: filesystem.h:100
@ FS_ERROR_NOT_EMPTY
Definition: filesystem.h:110
@ FS_ERROR_ACCESS_ERROR
Definition: filesystem.h:111
@ FS_ERROR_WRITE_PROTECTED
Definition: filesystem.h:132
@ FS_ERROR_NOT_FOUND
Definition: filesystem.h:109
@ FS_ERROR_UNAVAILABLE_COMMAND
Definition: filesystem.h:116
@ FS_ERROR_INVALID_PATH
Definition: filesystem.h:119
@ FS_ERROR_MAX_FILES
Definition: filesystem.h:105
@ FS_ERROR_INVALID_PARAM
Definition: filesystem.h:118
@ FS_ERROR_BUSY
Definition: filesystem.h:98
@ FS_ERROR_NOT_DIR
Definition: filesystem.h:126
@ FS_ERROR_NOT_FILE
Definition: filesystem.h:125
@ FS_ERROR_JOURNAL_FULL
Definition: filesystem.h:115
@ FS_ERROR_MAX_CLIENTS
Definition: filesystem.h:104
Stores the result of an async FS command.
Definition: filesystem.h:377
int32_t IOSHandle
Definition: ios.h:15
OSFunctionType
Definition: messagequeue.h:26
Same as std c struct tm but with msec and usec added.
Definition: time.h:22