00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __PSPRTC_H__
00015 #define __PSPRTC_H__
00016
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020
00021 typedef struct {
00022 u16 year;
00023 u16 month;
00024 u16 day;
00025 u16 hour;
00026 u16 minutes;
00027 u16 seconds;
00028 u32 microseconds;
00029 } pspTime;
00030
00031 enum pspRtcCheckValidErrors {
00032 PSP_TIME_INVALID_YEAR = -1,
00033 PSP_TIME_INVALID_MONTH = -2,
00034 PSP_TIME_INVALID_DAY = -3,
00035 PSP_TIME_INVALID_HOUR = -4,
00036 PSP_TIME_INVALID_MINUTES = -5,
00037 PSP_TIME_INVALID_SECONDS = -6,
00038 PSP_TIME_INVALID_MICROSECONDS = -7
00039 };
00040
00046 u32 sceRtcGetTickResolution();
00047
00054 int sceRtcGetCurrentTick(u64 *tick);
00055
00063 int sceRtcGetCurrentClock(pspTime *time, int tz);
00064
00071 int sceRtcGetCurrentClockLocalTime(pspTime *time);
00072
00080 int sceRtcConvertUtcToLocalTime(const u64* tickUTC, u64* tickLocal);
00081
00089 int sceRtcConvertLocalTimeToUTC(const u64* tickLocal, u64* tickUTC);
00090
00097 int sceRtcIsLeapYear(int year);
00098
00106 int sceRtcGetDaysInMonth(int year, int month);
00107
00116 int sceRtcGetDayOfWeek(int year, int month, int day);
00117
00124 int sceRtcCheckValid(const pspTime* date);
00125
00133 int sceRtcSetTick(pspTime* date, const u64* tick);
00134
00142 int sceRtcGetTick(const pspTime* date, u64 *tick);
00143
00151 int sceRtcCompareTick(const u64* tick1, const u64* tick2);
00152
00161 int sceRtcTickAddTicks(u64* destTick, const u64* srcTick, u64 numTicks);
00162
00171 int sceRtcTickAddMicroseconds(u64* destTick, const u64* srcTick, u64 numMS);
00172
00181 int sceRtcTickAddSeconds(u64* destTick, const u64* srcTick, u64 numSecs);
00182
00191 int sceRtcTickAddMinutes(u64* destTick, const u64* srcTick, u64 numMins);
00192
00201 int sceRtcTickAddHours(u64* destTick, const u64* srcTick, int numHours);
00202
00211 int sceRtcTickAddDays(u64* destTick, const u64* srcTick, int numDays);
00212
00221 int sceRtcTickAddWeeks(u64* destTick, const u64* srcTick, int numWeeks);
00222
00223
00232 int sceRtcTickAddMonths(u64* destTick, const u64* srcTick, int numMonths);
00233
00242 int sceRtcTickAddYears(u64* destTick, const u64* srcTick, int numYears);
00243
00244 int sceRtcSetTime_t(pspTime* date, const time_t time);
00245 int sceRtcGetTime_t(const pspTime* date, time_t *time);
00246 int sceRtcSetDosTime(pspTime* date, u32 dosTime);
00247 int sceRtcGetDosTime(pspTime* date, u32 dosTime);
00248 int sceRtcSetWin32FileTime(pspTime* date, u64* win32Time);
00249 int sceRtcGetWin32FileTime(pspTime* date, u64* win32Time);
00250
00251 int sceRtcParseDateTime(u64 *destTick, const char *dateString);
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261 #ifdef __cplusplus
00262 }
00263 #endif
00264
00265 #endif