psis -> psi.d
authorMichael Wallner <mike@php.net>
Thu, 19 Nov 2015 06:59:07 +0000 (07:59 +0100)
committerMichael Wallner <mike@php.net>
Thu, 19 Nov 2015 07:01:15 +0000 (08:01 +0100)
20 files changed:
.gitignore
psi.d/stat.psi [new file with mode: 0644]
psi.d/stdlib.psi [new file with mode: 0644]
psi.d/time.psi [new file with mode: 0644]
psi.d/uname.psi [new file with mode: 0644]
psis/stat.psi [deleted file]
psis/stdlib.psi [deleted file]
psis/time.psi [deleted file]
psis/uname.psi [deleted file]
src/module.c
tests/idn/idn001.phpt
tests/idn/idn002.phpt
tests/idn/idn003.phpt
tests/idn/idn004.phpt
tests/stat/stat001.phpt
tests/time/time001.phpt
tests/time/time002.phpt
tests/time/time003.phpt
tests/time/time004.phpt
tests/uname/uname001.phpt

index dd61cef..0487d1b 100644 (file)
@@ -50,3 +50,6 @@ tests/*/*.sh
 /libffi.h
 /libjit.j
 /tests/*/*.mem
+/config.cache
+*~
+*.swp
diff --git a/psi.d/stat.psi b/psi.d/stat.psi
new file mode 100644 (file)
index 0000000..e5d8eba
--- /dev/null
@@ -0,0 +1,48 @@
+extern int stat(char *path, struct stat *buf);
+function psi\stat(string $path, array &$buf = NULL) : int {
+       let path = strval($path);
+       let buf = calloc(1, struct stat);
+       return to_int(stat);
+       set $buf = to_array(*buf,
+               to_int(st_dev),
+               to_int(st_ino),
+               to_int(st_mode),
+               to_int(st_nlink),
+               to_int(st_uid),
+               to_int(st_gid),
+               to_int(st_rdev),
+               to_int(st_size),
+               to_array(st_atim,
+                       to_int(tv_sec),
+                       to_int(tv_nsec)
+               ), 
+               to_array(st_atimespec,
+                       to_int(tv_sec),
+                       to_int(tv_nsec)
+               ),
+               to_array(st_mtim,
+                       to_int(tv_sec),
+                       to_int(tv_nsec)
+               ), 
+               to_array(st_mtimespec,
+                       to_int(tv_sec),
+                       to_int(tv_nsec)
+               ),
+               to_array(st_ctim,
+                       to_int(tv_sec),
+                       to_int(tv_nsec)
+               ), 
+               to_array(st_ctimespec,
+                       to_int(tv_sec),
+                       to_int(tv_nsec)
+               ),
+               to_array(st_birthtimespec,
+                       to_int(tv_sec),
+                       to_int(tv_nsec)
+               ),
+               to_int(st_blksize),
+               to_int(st_blocks),
+               to_int(st_flags),
+               to_int(st_gen)
+       );
+}
diff --git a/psi.d/stdlib.psi b/psi.d/stdlib.psi
new file mode 100644 (file)
index 0000000..6044d41
--- /dev/null
@@ -0,0 +1,2 @@
+
+extern void free(void *ptr);
diff --git a/psi.d/time.psi b/psi.d/time.psi
new file mode 100644 (file)
index 0000000..1281c51
--- /dev/null
@@ -0,0 +1,87 @@
+extern time_t time(time_t *t);
+function psi\time() : int {
+       let t = NULL;
+       return to_int(time);
+}
+
+extern int gettimeofday(struct timeval *tv, struct timezone *tz);
+function psi\gettimeofday(array &$tv = NULL, array &$tz = NULL) : int {
+       let tv = calloc(1, struct timeval);
+       let tz = calloc(1, struct timezone);
+       return to_int(gettimeofday);
+       set $tv = to_array(*tv, 
+               to_int(tv_sec), 
+               to_int(tv_usec));
+       set $tz = to_array(*tz, 
+               to_int(tz_minuteswest), 
+               to_int(tz_dsttime));
+}
+
+extern char *asctime(struct tm *tm);
+function psi\asctime(array $tm = NULL) : string {
+       let tm = arrval($tm);
+       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);
+function psi\gmtime(int $ts) : array {
+       let tp = &intval($ts);
+       return to_array(*gmtime,
+               to_int(tm_sec),
+               to_int(tm_min),
+               to_int(tm_hour),
+               to_int(tm_mday),
+               to_int(tm_mon),
+               to_int(tm_year),
+               to_int(tm_wday),
+               to_int(tm_yday),
+               to_int(tm_isdst)
+       );
+}
+
+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,
+               to_int(tm_sec),
+               to_int(tm_min),
+               to_int(tm_hour),
+               to_int(tm_mday),
+               to_int(tm_mon),
+               to_int(tm_year),
+               to_int(tm_wday),
+               to_int(tm_yday),
+               to_int(tm_isdst)
+       );
+}
+
+extern int nanosleep(struct timespec *rqtp, struct timespec *rmtp);
+function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int {
+       let rqtp = arrval($rq);
+       let rmtp = calloc(1, struct timespec);
+       return to_int(nanosleep);
+       set $rm = to_array(*rmtp,
+               to_int(tv_sec),
+               to_int(tv_nsec)
+       );
+}
+
+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,
+               to_int(tms_utime),
+               to_int(tms_stime),
+               to_int(tms_cutime),
+               to_int(tms_cstime)
+       );
+}
diff --git a/psi.d/uname.psi b/psi.d/uname.psi
new file mode 100644 (file)
index 0000000..25abfcb
--- /dev/null
@@ -0,0 +1,12 @@
+extern int uname(struct utsname *u);
+function psi\uname(array &$u = NULL) : int {
+       let u = calloc(1, struct utsname);
+       return to_int(uname);
+       set $u = to_array(*u,
+               to_string(sysname),
+               to_string(nodename),
+               to_string(release),
+               to_string(version), 
+               to_string(machine),
+               to_string(domainname));
+}
\ No newline at end of file
diff --git a/psis/stat.psi b/psis/stat.psi
deleted file mode 100644 (file)
index e5d8eba..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-extern int stat(char *path, struct stat *buf);
-function psi\stat(string $path, array &$buf = NULL) : int {
-       let path = strval($path);
-       let buf = calloc(1, struct stat);
-       return to_int(stat);
-       set $buf = to_array(*buf,
-               to_int(st_dev),
-               to_int(st_ino),
-               to_int(st_mode),
-               to_int(st_nlink),
-               to_int(st_uid),
-               to_int(st_gid),
-               to_int(st_rdev),
-               to_int(st_size),
-               to_array(st_atim,
-                       to_int(tv_sec),
-                       to_int(tv_nsec)
-               ), 
-               to_array(st_atimespec,
-                       to_int(tv_sec),
-                       to_int(tv_nsec)
-               ),
-               to_array(st_mtim,
-                       to_int(tv_sec),
-                       to_int(tv_nsec)
-               ), 
-               to_array(st_mtimespec,
-                       to_int(tv_sec),
-                       to_int(tv_nsec)
-               ),
-               to_array(st_ctim,
-                       to_int(tv_sec),
-                       to_int(tv_nsec)
-               ), 
-               to_array(st_ctimespec,
-                       to_int(tv_sec),
-                       to_int(tv_nsec)
-               ),
-               to_array(st_birthtimespec,
-                       to_int(tv_sec),
-                       to_int(tv_nsec)
-               ),
-               to_int(st_blksize),
-               to_int(st_blocks),
-               to_int(st_flags),
-               to_int(st_gen)
-       );
-}
diff --git a/psis/stdlib.psi b/psis/stdlib.psi
deleted file mode 100644 (file)
index 6044d41..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-extern void free(void *ptr);
diff --git a/psis/time.psi b/psis/time.psi
deleted file mode 100644 (file)
index 1281c51..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-extern time_t time(time_t *t);
-function psi\time() : int {
-       let t = NULL;
-       return to_int(time);
-}
-
-extern int gettimeofday(struct timeval *tv, struct timezone *tz);
-function psi\gettimeofday(array &$tv = NULL, array &$tz = NULL) : int {
-       let tv = calloc(1, struct timeval);
-       let tz = calloc(1, struct timezone);
-       return to_int(gettimeofday);
-       set $tv = to_array(*tv, 
-               to_int(tv_sec), 
-               to_int(tv_usec));
-       set $tz = to_array(*tz, 
-               to_int(tz_minuteswest), 
-               to_int(tz_dsttime));
-}
-
-extern char *asctime(struct tm *tm);
-function psi\asctime(array $tm = NULL) : string {
-       let tm = arrval($tm);
-       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);
-function psi\gmtime(int $ts) : array {
-       let tp = &intval($ts);
-       return to_array(*gmtime,
-               to_int(tm_sec),
-               to_int(tm_min),
-               to_int(tm_hour),
-               to_int(tm_mday),
-               to_int(tm_mon),
-               to_int(tm_year),
-               to_int(tm_wday),
-               to_int(tm_yday),
-               to_int(tm_isdst)
-       );
-}
-
-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,
-               to_int(tm_sec),
-               to_int(tm_min),
-               to_int(tm_hour),
-               to_int(tm_mday),
-               to_int(tm_mon),
-               to_int(tm_year),
-               to_int(tm_wday),
-               to_int(tm_yday),
-               to_int(tm_isdst)
-       );
-}
-
-extern int nanosleep(struct timespec *rqtp, struct timespec *rmtp);
-function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int {
-       let rqtp = arrval($rq);
-       let rmtp = calloc(1, struct timespec);
-       return to_int(nanosleep);
-       set $rm = to_array(*rmtp,
-               to_int(tv_sec),
-               to_int(tv_nsec)
-       );
-}
-
-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,
-               to_int(tms_utime),
-               to_int(tms_stime),
-               to_int(tms_cutime),
-               to_int(tms_cstime)
-       );
-}
diff --git a/psis/uname.psi b/psis/uname.psi
deleted file mode 100644 (file)
index 25abfcb..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-extern int uname(struct utsname *u);
-function psi\uname(array &$u = NULL) : int {
-       let u = calloc(1, struct utsname);
-       return to_int(uname);
-       set $u = to_array(*u,
-               to_string(sysname),
-               to_string(nodename),
-               to_string(release),
-               to_string(version), 
-               to_string(machine),
-               to_string(domainname));
-}
\ No newline at end of file
index b7a09c3..a02784c 100644 (file)
@@ -17,7 +17,7 @@ ZEND_DECLARE_MODULE_GLOBALS(psi);
 
 PHP_INI_BEGIN()
        STD_PHP_INI_ENTRY("psi.engine", "ffi", PHP_INI_SYSTEM, OnUpdateString, engine, zend_psi_globals, psi_globals)
