From 648ee989cc6ac04ba07f5a8942f6ab711f62d6b4 Mon Sep 17 00:00:00 2001 From: Reiko Asakura Date: Wed, 20 Jan 2021 14:11:05 -0500 Subject: Rename iofilemgr headers --- include/kernel/kernel/iofilemgr/async.h | 93 ---------------------------- include/kernel/kernel/iofilemgr/dirent.h | 82 ------------------------- include/kernel/kernel/iofilemgr/stat.h | 101 ------------------------------- include/kernel/kernel/iofilemgr_async.h | 93 ++++++++++++++++++++++++++++ include/kernel/kernel/iofilemgr_dirent.h | 82 +++++++++++++++++++++++++ include/kernel/kernel/iofilemgr_stat.h | 101 +++++++++++++++++++++++++++++++ 6 files changed, 276 insertions(+), 276 deletions(-) delete mode 100644 include/kernel/kernel/iofilemgr/async.h delete mode 100644 include/kernel/kernel/iofilemgr/dirent.h delete mode 100644 include/kernel/kernel/iofilemgr/stat.h create mode 100644 include/kernel/kernel/iofilemgr_async.h create mode 100644 include/kernel/kernel/iofilemgr_dirent.h create mode 100644 include/kernel/kernel/iofilemgr_stat.h (limited to 'include/kernel') diff --git a/include/kernel/kernel/iofilemgr/async.h b/include/kernel/kernel/iofilemgr/async.h deleted file mode 100644 index 4584bb7..0000000 --- a/include/kernel/kernel/iofilemgr/async.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_ASYNC_H_ -#define _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_ASYNC_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Async IO operations are scheduled automatically, similar to FIOS2. - * You can make calls to sceIoOpenAsync(), sceIoReadAsync(), - * sceIoCloseAsync() right after each other, they will be put in a schedule - * and performed automatically. - * - * All async IO functions return UID of operation handle, not file descriptor UID. - */ - -/** - * Cancel an asynchronous operation. - * - * @param opHandle - The operation handle to perform cancel on. - * - * @return < 0 on error. If operation has been canceled(finished) already, returns 0x80010002 - */ -int sceIoCancel(SceUID opHandle); - -/** - * Complete an asynchronous operation. - * - * @param opHandle - The operation handle to complete. - * - * @return < 0 on error. - */ -int sceIoComplete(SceUID opHandle); - -/** - * Wait until asynchronous operation has been finished. - * - * @param opHandle - The operation handle to wait for. - * - * @return < 0 on error. - */ -inline -int sceIoWaitAsync(SceUID opHandle) -{ - int ret = sceKernelWaitEvent(opHandle, 1, NULL, NULL, NULL); - if (ret == 0) - return sceIoComplete(opHandle); - else - return ret; -} - -/** - * Wait until asynchronous operation has been finished with callbacks. - * - * @param opHandle - The operation handle to wait for. - * - * @return < 0 on error. - */ -inline -int sceIoWaitAsyncCB(SceUID opHandle) -{ - int ret = sceKernelWaitEventCB(opHandle, 1, NULL, NULL, NULL); - if (ret == 0) - return sceIoComplete(opHandle); - else - return ret; -} - -/** - * Poll asynchronous operation status. - * - * @param opHandle - The operation handle to poll status for. - * - * @return < 0 on error or if operation is not finished. - */ -inline -int sceIoPollAsync(SceUID opHandle) -{ - int ret = sceKernelPollEvent(opHandle, 1, NULL, NULL); - if (ret == 0) - return sceIoComplete(opHandle); - else - return ret; -} - -#ifdef __cplusplus -} -#endif - -#endif /* _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_ASYNC_H_ */ diff --git a/include/kernel/kernel/iofilemgr/dirent.h b/include/kernel/kernel/iofilemgr/dirent.h deleted file mode 100644 index 4bfc584..0000000 --- a/include/kernel/kernel/iofilemgr/dirent.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_DIRENT_H_ -#define _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_DIRENT_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Open a directory - * - * @par Example: - * @code - * int dfd; - * dfd = sceIoDopen("device:/"); - * if(dfd >= 0) - * { Do something with the file descriptor } - * @endcode - * @param dirname - The directory to open for reading. - * @return If >= 0 then a valid file descriptor, otherwise a Sony error code. - */ -SceUID sceIoDopen(const char *dirname); - -/** - * Close an opened directory file descriptor - * - * @param fd - Already opened file descriptor (using ::sceIoDopen) - * @return < 0 on error - */ -int sceIoDclose(SceUID fd); - -/** - * Reads an entry from an opened file descriptor. - * - * @param fd - Already opened file descriptor (using ::sceIoDopen) - * @param buf - Pointer to a ::SceIoDirent structure to hold the file information - * - * @return Read status - * - 0 - No more directory entries left - * - > 0 - More directory entries to go - * - < 0 - Error - */ -int sceIoDread(SceUID fd, SceIoDirent *buf); - -/** - * Open a directory (asynchronous) - * - * @param dirname - The directory to open for reading. - * @param asyncParam - parameters related to async operation. - * - * @return If >= 0 then a valid op handle, otherwise a Sony error code. - */ -SceUID sceIoDopenAsync(const char *dirname, SceIoAsyncParam* asyncParam); - -/** - * Reads an entry from an opened file descriptor (asynchronous) - * - * @param fd - Already opened file descriptor (using ::sceIoDopen or ::sceIoDopenAsync) - * @param dir - Pointer to a ::SceIoDirent structure to hold the file information - * @param asyncParam - parameters related to async operation. - * - * @return If >= 0 then a valid op handle, otherwise a Sony error code. - */ -SceUID sceIoDreadAsync(SceUID fd, SceIoDirent *dir, SceIoAsyncParam* asyncParam); - -/** - * Close an opened directory file descriptor (asynchronous) - * - * @param fd - Already opened file descriptor (using ::sceIoDopen or ::sceIoDopenAsync) - * @param asyncParam - parameters related to async operation. - * - * @return If >= 0 then a valid op handle, otherwise a Sony error code. - */ -SceUID sceIoDcloseAsync(SceUID fd, SceIoAsyncParam* asyncParam); - -#ifdef __cplusplus -} -#endif - -#endif /* _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_DIRENT_H_ */ diff --git a/include/kernel/kernel/iofilemgr/stat.h b/include/kernel/kernel/iofilemgr/stat.h deleted file mode 100644 index c9096e2..0000000 --- a/include/kernel/kernel/iofilemgr/stat.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_STAT_H_ -#define _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_STAT_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Change the status of a file. - * - * @param name - The path to the file. - * @param buf - A pointer to a ::SceIoStat structure. - * @param cbit - Bitmask defining which bits to change. - * - * @return < 0 on error. - */ -int sceIoChstat(const char *name, const SceIoStat *buf, unsigned int cbit); - -/** - * Get the status of a file. - * - * @param name - The path to the file. - * @param buf - A pointer to a ::SceIoStat structure. - * - * @return < 0 on error. - */ -int sceIoGetstat(const char *name, SceIoStat *buf); - -/** - * Get the status of a file descriptor. - * - * @param fd - The file descriptor. - * @param buf - A pointer to a ::SceIoStat structure. - * - * @return < 0 on error. - */ -int sceIoGetstatByFd(SceUID fd, SceIoStat *buf); - -/** - * Change the status of a file descriptor. - * - * @param fd - The file descriptor. - * @param buf - A pointer to an io_stat_t structure. - * @param cbit - Bitmask defining which bits to change. - * - * @return < 0 on error. - */ -int sceIoChstatByFd(SceUID fd, const SceIoStat *buf, unsigned int cbit); - -/** - * Make a directory file (asynchronous) - * - * @param dir - The path to the directory - * @param mode - Access mode (One or more ::SceIoAccessMode). - * @param asyncParam - parameters related to async operation. - * - * @return A non-negative integer is a valid op handle, anything else an error - */ -SceUID sceIoMkdirAsync(const char *dir, SceMode mode, SceIoAsyncParam* asyncParam); - -/** - * Remove a directory file (asynchronous) - * - * @param path - Removes a directory file pointed by the string path - * @param asyncParam - parameters related to async operation. - * - * @return A non-negative integer is a valid op handle, anything else an error - */ -SceUID sceIoRmdirAsync(const char *path, SceIoAsyncParam* asyncParam); - -/** - * Get the status of a file (asynchronous) - * - * @param file - The path to the file. - * @param stat - A pointer to a ::SceIoStat structure. - * @param asyncParam - parameters related to async operation. - * - * @return A non-negative integer is a valid op handle, anything else an error - */ -SceUID sceIoGetstatAsync(const char *file, SceIoStat *stat, SceIoAsyncParam* asyncParam); - -/** - * Change the status of a file (asynchronous) - * - * @param file - The path to the file. - * @param stat - A pointer to a ::SceIoStat structure. - * @param bits - Bitmask defining which bits to change. - * @param asyncParam - parameters related to async operation. - * - * @return A non-negative integer is a valid op handle, anything else an error - */ -SceUID sceIoChstatAsync(const char *file, SceIoStat *stat, int bits, SceIoAsyncParam* asyncParam); - -#ifdef __cplusplus -} -#endif - -#endif /* _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_STAT_H_ */ diff --git a/include/kernel/kernel/iofilemgr_async.h b/include/kernel/kernel/iofilemgr_async.h new file mode 100644 index 0000000..4584bb7 --- /dev/null +++ b/include/kernel/kernel/iofilemgr_async.h @@ -0,0 +1,93 @@ +#ifndef _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_ASYNC_H_ +#define _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_ASYNC_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Async IO operations are scheduled automatically, similar to FIOS2. + * You can make calls to sceIoOpenAsync(), sceIoReadAsync(), + * sceIoCloseAsync() right after each other, they will be put in a schedule + * and performed automatically. + * + * All async IO functions return UID of operation handle, not file descriptor UID. + */ + +/** + * Cancel an asynchronous operation. + * + * @param opHandle - The operation handle to perform cancel on. + * + * @return < 0 on error. If operation has been canceled(finished) already, returns 0x80010002 + */ +int sceIoCancel(SceUID opHandle); + +/** + * Complete an asynchronous operation. + * + * @param opHandle - The operation handle to complete. + * + * @return < 0 on error. + */ +int sceIoComplete(SceUID opHandle); + +/** + * Wait until asynchronous operation has been finished. + * + * @param opHandle - The operation handle to wait for. + * + * @return < 0 on error. + */ +inline +int sceIoWaitAsync(SceUID opHandle) +{ + int ret = sceKernelWaitEvent(opHandle, 1, NULL, NULL, NULL); + if (ret == 0) + return sceIoComplete(opHandle); + else + return ret; +} + +/** + * Wait until asynchronous operation has been finished with callbacks. + * + * @param opHandle - The operation handle to wait for. + * + * @return < 0 on error. + */ +inline +int sceIoWaitAsyncCB(SceUID opHandle) +{ + int ret = sceKernelWaitEventCB(opHandle, 1, NULL, NULL, NULL); + if (ret == 0) + return sceIoComplete(opHandle); + else + return ret; +} + +/** + * Poll asynchronous operation status. + * + * @param opHandle - The operation handle to poll status for. + * + * @return < 0 on error or if operation is not finished. + */ +inline +int sceIoPollAsync(SceUID opHandle) +{ + int ret = sceKernelPollEvent(opHandle, 1, NULL, NULL); + if (ret == 0) + return sceIoComplete(opHandle); + else + return ret; +} + +#ifdef __cplusplus +} +#endif + +#endif /* _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_ASYNC_H_ */ diff --git a/include/kernel/kernel/iofilemgr_dirent.h b/include/kernel/kernel/iofilemgr_dirent.h new file mode 100644 index 0000000..4bfc584 --- /dev/null +++ b/include/kernel/kernel/iofilemgr_dirent.h @@ -0,0 +1,82 @@ +#ifndef _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_DIRENT_H_ +#define _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_DIRENT_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Open a directory + * + * @par Example: + * @code + * int dfd; + * dfd = sceIoDopen("device:/"); + * if(dfd >= 0) + * { Do something with the file descriptor } + * @endcode + * @param dirname - The directory to open for reading. + * @return If >= 0 then a valid file descriptor, otherwise a Sony error code. + */ +SceUID sceIoDopen(const char *dirname); + +/** + * Close an opened directory file descriptor + * + * @param fd - Already opened file descriptor (using ::sceIoDopen) + * @return < 0 on error + */ +int sceIoDclose(SceUID fd); + +/** + * Reads an entry from an opened file descriptor. + * + * @param fd - Already opened file descriptor (using ::sceIoDopen) + * @param buf - Pointer to a ::SceIoDirent structure to hold the file information + * + * @return Read status + * - 0 - No more directory entries left + * - > 0 - More directory entries to go + * - < 0 - Error + */ +int sceIoDread(SceUID fd, SceIoDirent *buf); + +/** + * Open a directory (asynchronous) + * + * @param dirname - The directory to open for reading. + * @param asyncParam - parameters related to async operation. + * + * @return If >= 0 then a valid op handle, otherwise a Sony error code. + */ +SceUID sceIoDopenAsync(const char *dirname, SceIoAsyncParam* asyncParam); + +/** + * Reads an entry from an opened file descriptor (asynchronous) + * + * @param fd - Already opened file descriptor (using ::sceIoDopen or ::sceIoDopenAsync) + * @param dir - Pointer to a ::SceIoDirent structure to hold the file information + * @param asyncParam - parameters related to async operation. + * + * @return If >= 0 then a valid op handle, otherwise a Sony error code. + */ +SceUID sceIoDreadAsync(SceUID fd, SceIoDirent *dir, SceIoAsyncParam* asyncParam); + +/** + * Close an opened directory file descriptor (asynchronous) + * + * @param fd - Already opened file descriptor (using ::sceIoDopen or ::sceIoDopenAsync) + * @param asyncParam - parameters related to async operation. + * + * @return If >= 0 then a valid op handle, otherwise a Sony error code. + */ +SceUID sceIoDcloseAsync(SceUID fd, SceIoAsyncParam* asyncParam); + +#ifdef __cplusplus +} +#endif + +#endif /* _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_DIRENT_H_ */ diff --git a/include/kernel/kernel/iofilemgr_stat.h b/include/kernel/kernel/iofilemgr_stat.h new file mode 100644 index 0000000..c9096e2 --- /dev/null +++ b/include/kernel/kernel/iofilemgr_stat.h @@ -0,0 +1,101 @@ +#ifndef _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_STAT_H_ +#define _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_STAT_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Change the status of a file. + * + * @param name - The path to the file. + * @param buf - A pointer to a ::SceIoStat structure. + * @param cbit - Bitmask defining which bits to change. + * + * @return < 0 on error. + */ +int sceIoChstat(const char *name, const SceIoStat *buf, unsigned int cbit); + +/** + * Get the status of a file. + * + * @param name - The path to the file. + * @param buf - A pointer to a ::SceIoStat structure. + * + * @return < 0 on error. + */ +int sceIoGetstat(const char *name, SceIoStat *buf); + +/** + * Get the status of a file descriptor. + * + * @param fd - The file descriptor. + * @param buf - A pointer to a ::SceIoStat structure. + * + * @return < 0 on error. + */ +int sceIoGetstatByFd(SceUID fd, SceIoStat *buf); + +/** + * Change the status of a file descriptor. + * + * @param fd - The file descriptor. + * @param buf - A pointer to an io_stat_t structure. + * @param cbit - Bitmask defining which bits to change. + * + * @return < 0 on error. + */ +int sceIoChstatByFd(SceUID fd, const SceIoStat *buf, unsigned int cbit); + +/** + * Make a directory file (asynchronous) + * + * @param dir - The path to the directory + * @param mode - Access mode (One or more ::SceIoAccessMode). + * @param asyncParam - parameters related to async operation. + * + * @return A non-negative integer is a valid op handle, anything else an error + */ +SceUID sceIoMkdirAsync(const char *dir, SceMode mode, SceIoAsyncParam* asyncParam); + +/** + * Remove a directory file (asynchronous) + * + * @param path - Removes a directory file pointed by the string path + * @param asyncParam - parameters related to async operation. + * + * @return A non-negative integer is a valid op handle, anything else an error + */ +SceUID sceIoRmdirAsync(const char *path, SceIoAsyncParam* asyncParam); + +/** + * Get the status of a file (asynchronous) + * + * @param file - The path to the file. + * @param stat - A pointer to a ::SceIoStat structure. + * @param asyncParam - parameters related to async operation. + * + * @return A non-negative integer is a valid op handle, anything else an error + */ +SceUID sceIoGetstatAsync(const char *file, SceIoStat *stat, SceIoAsyncParam* asyncParam); + +/** + * Change the status of a file (asynchronous) + * + * @param file - The path to the file. + * @param stat - A pointer to a ::SceIoStat structure. + * @param bits - Bitmask defining which bits to change. + * @param asyncParam - parameters related to async operation. + * + * @return A non-negative integer is a valid op handle, anything else an error + */ +SceUID sceIoChstatAsync(const char *file, SceIoStat *stat, int bits, SceIoAsyncParam* asyncParam); + +#ifdef __cplusplus +} +#endif + +#endif /* _DOLCESDK_PSP2KERN_KERNEL_IOFILEMGR_STAT_H_ */ -- cgit v1.2.3