diff --git a/configure.py b/configure.py index 6ae4df5..6f92cbd 100755 --- a/configure.py +++ b/configure.py @@ -724,15 +724,15 @@ def MatchingFor(*versions): Object(Matching, "revolution/VF/pf_fclose.c"), Object(Matching, "revolution/VF/pf_finfo.c"), Object(Matching, "revolution/VF/pf_fopen.c"), - Object(NonMatching, "revolution/VF/pf_format.c"), + Object(Matching, "revolution/VF/pf_format.c"), Object(Matching, "revolution/VF/pf_fread.c"), Object(Matching, "revolution/VF/pf_fseek.c"), - Object(NonMatching, "revolution/VF/pf_fsfirst.c"), - Object(NonMatching, "revolution/VF/pf_fsnext.c"), + Object(Matching, "revolution/VF/pf_fsfirst.c"), + Object(Matching, "revolution/VF/pf_fsnext.c"), Object(Matching, "revolution/VF/pf_fwrite.c"), Object(Matching, "revolution/VF/pf_getdev.c"), Object(Matching, "revolution/VF/pf_init_prfile2.c"), - Object(NonMatching, "revolution/VF/pf_mkdir.c"), + Object(Matching, "revolution/VF/pf_mkdir.c"), Object(Matching, "revolution/VF/pf_remove.c"), Object(Matching, "revolution/VF/pf_unmount.c"), Object(Matching, "revolution/VF/pf_filelock.c"), diff --git a/include/revolution/VF.h b/include/revolution/VF.h index ccfc272..a9cd022 100644 --- a/include/revolution/VF.h +++ b/include/revolution/VF.h @@ -42,11 +42,15 @@ extern "C" { #include #include #include +#include #include #include +#include +#include #include #include #include +#include #include #include #include diff --git a/include/revolution/VF/pf_dir.h b/include/revolution/VF/pf_dir.h index 4f6b7e8..5d01860 100644 --- a/include/revolution/VF/pf_dir.h +++ b/include/revolution/VF/pf_dir.h @@ -5,6 +5,9 @@ extern "C" { #endif +s32 VFiPFDIR_fsfirst(struct PF_STR* p_path, u8 attr, struct PF_DTA* p_dta); +s32 VFiPFDIR_fsnext(struct PF_DTA* p_dta); +s32 VFiPFDIR_mkdir(struct PF_STR* p_path); void VFiPFDIR_FinalizeAllDirs(struct PF_VOLUME* p_vol); #ifdef __cplusplus diff --git a/include/revolution/VF/pf_format.h b/include/revolution/VF/pf_format.h new file mode 100644 index 0000000..0170219 --- /dev/null +++ b/include/revolution/VF/pf_format.h @@ -0,0 +1,13 @@ +#ifndef RVL_SDK_VF_PF_FORMAT_H +#define RVL_SDK_VF_PF_FORMAT_H +#include +#ifdef __cplusplus +extern "C" { +#endif + +int VFipf2_format(s8 drive, const u8* param); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/include/revolution/VF/pf_fsfirst.h b/include/revolution/VF/pf_fsfirst.h new file mode 100644 index 0000000..4fa3405 --- /dev/null +++ b/include/revolution/VF/pf_fsfirst.h @@ -0,0 +1,13 @@ +#ifndef RVL_SDK_VF_PF_FSFIRST_H +#define RVL_SDK_VF_PF_FSFIRST_H +#include +#ifdef __cplusplus +extern "C" { +#endif + +int VFipf2_fsfirst(const s8* path, u8 attr, struct PF_DTA* p_dta); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/include/revolution/VF/pf_fsnext.h b/include/revolution/VF/pf_fsnext.h new file mode 100644 index 0000000..7bafdf3 --- /dev/null +++ b/include/revolution/VF/pf_fsnext.h @@ -0,0 +1,13 @@ +#ifndef RVL_SDK_VF_PF_FSNEXT_H +#define RVL_SDK_VF_PF_FSNEXT_H +#include +#ifdef __cplusplus +extern "C" { +#endif + +int VFipf2_fsnext(struct PF_DTA* p_dta); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/include/revolution/VF/pf_mkdir.h b/include/revolution/VF/pf_mkdir.h new file mode 100644 index 0000000..0f58548 --- /dev/null +++ b/include/revolution/VF/pf_mkdir.h @@ -0,0 +1,13 @@ +#ifndef RVL_SDK_VF_PF_MKDIR_H +#define RVL_SDK_VF_PF_MKDIR_H +#include +#ifdef __cplusplus +extern "C" { +#endif + +int VFipf2_mkdir(const s8* path); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/revolution/VF/d_vf_sys.c b/src/revolution/VF/d_vf_sys.c index e60dc9f..9e4ec8b 100644 --- a/src/revolution/VF/d_vf_sys.c +++ b/src/revolution/VF/d_vf_sys.c @@ -29,7 +29,6 @@ union VFSysDeviceTableEntry { }; s32 VFSysSetSyncMode(s32 i_handle_idx, u32 i_mode); -int VFipf2_format(s8 drive, const s8* param); static union VFSysDeviceTableEntry* l_vfsys_dev_table[26]; static struct PDM_INIT_DISK l_dev_init_info_table[26]; diff --git a/src/revolution/VF/pf_format.c b/src/revolution/VF/pf_format.c index e69de29..b6c6a83 100644 --- a/src/revolution/VF/pf_format.c +++ b/src/revolution/VF/pf_format.c @@ -0,0 +1,8 @@ +#include + +int VFipf2_format(s8 drive, const u8* param) { + s32 err; + + err = VFiPFVOL_format(drive, param); + return VFiPFAPI_convertReturnValue(err); +} diff --git a/src/revolution/VF/pf_fsfirst.c b/src/revolution/VF/pf_fsfirst.c index e69de29..32cd9a5 100644 --- a/src/revolution/VF/pf_fsfirst.c +++ b/src/revolution/VF/pf_fsfirst.c @@ -0,0 +1,17 @@ +#include + +extern PF_VOLUME_SET VFipf_vol_set; + +int VFipf2_fsfirst(const s8* path, u8 attr, struct PF_DTA* p_dta) { + s32 err; + struct PF_STR path_str; + + err = VFiPFSTR_InitStr(&path_str, (const s8*)path, 1); + if (err == 0) { + err = VFiPFDIR_fsfirst(&path_str, attr, p_dta); + } else { + VFipf_vol_set.last_error = err; + } + + return VFiPFAPI_convertReturnValue(err); +} diff --git a/src/revolution/VF/pf_fsnext.c b/src/revolution/VF/pf_fsnext.c index e69de29..90b9ba1 100644 --- a/src/revolution/VF/pf_fsnext.c +++ b/src/revolution/VF/pf_fsnext.c @@ -0,0 +1,8 @@ +#include + +int VFipf2_fsnext(struct PF_DTA* p_dta) { + s32 err; + + err = VFiPFDIR_fsnext(p_dta); + return VFiPFAPI_convertReturnValue(err); +} diff --git a/src/revolution/VF/pf_mkdir.c b/src/revolution/VF/pf_mkdir.c index e69de29..b4045cd 100644 --- a/src/revolution/VF/pf_mkdir.c +++ b/src/revolution/VF/pf_mkdir.c @@ -0,0 +1,17 @@ +#include + +extern PF_VOLUME_SET VFipf_vol_set; + +int VFipf2_mkdir(const s8* path) { + s32 err; + struct PF_STR path_str; + + err = VFiPFSTR_InitStr(&path_str, (const s8*)path, 1); + if (err == 0) { + err = VFiPFDIR_mkdir(&path_str); + } else { + VFipf_vol_set.last_error = err; + } + + return VFiPFAPI_convertReturnValue(err); +}