Data Structures | |
struct | pgeDirEntry |
struct | pgeDir |
Typedefs | |
typedef struct pgeFileStruct | pgeFile |
Enumerations | |
enum | pgeFileTypes { PGE_FILE_TYPE_MEM = 1, PGE_FILE_TYPE_FILE, PGE_FILE_TYPE_AFILE } |
enum | pgeFileSeekTypes { PGE_FILE_SET = 0, PGE_FILE_CUR, PGE_FILE_END } |
enum | pgeFileFlags { PGE_FILE_RDONLY = PSP_O_RDONLY, PGE_FILE_WRONLY = PSP_O_WRONLY, PGE_FILE_RDWR = PSP_O_RDWR, PGE_FILE_APPEND = PSP_O_APPEND, PGE_FILE_CREATE = PSP_O_CREAT, PGE_FILE_TRUNC = PSP_O_TRUNC, PGE_FILE_ALL = PGE_FILE_RDWR|PGE_FILE_APPEND|PGE_FILE_CREATE|PGE_FILE_TRUNC } |
enum | pgeDirEntryTypes { PGE_DIR_ENTRY_TYPE_FILE, PGE_DIR_ENTRY_TYPE_DIR } |
Functions | |
pgeFile * | pgeFileOpen (char *name, int flags) |
pgeFile * | pgeFileOpenAsync (char *name, int flags) |
pgeFile * | pgeFileOpenMemory (char *data, int size) |
int | pgeFileClose (pgeFile *s) |
int | pgeFileRead (pgeFile *s, void *buf, unsigned int size) |
int | pgeFileWrite (pgeFile *s, void *buf, unsigned int size) |
int | pgeFileSeek (pgeFile *s, int offs, unsigned int dir) |
int | pgeFileTell (pgeFile *s) |
int | pgeFileRewind (pgeFile *s) |
unsigned int | pgeFileSize (pgeFile *s) |
int | pgeFileRemove (const char *filepath) |
int | pgeFileRename (const char *oldname, const char *newname) |
int | pgeFileExists (const char *filename) |
int | pgeFileMkdir (const char *name) |
int | pgeFileRmdir (const char *dirpath) |
int | pgeFileChdir (const char *path) |
int | pgeFileGetCwd (char *path, unsigned int size) |
pgeDir * | pgeFileOpenDir (const char *path) |
int | pgeFileReadDir (pgeDir *dir) |
void | pgeFileCloseDir (pgeDir *dir) |
int | pgeFileExistsDir (const char *dirname) |
typedef struct pgeFileStruct pgeFile |
A file datatype
enum pgeDirEntryTypes |
enum pgeFileFlags |
enum pgeFileSeekTypes |
enum pgeFileTypes |
int pgeFileChdir | ( | const char * | path | ) |
Change directory.
path | - Path to change to. |
int pgeFileClose | ( | pgeFile * | s | ) |
Close a stream.
s | - The stream to close. |
void pgeFileCloseDir | ( | pgeDir * | dir | ) |
int pgeFileExists | ( | const char * | filename | ) |
Check a file exists.
filename | - The filename to check exists. |
int pgeFileExistsDir | ( | const char * | dirname | ) |
Check a directory exists.
dirname | - The directory to check exists. |
int pgeFileGetCwd | ( | char * | path, | |
unsigned int | size | |||
) |
Get current working directory.
path | - Pointer to the buffer to store the cwd in. | |
size | - Size of the buffer. |
int pgeFileMkdir | ( | const char * | name | ) |
Create a directory.
name | - Name of the directory. |
pgeFile* pgeFileOpen | ( | char * | name, | |
int | flags | |||
) |
Open a file stream.
name | - Path to the file. | |
flags | - One or more of pgeFileFlags |
pgeFile* pgeFileOpenAsync | ( | char * | name, | |
int | flags | |||
) |
Open a file stream (async).
name | - Path to the file. | |
flags | - One or more of pgeFileFlags |
pgeDir* pgeFileOpenDir | ( | const char * | path | ) |
Open a directory for reading.
path | - Path to open. |
pgeFile* pgeFileOpenMemory | ( | char * | data, | |
int | size | |||
) |
Open a memory stream.
data | - Pointer to the data. | |
flags | - Size of the data in bytes. |
int pgeFileRead | ( | pgeFile * | s, | |
void * | buf, | |||
unsigned int | size | |||
) |
Read from a stream.
s | - The stream to read from. | |
buf | - The buffer to read the data into. | |
size | - Size of the read in bytes. |
int pgeFileReadDir | ( | pgeDir * | dir | ) |
Read a directory contents.
dir | - A previously opened pgeDir. |
int pgeFileRemove | ( | const char * | filepath | ) |
Remove a file.
filepath | - Path to the file. |
int pgeFileRename | ( | const char * | oldname, | |
const char * | newname | |||
) |
Rename a file or directory.
oldname | - The file or directory to rename. | |
newname | - The new name of the file or directory. |
int pgeFileRewind | ( | pgeFile * | s | ) |
Seek to the start of a file.
s | - The file. |
int pgeFileRmdir | ( | const char * | dirpath | ) |
Delete a directory.
dirpath | - Path to the directory. |
int pgeFileSeek | ( | pgeFile * | s, | |
int | offs, | |||
unsigned int | dir | |||
) |
Seek within a stream.
s | - The stream to seek. | |
offs | - The stream offset. | |
dir | - One of pgeFileSeekTypes. |
unsigned int pgeFileSize | ( | pgeFile * | s | ) |
Get the size of a file.
s | - The file. |
int pgeFileTell | ( | pgeFile * | s | ) |
Get position within a stream.
s | - The stream. |
int pgeFileWrite | ( | pgeFile * | s, | |
void * | buf, | |||
unsigned int | size | |||
) |
Write to a stream.
s | - The stream to write to. | |
buf | - The buffer to write. | |
size | - Size of the write in bytes. |