ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
#include <kernel.h>
#include <malloc.h>
#include <sio.h>
#include <time.h>
#include <sys/time.h>
#include <sys/times.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdint.h>
#include <limits.h>
#include <inttypes.h>
#include <tamtypes.h>
#include "fileio.h"
#include "io_common.h"
#include "iox_stat.h"
#include "ps2sdkapi.h"
Go to the source code of this file.
Macros | |
#define | NEWLIB_PORT_AWARE |
#define | IOP_O_RDONLY 0x0001 |
#define | IOP_O_WRONLY 0x0002 |
#define | IOP_O_RDWR 0x0003 |
#define | IOP_O_DIROPEN 0x0008 |
#define | IOP_O_NBLOCK 0x0010 |
#define | IOP_O_APPEND 0x0100 |
#define | IOP_O_CREAT 0x0200 |
#define | IOP_O_TRUNC 0x0400 |
#define | IOP_O_EXCL 0x0800 |
#define | IOP_O_NOWAIT 0x8000 |
#define | ct_assert(e) {enum { ct_assert_value = 1/(!!(e)) };} |
Functions | |
void * | ps2_sbrk (size_t increment) |
int | fioRename (const char *old, const char *new) |
int | fioMkdirHelper (const char *path, int mode) |
static time_t | io_to_posix_time (const unsigned char *ps2time) |
static mode_t | io_to_posix_mode (unsigned int ps2mode) |
static void | fill_stat (struct stat *stat, const io_stat_t *fiostat) |
static int | fioGetstatHelper (const char *path, struct stat *buf) |
static DIR * | fioOpendirHelper (const char *path) |
static struct dirent * | fioReaddirHelper (DIR *dir) |
static void | fioRewinddirHelper (DIR *dir) |
static int | fioClosedirHelper (DIR *dir) |
void | compile_time_check () |
static char * | normalize_path (const char *path_name) |
static int | isCdromPath (const char *path) |
int | _open (const char *buf, int flags,...) |
int | _close (int fd) |
int | _read (int fd, void *buf, size_t nbytes) |
int | _write (int fd, const void *buf, size_t nbytes) |
int | _fstat (int fd, struct stat *buf) |
int | _stat (const char *path, struct stat *buf) |
int | access (const char *fn, int flags) |
DIR * | opendir (const char *path) |
struct dirent * | readdir (DIR *dir) |
void | rewinddir (DIR *dir) |
int | closedir (DIR *dir) |
int | _isatty (int fd) |
off_t | _lseek (int fd, off_t offset, int whence) |
off64_t | lseek64 (int fd, off64_t offset, int whence) |
int | chdir (const char *path) |
int | mkdir (const char *path, mode_t mode) |
int | rmdir (const char *path) |
int | _link (const char *old, const char *new) |
int | _unlink (const char *path) |
char * | getcwd (char *buf, size_t len) |
int | _getpid (void) |
int | _kill (int pid, int sig) |
void * | _sbrk (size_t incr) |
time_t | time (time_t *t) |
int | _gettimeofday (struct timeval *tv, struct timezone *tz) |
clock_t | _times (struct tms *buffer) |
long int | random (void) |
void | srandom (unsigned int seed) |
Variables | |
char | __direct_pwd [256] = "" |
int(* | _ps2sdk_close )(int) = fioClose |
int(* | _ps2sdk_open )(const char *, int,...) = (void *)fioOpen |
int(* | _ps2sdk_read )(int, void *, int) = fioRead |
int(* | _ps2sdk_lseek )(int, int, int) = fioLseek |
int64_t(* | _ps2sdk_lseek64 )(int, int64_t, int) = NULL |
int(* | _ps2sdk_write )(int, const void *, int) = fioWrite |
int(* | _ps2sdk_ioctl )(int, int, void *) = fioIoctl |
int(* | _ps2sdk_remove )(const char *) = fioRemove |
int(* | _ps2sdk_rename )(const char *, const char *) = fioRename |
int(* | _ps2sdk_mkdir )(const char *, int) = fioMkdirHelper |
int(* | _ps2sdk_rmdir )(const char *) = fioRmdir |
int(* | _ps2sdk_stat )(const char *path, struct stat *buf) = fioGetstatHelper |
DIR *(* | _ps2sdk_opendir )(const char *path) = fioOpendirHelper |
struct dirent *(* | _ps2sdk_readdir )(DIR *dir) = fioReaddirHelper |
void(* | _ps2sdk_rewinddir )(DIR *dir) = fioRewinddirHelper |
int(* | _ps2sdk_closedir )(DIR *dir) = fioClosedirHelper |
#define ct_assert | ( | e | ) | {enum { ct_assert_value = 1/(!!(e)) };} |
Definition at line 211 of file ps2sdkapi.c.
#define IOP_O_APPEND 0x0100 |
Definition at line 195 of file ps2sdkapi.c.
#define IOP_O_CREAT 0x0200 |
Definition at line 196 of file ps2sdkapi.c.
#define IOP_O_DIROPEN 0x0008 |
Definition at line 193 of file ps2sdkapi.c.
#define IOP_O_EXCL 0x0800 |
Definition at line 198 of file ps2sdkapi.c.
#define IOP_O_NBLOCK 0x0010 |
Definition at line 194 of file ps2sdkapi.c.
#define IOP_O_NOWAIT 0x8000 |
Definition at line 199 of file ps2sdkapi.c.
#define IOP_O_RDONLY 0x0001 |
Definition at line 190 of file ps2sdkapi.c.
#define IOP_O_RDWR 0x0003 |
Definition at line 192 of file ps2sdkapi.c.
#define IOP_O_TRUNC 0x0400 |
Definition at line 197 of file ps2sdkapi.c.
#define IOP_O_WRONLY 0x0002 |
Definition at line 191 of file ps2sdkapi.c.
#define NEWLIB_PORT_AWARE |
Definition at line 34 of file ps2sdkapi.c.
int _close | ( | int | fd | ) |
int _fstat | ( | int | fd, |
struct stat * | buf | ||
) |
int _getpid | ( | void | ) |
Definition at line 487 of file ps2sdkapi.c.
References GetThreadId().
int _gettimeofday | ( | struct timeval * | tv, |
struct timezone * | tz | ||
) |
int _isatty | ( | int | fd | ) |
int _kill | ( | int | pid, |
int | sig | ||
) |
Definition at line 491 of file ps2sdkapi.c.
References ExitDeleteThread().
int _link | ( | const char * | old, |
const char * | new | ||
) |
off_t _lseek | ( | int | fd, |
off_t | offset, | ||
int | whence | ||
) |
int _open | ( | const char * | buf, |
int | flags, | ||
... | |||
) |
Definition at line 301 of file ps2sdkapi.c.
References __direct_pwd, _ps2sdk_open, IOP_O_APPEND, IOP_O_CREAT, IOP_O_EXCL, IOP_O_NBLOCK, IOP_O_RDONLY, IOP_O_RDWR, IOP_O_TRUNC, IOP_O_WRONLY, isCdromPath(), normalize_path(), and O_NONBLOCK.
int _read | ( | int | fd, |
void * | buf, | ||
size_t | nbytes | ||
) |
void* _sbrk | ( | size_t | incr | ) |
int _stat | ( | const char * | path, |
struct stat * | buf | ||
) |
clock_t _times | ( | struct tms * | buffer | ) |
Definition at line 544 of file ps2sdkapi.c.
References buffer, NULL, ps2_clock(), and PS2_CLOCKS_PER_SEC.
int _unlink | ( | const char * | path | ) |
int _write | ( | int | fd, |
const void * | buf, | ||
size_t | nbytes | ||
) |
int access | ( | const char * | fn, |
int | flags | ||
) |
int chdir | ( | const char * | path | ) |
Definition at line 461 of file ps2sdkapi.c.
References __direct_pwd.
int closedir | ( | DIR * | dir | ) |
void compile_time_check | ( | ) |
Definition at line 212 of file ps2sdkapi.c.
|
static |
Definition at line 80 of file ps2sdkapi.c.
References io_stat_t::atime, io_stat_t::ctime, io_stat_t::hisize, io_to_posix_mode(), io_to_posix_time(), io_stat_t::mode, io_stat_t::mtime, and io_stat_t::size.
Referenced by fioGetstatHelper(), and fioReaddirHelper().
|
static |
|
static |
Definition at line 97 of file ps2sdkapi.c.
References fill_stat(), and fioGetstat().
int fioMkdirHelper | ( | const char * | path, |
int | mode | ||
) |
|
static |
Definition at line 110 of file ps2sdkapi.c.
References fioDopen(), and NULL.
|
static |
Definition at line 128 of file ps2sdkapi.c.
References fill_stat(), fioDread(), io_dirent_t::name, NULL, and io_dirent_t::stat.
int fioRename | ( | const char * | old, |
const char * | new | ||
) |
Definition at line 48 of file ps2sdkapi.c.
References ENOSYS.
|
static |
Definition at line 152 of file ps2sdkapi.c.
char* getcwd | ( | char * | buf, |
size_t | len | ||
) |
Definition at line 482 of file ps2sdkapi.c.
References __direct_pwd.
|
static |
Definition at line 69 of file ps2sdkapi.c.
References FIO_SO_IFDIR, FIO_SO_IFREG, FIO_SO_IROTH, FIO_SO_IWOTH, and FIO_SO_IXOTH.
Referenced by fill_stat().
|
static |
|
static |
Definition at line 296 of file ps2sdkapi.c.
Referenced by _open().
int mkdir | ( | const char * | path, |
mode_t | mode | ||
) |
Definition at line 466 of file ps2sdkapi.c.
References _ps2sdk_mkdir, and mode.
Referenced by CreateSave().
|
static |
DIR* opendir | ( | const char * | path | ) |
void* ps2_sbrk | ( | size_t | increment | ) |
Definition at line 22 of file sbrk.c.
References _end, and EndOfHeap().
Referenced by _sbrk().
long int random | ( | void | ) |
Definition at line 557 of file ps2sdkapi.c.
struct dirent* readdir | ( | DIR * | dir | ) |
void rewinddir | ( | DIR * | dir | ) |
int rmdir | ( | const char * | path | ) |
void srandom | ( | unsigned int | seed | ) |
Definition at line 562 of file ps2sdkapi.c.
time_t time | ( | time_t * | t | ) |
char __direct_pwd[256] = "" |
Definition at line 45 of file ps2sdkapi.c.
int(* _ps2sdk_close) (int) | ( | int | ) | = fioClose |
Inter-library helpers
Definition at line 171 of file ps2sdkapi.c.
Referenced by _close(), and fileXioInit().
int(* _ps2sdk_closedir) (DIR *dir) | ( | DIR * | dir | ) | = fioClosedirHelper |
Definition at line 188 of file ps2sdkapi.c.
Referenced by closedir(), and fileXioInit().
int(* _ps2sdk_ioctl) (int, int, void *) | ( | int | , |
int | , | ||
void * | |||
) | = fioIoctl |
Definition at line 177 of file ps2sdkapi.c.
Referenced by fileXioInit(), PS2KbdFlushBuffer(), PS2KbdResetKeymap(), PS2KbdSetAltmap(), PS2KbdSetBlockingMode(), PS2KbdSetCtrlmap(), PS2KbdSetKeymap(), PS2KbdSetLeds(), PS2KbdSetReadmode(), PS2KbdSetRepeatRate(), and PS2KbdSetSpecialmap().
int(* _ps2sdk_lseek) (int, int, int) | ( | int | , |
int | , | ||
int | |||
) | = fioLseek |
Definition at line 174 of file ps2sdkapi.c.
Referenced by _lseek(), and fileXioInit().
int64_t(* _ps2sdk_lseek64) (int, int64_t, int) | ( | int | , |
int64_t | , | ||
int | |||
) | = NULL |
Definition at line 175 of file ps2sdkapi.c.
Referenced by fileXioInit(), and lseek64().
int(* _ps2sdk_mkdir) (const char *, int) | ( | const char * | , |
int | |||
) | = fioMkdirHelper |
Definition at line 180 of file ps2sdkapi.c.
Referenced by fileXioInit(), and mkdir().
int(* _ps2sdk_open) (const char *, int,...) | ( | const char * | , |
int | , | ||
... | |||
) | = (void *)fioOpen |
Definition at line 172 of file ps2sdkapi.c.
Referenced by _open(), and fileXioInit().
DIR*(* _ps2sdk_opendir) (const char *path) | ( | const char * | path | ) | = fioOpendirHelper |
Definition at line 185 of file ps2sdkapi.c.
Referenced by fileXioInit(), and opendir().
int(* _ps2sdk_read) (int, void *, int) | ( | int | , |
void * | , | ||
int | |||
) | = fioRead |
Definition at line 173 of file ps2sdkapi.c.
Referenced by _read(), and fileXioInit().
struct dirent*(* _ps2sdk_readdir) (DIR *dir) | ( | DIR * | dir | ) | = fioReaddirHelper |
Definition at line 185 of file ps2sdkapi.c.
Referenced by fileXioInit(), and readdir().
int(* _ps2sdk_remove) (const char *) | ( | const char * | ) | = fioRemove |
Definition at line 178 of file ps2sdkapi.c.
Referenced by _unlink(), and fileXioInit().
int(* _ps2sdk_rename) (const char *, const char *) | ( | const char * | , |
const char * | |||
) | = fioRename |
Definition at line 179 of file ps2sdkapi.c.
Referenced by _link(), and fileXioInit().
void(* _ps2sdk_rewinddir) (DIR *dir) | ( | DIR * | dir | ) | = fioRewinddirHelper |
Definition at line 187 of file ps2sdkapi.c.
Referenced by fileXioInit(), and rewinddir().
int(* _ps2sdk_rmdir) (const char *) | ( | const char * | ) | = fioRmdir |
Definition at line 181 of file ps2sdkapi.c.
Referenced by fileXioInit(), and rmdir().
int(* _ps2sdk_stat) (const char *path, struct stat *buf) | ( | const char * | path, |
struct stat * | buf | ||
) | = fioGetstatHelper |
Definition at line 183 of file ps2sdkapi.c.
Referenced by _stat(), and fileXioInit().
int(* _ps2sdk_write) (int, const void *, int) | ( | int | , |
const void * | , | ||
int | |||
) | = fioWrite |
Definition at line 176 of file ps2sdkapi.c.
Referenced by _write(), and fileXioInit().