wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
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>
7#include <coreinit/alarm.h>
8
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#define FS_MAX_PATH (0x27F)
29#define FS_MODE_LENGTH (0x10)
30
31typedef uint32_t FSDirectoryHandle;
32typedef uint32_t FSFileHandle;
33typedef uint32_t FSPriority;
34typedef uint64_t FSTime;
35
36typedef struct FSFsm FSFsm;
37typedef struct FSCmdQueue FSCmdQueue;
39typedef struct FSAsyncData FSAsyncData;
42typedef struct FSClient FSClient;
44typedef struct FSCmdBlock FSCmdBlock;
46typedef struct FSMessage FSMessage;
48typedef struct FSStat FSStat;
52
70
93
135
150
153typedef enum FSStatFlags
154{
156 FS_STAT_DIRECTORY = 0x80000000,
158 FS_STAT_QUOTA = 0x60000000,
160 FS_STAT_FILE = 0x01000000,
165 FS_STAT_LINK = 0x00010000,
167
183
191
196
206
207typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
209
210struct FSFsm
211{
212 WUT_UNKNOWN_BYTES(0x38);
213};
214WUT_CHECK_SIZE(FSFsm, 0x38);
215
217{
218 WUT_UNKNOWN_BYTES(0x44);
219};
220WUT_CHECK_SIZE(FSCmdQueue, 0x44);
221
223{
225 void *data;
226
227 WUT_UNKNOWN_BYTES(8);
228
231};
232WUT_CHECK_OFFSET(FSMessage, 0x00, data);
233WUT_CHECK_OFFSET(FSMessage, 0x0C, type);
234WUT_CHECK_SIZE(FSMessage, 0x10);
235
244WUT_CHECK_OFFSET(FSClientBodyLink, 0x00, next);
245WUT_CHECK_OFFSET(FSClientBodyLink, 0x04, prev);
246WUT_CHECK_SIZE(FSClientBodyLink, 0x8);
247
297WUT_CHECK_OFFSET(FSClientBody, 0x1444, clientHandle);
298WUT_CHECK_OFFSET(FSClientBody, 0x1448, fsm);
299WUT_CHECK_OFFSET(FSClientBody, 0x1480, cmdQueue);
300WUT_CHECK_OFFSET(FSClientBody, 0x14C4, lastDequeuedCommand);
301WUT_CHECK_OFFSET(FSClientBody, 0x14C8, emulatedError);
302WUT_CHECK_OFFSET(FSClientBody, 0x1560, mutex);
303WUT_CHECK_OFFSET(FSClientBody, 0x1590, fsmAlarm);
304WUT_CHECK_OFFSET(FSClientBody, 0x15E8, lastError);
305WUT_CHECK_OFFSET(FSClientBody, 0x15EC, isLastErrorWithoutVolume);
306WUT_CHECK_OFFSET(FSClientBody, 0x15F0, fsCmdHandlerMsg);
307WUT_CHECK_OFFSET(FSClientBody, 0x1600, lastMountSourceDevice);
308WUT_CHECK_OFFSET(FSClientBody, 0x1610, findMountSourceType);
309WUT_CHECK_OFFSET(FSClientBody, 0x1614, link);
310WUT_CHECK_OFFSET(FSClientBody, 0x161C, client);
311WUT_CHECK_SIZE(FSClientBody, 0x1620);
312
314{
315 WUT_UNKNOWN_BYTES(0x1700);
316};
317WUT_CHECK_SIZE(FSClient, 0x1700);
318
320{
321 WUT_UNKNOWN_BYTES(0xA80);
322};
323WUT_CHECK_SIZE(FSCmdBlock, 0xA80);
324
325struct 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};
339WUT_CHECK_OFFSET(FSStat, 0x00, flags);
340WUT_CHECK_OFFSET(FSStat, 0x04, mode);
341WUT_CHECK_OFFSET(FSStat, 0x08, owner);
342WUT_CHECK_OFFSET(FSStat, 0x0C, group);
343WUT_CHECK_OFFSET(FSStat, 0x10, size);
344WUT_CHECK_OFFSET(FSStat, 0x14, allocSize);
345WUT_CHECK_OFFSET(FSStat, 0x18, quotaSize);
346WUT_CHECK_OFFSET(FSStat, 0x20, entryId);
347WUT_CHECK_OFFSET(FSStat, 0x24, created);
348WUT_CHECK_OFFSET(FSStat, 0x2C, modified);
349WUT_CHECK_SIZE(FSStat, 0x64);
350
357WUT_CHECK_OFFSET(FSStateChangeParams, 0x00, callback);
358WUT_CHECK_OFFSET(FSStateChangeParams, 0x04, param);
359WUT_CHECK_OFFSET(FSStateChangeParams, 0x08, ioMsgQueue);
360WUT_CHECK_SIZE(FSStateChangeParams, 0x0C);
361
368WUT_CHECK_OFFSET(FSAsyncData, 0x00, callback);
369WUT_CHECK_OFFSET(FSAsyncData, 0x04, param);
370WUT_CHECK_OFFSET(FSAsyncData, 0x08, ioMsgQueue);
371WUT_CHECK_SIZE(FSAsyncData, 0x0C);
372
393WUT_CHECK_OFFSET(FSAsyncResult, 0x00, asyncData);
394WUT_CHECK_OFFSET(FSAsyncResult, 0x0c, ioMsg);
395WUT_CHECK_OFFSET(FSAsyncResult, 0x1c, client);
396WUT_CHECK_OFFSET(FSAsyncResult, 0x20, block);
397WUT_CHECK_OFFSET(FSAsyncResult, 0x24, status);
398WUT_CHECK_SIZE(FSAsyncResult, 0x28);
399
401 WUT_UNKNOWN_BYTES(0x96C);
403 WUT_UNKNOWN_BYTES(0x68);
404};
405WUT_CHECK_OFFSET(FSCmdBlockBody, 0x96C, asyncResult);
406WUT_CHECK_SIZE(FSCmdBlockBody, 0x9FC);
407
409{
411 char name[256];
412};
413WUT_CHECK_OFFSET(FSDirectoryEntry, 0x64, name);
414WUT_CHECK_SIZE(FSDirectoryEntry, 0x164);
415
417{
418 WUT_UNKNOWN_BYTES(0x300);
419};
420WUT_CHECK_SIZE(FSMountSource, 0x300);
421
422struct 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};
436WUT_CHECK_OFFSET(FSVolumeInfo, 0x00, flags);
437WUT_CHECK_OFFSET(FSVolumeInfo, 0x04, mediaState);
438WUT_CHECK_OFFSET(FSVolumeInfo, 0x0C, unk0x0C);
439WUT_CHECK_OFFSET(FSVolumeInfo, 0x10, unk0x10);
440WUT_CHECK_OFFSET(FSVolumeInfo, 0x14, unk0x14);
441WUT_CHECK_OFFSET(FSVolumeInfo, 0x18, unk0x18);
442WUT_CHECK_OFFSET(FSVolumeInfo, 0x2C, volumeLabel);
443WUT_CHECK_OFFSET(FSVolumeInfo, 0xAC, volumeId);
444WUT_CHECK_OFFSET(FSVolumeInfo, 0x12C, devicePath);
445WUT_CHECK_OFFSET(FSVolumeInfo, 0x13C, mountPath);
446WUT_CHECK_SIZE(FSVolumeInfo, 444);
447
448
452static inline FSClientBody *
454 if (!client) {
455 return NULL;
456 }
457 return (FSClientBody *) ((((uint32_t) client) + 0x3F) & ~0x3F);
458}
459
463static inline FSCmdBlockBody *
465 if (!cmdBlock) {
466 return NULL;
467 }
468 return (FSCmdBlockBody *) ((((uint32_t) cmdBlock) + 0x3F) & ~0x3F);
469}
470
471void
473
474void
476
479 FSErrorFlag errorMask);
480
483 FSErrorFlag errorMask);
484
485uint32_t
487
488void
490
493 FSPriority priority);
494
495void
497 FSStateChangeParams *info);
498
501 FSCmdBlock *block,
502 char *buffer,
503 uint32_t bufferSize,
504 FSErrorFlag errorMask);
505
508 FSCmdBlock *block,
509 const char *path,
510 FSErrorFlag errorMask);
511
514 FSCmdBlock *block,
515 const char *path,
516 FSErrorFlag errorMask,
517 FSAsyncData *asyncData);
518
521
524 FSCmdBlock *block,
525 const char *path,
526 FSStat *stat,
527 FSErrorFlag errorMask);
528
531 FSCmdBlock *block,
532 const char *path,
533 FSStat *stat,
534 FSErrorFlag errorMask,
535 FSAsyncData *asyncData);
536
539 FSCmdBlock *block,
540 const char *path,
541 FSErrorFlag errorMask);
542
545 FSCmdBlock *block,
546 const char *path,
547 FSErrorFlag errorMask,
548 FSAsyncData *asyncData);
549
550
553 FSCmdBlock *block,
554 const char *path,
555 const char *mode,
556 FSFileHandle *handle,
557 FSErrorFlag errorMask);
558
561 FSCmdBlock *block,
562 const char *path,
563 const char *mode,
564 FSFileHandle *outHandle,
565 FSErrorFlag errorMask,
566 FSAsyncData *asyncData);
567
570 FSCmdBlock *block,
571 FSFileHandle handle,
572 FSErrorFlag errorMask);
573
576 FSCmdBlock *block,
577 FSFileHandle handle,
578 FSErrorFlag errorMask,
579 FSAsyncData *asyncData);
580
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
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
606 FSCmdBlock *block,
607 const char *path,
608 FSDirectoryHandle *handle,
609 FSErrorFlag errorMask);
610
613 FSCmdBlock *block,
614 const char *path,
615 FSDirectoryHandle *handle,
616 FSErrorFlag errorMask,
617 FSAsyncData *asyncData);
618
621 FSCmdBlock *block,
622 const char *path,
623 FSErrorFlag errorMask);
624
627 FSCmdBlock *block,
628 const char *path,
629 FSErrorFlag errorMask,
630 FSAsyncData *asyncData);
631
634 FSCmdBlock *block,
635 FSDirectoryHandle handle,
636 FSDirectoryEntry *entry,
637 FSErrorFlag errorMask);
638
641 FSCmdBlock *block,
642 FSDirectoryHandle handle,
643 FSDirectoryEntry *entry,
644 FSErrorFlag errorMask,
645 FSAsyncData *asyncData);
646
649 FSCmdBlock *block,
650 FSDirectoryHandle handle,
651 FSErrorFlag errorMask);
652
655 FSCmdBlock *block,
656 FSDirectoryHandle handle,
657 FSErrorFlag errorMask);
658
661 FSCmdBlock *block,
662 const char *path,
663 FSVolumeInfo *volumeInfo,
664 FSErrorFlag errorMask);
665
668 FSCmdBlock *block,
669 const char *path,
670 FSVolumeInfo *volumeInfo,
671 FSErrorFlag errorMask,
672 FSAsyncData *asyncData);
673
676 FSCmdBlock *block,
677 FSDirectoryHandle handle,
678 FSErrorFlag errorMask,
679 FSAsyncData *asyncData);
682 FSCmdBlock *block,
683 const char *path,
684 FSMode mode,
685 FSMode modeMask,
686 FSErrorFlag errorMask);
687
690 FSCmdBlock *block,
691 const char *path,
692 FSMode mode,
693 FSMode modeMask,
694 FSErrorFlag errorMask,
695 FSAsyncData *asyncData);
696
699 FSCmdBlock *block,
700 const char *path,
701 uint64_t *outSize,
702 FSErrorFlag errorMask);
703
706 FSCmdBlock *block,
707 const char *path,
708 uint64_t *outSize,
709 FSErrorFlag errorMask,
710 FSAsyncData *asyncData);
711
714 FSCmdBlock *block,
715 FSFileHandle handle,
716 FSStat *stat,
717 FSErrorFlag errorMask);
718
721 FSCmdBlock *block,
722 FSFileHandle handle,
723 FSStat *stat,
724 FSErrorFlag errorMask,
725 FSAsyncData *asyncData);
726
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
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
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
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
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
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
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
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
817 FSCmdBlock *block,
818 FSFileHandle fileHandle,
819 uint32_t *pos,
820 FSErrorFlag errorMask);
821
824 FSCmdBlock *block,
825 FSFileHandle fileHandle,
826 uint32_t *pos,
827 FSErrorFlag errorMask,
828 FSAsyncData *asyncData);
829
832 FSCmdBlock *block,
833 FSFileHandle handle,
834 uint32_t pos,
835 FSErrorFlag errorMask);
836
839 FSCmdBlock *block,
840 FSFileHandle handle,
841 uint32_t pos,
842 FSErrorFlag errorMask,
843 FSAsyncData *asyncData);
844
847 FSCmdBlock *block,
848 FSFileHandle handle,
849 FSErrorFlag errorMask);
850
853 FSCmdBlock *block,
854 FSFileHandle handle,
855 FSErrorFlag errorMask,
856 FSAsyncData *asyncData);
857
860 FSCmdBlock *block,
861 FSFileHandle handle,
862 FSErrorFlag errorMask);
863
866 FSCmdBlock *block,
867 FSFileHandle handle,
868 FSErrorFlag errorMask,
869 FSAsyncData *asyncData);
870
873 FSCmdBlock *block,
874 const char *oldPath,
875 const char *newPath,
876 FSErrorFlag errorMask);
877
880 FSCmdBlock *block,
881 const char *oldPath,
882 const char *newPath,
883 FSErrorFlag errorMask,
884 FSAsyncData *asyncData);
885
888
891
894
897 FSCmdBlock *cmd,
899 FSMountSource *out,
900 FSErrorFlag errorMask);
901
904 FSCmdBlock *cmd,
905 FSMountSource *source,
906 const char *target,
907 uint32_t bytes,
908 FSErrorFlag errorMask);
909
912 FSCmdBlock *cmd,
913 const char *target,
914 FSErrorFlag errorMask);
915
918 FSCmdBlock *cmd,
919 const char *source,
920 const char *target,
921 FSErrorFlag errorMask);
922
925 FSCmdBlock *cmd,
926 const char *target,
927 FSErrorFlag errorMask);
928
930void
932 OSCalendarTime *outCalendarTime);
933
934#ifdef __cplusplus
935}
936#endif
937
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:275
FSAsyncResult asyncResult
Definition filesystem.h:402
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:253
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:426
OSFastMutex mutex
Mutex used to protect FSClientBody data.
Definition filesystem.h:270
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:230
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)
static FSClientBody * FSGetClientBody(FSClient *client)
Get an aligned FSClientBody from an FSClient.
Definition filesystem.h:453
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)
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)
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
FSAsyncResult * FSGetAsyncResult(FSMessage *message)
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)
static FSCmdBlockBody * FSGetCmdBlockBody(FSCmdBlock *cmdBlock)
Get an aligned FSCmdBlockBody from an FSCmdBlock.
Definition filesystem.h:464
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
Same as std c struct tm but with msec and usec added.
Definition time.h:22