ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
ps2sdkapi.h File Reference
#include <dirent.h>
#include <inttypes.h>
#include <sys/stat.h>
+ Include dependency graph for ps2sdkapi.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PS2_CLOCKS_PER_SEC   (147456000 / 256)
 
#define PS2_CLOCKS_PER_MSEC   (PS2_CLOCKS_PER_SEC / 1000)
 

Typedefs

typedef uint64_t ps2_clock_t
 
typedef int64_t off64_t
 

Functions

ps2_clock_t ps2_clock (void)
 
void _ps2sdk_timezone_update ()
 
off64_t lseek64 (int fd, off64_t offset, int whence)
 

Variables

int(* _ps2sdk_close )(int)
 
int(* _ps2sdk_open )(const char *, int,...)
 
int(* _ps2sdk_read )(int, void *, int)
 
int(* _ps2sdk_lseek )(int, int, int)
 
int64_t(* _ps2sdk_lseek64 )(int, int64_t, int)
 
int(* _ps2sdk_write )(int, const void *, int)
 
int(* _ps2sdk_ioctl )(int, int, void *)
 
int(* _ps2sdk_remove )(const char *)
 
int(* _ps2sdk_rename )(const char *, const char *)
 
int(* _ps2sdk_mkdir )(const char *, int)
 
int(* _ps2sdk_rmdir )(const char *)
 
int(* _ps2sdk_stat )(const char *path, struct stat *buf)
 
DIR *(* _ps2sdk_opendir )(const char *path)
 
struct dirent *(* _ps2sdk_readdir )(DIR *dir)
 
void(* _ps2sdk_rewinddir )(DIR *dir)
 
int(* _ps2sdk_closedir )(DIR *dir)
 

Macro Definition Documentation

◆ PS2_CLOCKS_PER_MSEC

#define PS2_CLOCKS_PER_MSEC   (PS2_CLOCKS_PER_SEC / 1000)

Definition at line 39 of file ps2sdkapi.h.

◆ PS2_CLOCKS_PER_SEC

#define PS2_CLOCKS_PER_SEC   (147456000 / 256)

Definition at line 38 of file ps2sdkapi.h.

Typedef Documentation

◆ off64_t

typedef int64_t off64_t

Definition at line 48 of file ps2sdkapi.h.

◆ ps2_clock_t

typedef uint64_t ps2_clock_t

Definition at line 41 of file ps2sdkapi.h.

Function Documentation

◆ _ps2sdk_timezone_update()

void _ps2sdk_timezone_update ( )

Definition at line 26 of file timezone.c.

27 {
28  // Set TZ and call tzset to ensure that timezone information won't get overwritten when tszet is called multiple times
29  setenv("TZ", "", 0);
30  tzset();
31 
32  __tzinfo_type *tz = __gettzinfo();
33 
34  // _timezone is in seconds, while the return value of configGetTimezone is in minutes
35  // Add one hour if configIsDaylightSavingEnabled is 1
36  _timezone = (configGetTimezone() + (configIsDaylightSavingEnabled() * 60)) * 60;
37  tz->__tzrule[0].offset = _timezone;
38  snprintf(_ps2sdk_tzname, sizeof(_ps2sdk_tzname), "Etc/GMT%+ld", _timezone / 3600);
39  _tzname[0] = _ps2sdk_tzname;
40  _tzname[1] = _ps2sdk_tzname;
41 
42  // Don't perform DST conversion
43  _daylight = 0;
44 }
int configGetTimezone(void)
int configIsDaylightSavingEnabled(void)
static char _ps2sdk_tzname[15]
Definition: timezone.c:23

References _ps2sdk_tzname, configGetTimezone(), and configIsDaylightSavingEnabled().

◆ lseek64()

off64_t lseek64 ( int  fd,
off64_t  offset,
int  whence 
)

Definition at line 453 of file ps2sdkapi.c.

454 {
455  if (_ps2sdk_lseek64 == NULL)
456  return EOVERFLOW;
457 
458  return _ps2sdk_lseek64(fd, offset, whence);
459 }
#define EOVERFLOW
Definition: errno.h:257
int64_t(* _ps2sdk_lseek64)(int, int64_t, int)
Definition: ps2sdkapi.c:175
#define NULL
Definition: tamtypes.h:91