-       STD_PHP_INI_ENTRY("psi.directory", "psis", PHP_INI_SYSTEM, OnUpdateString, directory, zend_psi_globals, psi_globals)
+       STD_PHP_INI_ENTRY("psi.directory", "psi.d", PHP_INI_SYSTEM, OnUpdateString, directory, zend_psi_globals, psi_globals)
 PHP_INI_END();
 
 void psi_error(int type, const char *msg, ...)
index cb57c11..afcac93 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 libidn
 --INI--
-psi.directory={PWD}/../../psis:{PWD}
+psi.directory={PWD}/../../psi.d:{PWD}
 --SKIPIF--
 <?php
 extension_loaded("psi") or die("skip - need ext/psi");
index eae97ab..d6c00c7 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 libidn
 --INI--
-psi.directory={PWD}/../../psis:{PWD}
+psi.directory={PWD}/../../psi.d:{PWD}
 --SKIPIF--
 <?php
 extension_loaded("psi") or die("skip - need ext/psi");
index 99b1b73..cb72cff 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 libidn
 --INI--
-psi.directory={PWD}/../../psis:{PWD}
+psi.directory={PWD}/../../psi.d:{PWD}
 --SKIPIF--
 <?php
 extension_loaded("psi") or die("skip - need ext/psi");
