summaryrefslogtreecommitdiff
path: root/include/user/kernel/iofilemgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/user/kernel/iofilemgr.h')
-rw-r--r--include/user/kernel/iofilemgr.h236
1 files changed, 3 insertions, 233 deletions
diff --git a/include/user/kernel/iofilemgr.h b/include/user/kernel/iofilemgr.h
index 5f1b418..63e7eca 100644
--- a/include/user/kernel/iofilemgr.h
+++ b/include/user/kernel/iofilemgr.h
@@ -1,244 +1,14 @@
#ifndef _DOLCESDK_PSP2_KERNEL_IOFILEMGR_H_
#define _DOLCESDK_PSP2_KERNEL_IOFILEMGR_H_
-#include <psp2common/kernel/iofilemgr.h>
-#include <psp2/kernel/iofilemgr/async.h>
-#include <psp2/kernel/iofilemgr/stat.h>
-#include <psp2/kernel/iofilemgr/dirent.h>
+#include_next <kernel/iofilemgr.h>
+
+#include <kernel/iofilemgr_async.h>
#ifdef __cplusplus
extern "C" {
#endif
-/**
- * Remove directory entry
- *
- * @param filename - Path to the file to remove
- * @return < 0 on error
- */
-int sceIoRemove(const char *filename);
-
-/**
- * Make a directory file
- *
- * @param dirname - The path to the directory
- * @param mode - Access mode bits.
- * @return Returns the value 0 if it's successful, otherwise <0
- */
-int sceIoMkdir(const char *dirname, SceIoMode mode);
-
-/**
- * Remove a directory file
- *
- * @param dirname - Removes a directory file pointed by the string path
- * @return Returns the value 0 if it's successful, otherwise <0
- */
-int sceIoRmdir(const char *dirname);
-
-/**
- * Change the name of a file
- *
- * @param oldname - The old filename
- * @param newname - The new filename
- * @return < 0 on error.
- */
-int sceIoRename(const char *oldname, const char *newname);
-
-/**
- * Send a devctl command to a device.
- *
- * @par Example: Sending a simple command to a device
- * @code
- * SceIoDevInfo info;
- * sceIoDevctl("ux0:", 0x3001, NULL, 0, &info, sizeof(SceIoDevInfo));
- * @endcode
- *
- * @param devname - String for the device to send the devctl to (e.g. "ux0:")
- * @param cmd - The command to send to the device
- * @param arg - A data block to send to the device, if NULL sends no data
- * @param arglen - Length of indata, if 0 sends no data
- * @param bufp - A data block to receive the result of a command, if NULL receives no data
- * @param buflen - Length of outdata, if 0 receives no data
- * @return 0 on success, < 0 on error
- */
-int sceIoDevctl(
- const char *devname,
- int cmd,
- const void *arg,
- SceSize arglen,
- void *bufp,
- SceSize buflen);
-
-/**
- * Synchronize the file data on the device.
- *
- * @param devname - The device to synchronize (e.g. msfat0:)
- * @param flag - device specific flags
- */
-int sceIoSync(const char *devname, int flag);
-
-/**
- * Open or create a file for reading or writing
- *
- * @par Example1: Open a file for reading
- * @code
- * if((fd = sceIoOpen("device:/path/to/file", SCE_O_RDONLY, 0777) < 0) {
- * // error code in fd, for example no open filehandle left (0x80010018)
- * }
- * @endcode
- * @par Example2: Open a file for writing, creating it if it doesn't exist
- * @code
- * if((fd = sceIoOpen("device:/path/to/file", SCE_O_WRONLY|SCE_O_CREAT, 0777) < 0) {
- * // error code in fd, for example no open filehandle left (0x80010018)
- * }
- * @endcode
- *
- * @param filename - Pointer to a string holding the name of the file to open
- * @param flag - Libc styled flags that are or'ed together
- * @param mode - File access mode (One or more ::SceIoMode).
- * @return A non-negative integer is a valid fd, anything else an error
- */
-SceUID sceIoOpen(const char *filename, int flag, SceIoMode mode);
-
-/**
- * Delete a descriptor
- *
- * @code
- * sceIoClose(fd);
- * @endcode
- *
- * @param fd - File descriptor to close
- * @return < 0 on error
- */
-int sceIoClose(SceUID fd);
-
-/**
- * Perform an ioctl on a device.
- *
- * @param fd - Opened file descriptor to ioctl to
- * @param cmd - The command to send to the device
- * @param argp - A data block to send to the device, if NULL sends no data
- * @param arglen - Length of indata, if 0 sends no data
- * @param bufp - A data block to receive the result of a command, if NULL receives no data
- * @param buflen - Length of outdata, if 0 receives no data
- * @return 0 on success, < 0 on error
- */
-int sceIoIoctl(
- SceUID fd,
- int cmd,
- const void *argp,
- SceSize arglen,
- void *bufp,
- SceSize buflen);
-
-/**
- * Reposition read/write file descriptor offset
- *
- * @par Example:
- * @code
- * pos = sceIoLseek(fd, -10, SCE_SEEK_END);
- * @endcode
- *
- * @param fd - Opened file descriptor with which to seek
- * @param offset - Relative offset from the start position given by whence
- * @param whence - One of ::SceIoSeekMode.
- *
- * @return The position in the file after the seek.
- */
-SceOff sceIoLseek(SceUID fd, SceOff offset, int whence);
-
-/**
- * Reposition read/write file descriptor offset (32bit mode)
- *
- * @par Example:
- * @code
- * pos = sceIoLseek32(fd, -10, SCE_SEEK_END);
- * @endcode
- *
- * @param fd - Opened file descriptor with which to seek
- * @param offset - Relative offset from the start position given by whence
- * @param whence - One of ::SceIoSeekMode.
- *
- * @return The position in the file after the seek.
- */
-long sceIoLseek32(SceUID fd, long offset, int whence);
-
-/**
- * Read input
- *
- * @par Example:
- * @code
- * bytes_read = sceIoRead(fd, data, 100);
- * @endcode
- *
- * @param fd - Opened file descriptor to read from
- * @param buf - Pointer to the buffer where the read data will be placed
- * @param nbyte - Size of the read in bytes
- *
- * @return The number of bytes read
- */
-SceSSize sceIoRead(SceUID fd, void *buf, SceSize nbyte);
-
-/**
- * Write output
- *
- * @par Example:
- * @code
- * bytes_written = sceIoWrite(fd, data, 100);
- * @endcode
- *
- * @param fd - Opened file descriptor to write to
- * @param buf - Pointer to the data to write
- * @param nbyte - Size of data to write
- *
- * @return The number of bytes written
- */
-SceSSize sceIoWrite(SceUID fd, const void *buf, SceSize nbyte);
-
-/**
- * Read input at offset
- *
- * @par Example:
- * @code
- * bytes_read = sceIoPread(fd, data, 100, 0x1000);
- * @endcode
- *
- * @param fd - Opened file descriptor to read from
- * @param buf - Pointer to the buffer where the read data will be placed
- * @param nbyte - Size of the read in bytes
- * @param offset - Offset to read
- *
- * @return < 0 on error.
- */
-SceSSize sceIoPread(SceUID fd, void *buf, SceSize nbyte, SceOff offset);
-
-/**
- * Write output at offset
- *
- * @par Example:
- * @code
- * bytes_written = sceIoPwrite(fd, data, 100, 0x1000);
- * @endcode
- *
- * @param fd - Opened file descriptor to write to
- * @param buf - Pointer to the data to write
- * @param nbyte - Size of data to write
- * @param offset - Offset to write
- *
- * @return The number of bytes written
- */
-SceSSize sceIoPwrite(SceUID fd, const void *buf, SceSize nbyte, SceOff offset);
-
-/**
- * Synchronize the file data for one file
- *
- * @param fd - Opened file descriptor to sync
- * @param flag - device specific flags
- *
- * @return < 0 on error.
- */
-int sceIoSyncByFd(SceUID fd, int flag);
-
/*--------------------Async IO--------------------*/
/**