References _ps2sdk_lseek64, EOVERFLOW, and NULL.

◆ ps2_clock()

ps2_clock_t ps2_clock ( void  )

Referenced by _times(), and nanosleep().

Variable Documentation

◆ _ps2sdk_close

int(* _ps2sdk_close) (int) ( int  )
extern

Inter-library helpers

Definition at line 171 of file ps2sdkapi.c.

Referenced by _close(), and fileXioInit().

◆ _ps2sdk_closedir

int(* _ps2sdk_closedir) (DIR *dir) ( DIR *  dir)
extern

Definition at line 188 of file ps2sdkapi.c.

Referenced by closedir(), and fileXioInit().

◆ _ps2sdk_ioctl

int(* _ps2sdk_ioctl) (int, int, void *) ( int  ,
int  ,
void *   
)
extern

◆ _ps2sdk_lseek

int(* _ps2sdk_lseek) (int, int, int) ( int  ,
int  ,
int   
)
extern

Definition at line 174 of file ps2sdkapi.c.

Referenced by _lseek(), and fileXioInit().

◆ _ps2sdk_lseek64

int64_t(* _ps2sdk_lseek64) (int, int64_t, int) ( int  ,
int64_t  ,
int   
)
extern

Definition at line 175 of file ps2sdkapi.c.

Referenced by fileXioInit(), and lseek64().

◆ _ps2sdk_mkdir

int(* _ps2sdk_mkdir) (const char *, int) ( const char *  ,
int   
)
extern

Definition at line 180 of file ps2sdkapi.c.

Referenced by fileXioInit(), and mkdir().

◆ _ps2sdk_open

int(* _ps2sdk_open) (const char *, int,...) ( const char *  ,
int  ,
  ... 
)
extern

Definition at line 172 of file ps2sdkapi.c.

Referenced by _open(), and fileXioInit().

◆ _ps2sdk_opendir

DIR*(* _ps2sdk_opendir) (const char *path) ( const char *  path)
extern

Definition at line 185 of file ps2sdkapi.c.

Referenced by fileXioInit(), and opendir().

◆ _ps2sdk_read

int(* _ps2sdk_read) (int, void *, int) ( int  ,
void *  ,
int   
)
extern

Definition at line 173 of file ps2sdkapi.c.

Referenced by _read(), and fileXioInit().

◆ _ps2sdk_readdir

struct dirent*(* _ps2sdk_readdir) (DIR *dir) ( DIR *  dir)
extern

Definition at line 185 of file ps2sdkapi.c.

Referenced by fileXioInit(), and readdir().

◆ _ps2sdk_remove

int(* _ps2sdk_remove) (const char *) ( const char *  )
extern

Definition at line 178 of file ps2sdkapi.c.

Referenced by _unlink(), and fileXioInit().

◆ _ps2sdk_rename

int(* _ps2sdk_rename) (const char *, const char *) ( const char *  ,
const char *   
)
extern

Definition at line 179 of file ps2sdkapi.c.

Referenced by _link(), and fileXioInit().

◆ _ps2sdk_rewinddir

void(* _ps2sdk_rewinddir) (DIR *dir) ( DIR *  dir)
extern

Definition at line 187 of file ps2sdkapi.c.

Referenced by fileXioInit(), and rewinddir().

◆ _ps2sdk_rmdir

int(* _ps2sdk_rmdir) (const char *) ( const char *  )
extern

Definition at line 181 of file ps2sdkapi.c.

Referenced by fileXioInit(), and rmdir().

◆ _ps2sdk_stat

int(* _ps2sdk_stat) (const char *path, struct stat *buf) ( const char *  path,
struct stat *  buf 
)
extern

Definition at line 183 of file ps2sdkapi.c.

Referenced by _stat(), and fileXioInit().

◆ _ps2sdk_write

int(* _ps2sdk_write) (int, const void *, int) ( int  ,
const void *  ,
int   
)
extern

Definition at line 176 of file ps2sdkapi.c.

Referenced by _write(), and fileXioInit().