projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
flush
[m6w6/ext-psi]
/
tests
/
time
/
time.psi
diff --git
a/tests/time/time.psi
b/tests/time/time.psi
index 5b02dc4a5afa80f3eaf42c7c25e2c939b3cf51f2..514d2b3b9a0b17d6eee09fffe064cba9dfc1f828 100644
(file)
--- a/
tests/time/time.psi
+++ b/
tests/time/time.psi
@@
-13,13
+13,26
@@
function psi\asctime(array $tm = NULL) : string {
return to_string(asctime);
}
return to_string(asctime);
}
+extern char *asctime_r(struct tm *tm, char *buf);
+function psi\asctime_r(array $tm = NULL) : string {
+ let tm = arrval($tm);
+ let buf = calloc(32, char);
+ return to_string(asctime_r);
+}
-extern struct tm *gmtime(time_t tp);
+extern struct tm *gmtime(time_t
*
tp);
function psi\gmtime(int $ts) : array {
let tp = &intval($ts);
return to_array(gmtime);
}
function psi\gmtime(int $ts) : array {
let tp = &intval($ts);
return to_array(gmtime);
}
+extern struct tm *gmtime_r(time_t *tp, struct tm *buf);
+function psi\gmtime_r(int $ts) : array {
+ let tp = &intval($ts);
+ let buf = calloc(1, struct tm);
+ return to_array(gmtime_r);
+}
+
extern int nanosleep(struct timespec *rqtp, struct timespec *rmtp);
function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int {
let rqtp = arrval($rq);
extern int nanosleep(struct timespec *rqtp, struct timespec *rmtp);
function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int {
let rqtp = arrval($rq);
@@
-27,3
+40,10
@@
function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int {
return to_int(nanosleep);
set $rm = to_array(*rmtp);
}
return to_int(nanosleep);
set $rm = to_array(*rmtp);
}
+
+extern clock_t times(struct tms *buf);
+function psi\times(array &$tms = NULL) : int {
+ let buf = calloc(1, struct tms);
+ return to_int(times);
+ set $tms = to_array(*buf);
+}