index dc234b2..e550d2b 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 libidn
 --INI--
-psi.directory={PWD}/../../psis:{PWD}
+psi.directory={PWD}/../../psi.d:{PWD}
 --SKIPIF--
 <?php
 extension_loaded("psi") or die("skip - need ext/psi");
index 3b180f9..afbef56 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 stat
 --INI--
-psi.directory={PWD}/../../psis:{PWD}
+psi.directory={PWD}/../../psi.d:{PWD}
 --SKIPIF--
 <?php 
 extension_loaded("psi") or die("skip - need ext/psi");
index e6e5384..746dcd9 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 gettimeofday
 --INI--
-psi.directory = {PWD}/../../psis:{PWD}
+psi.directory = {PWD}/../../psi.d:{PWD}
 --SKIPIF--
 <?php
 extension_loaded("psi") or die("skip - need ext/psi");
index f5f9387..3ae7850 100644 (file)
@@ -7,7 +7,7 @@ extension_loaded("psi") or die("skip - need ext/psi");
 --ENV--
 TZ=UTC
 --INI--
-psi.directory = {PWD}/../../psis:{PWD}
+psi.directory = {PWD}/../../psi.d:{PWD}
 --FILE--
 ===TEST===
 <?php
index a7c1536..f9e0451 100644 (file)
@@ -7,7 +7,7 @@ extension_loaded("psi") or die("skip - need ext/psi");
 --ENV--
 TZ=UTC
 --INI--
-psi.directory = {PWD}/../../psis:{PWD}
+psi.directory = {PWD}/../../psi.d:{PWD}
 --FILE--
 ===TEST===
 <?php
index 15c641c..816b0b5 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 times
 --INI--
-psi.directory={PWD}/../../psis:{PWD}
+psi.directory={PWD}/../../psi.d:{PWD}
 --SKIPIF--
 <?php
 extension_loaded("psi") or die("skip - need ext/psi");
index 3d4d380..96a2d60 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 uname
 --INI--
-psi.directory={PWD}/../../psis:{PWD}
+psi.directory={PWD}/../../psi.d:{PWD}
 --SKIPIF--
 <?php
 extension_loaded("psi") or die("skip - need ext/psi");