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 dd61cefff8c0f772edf78e75a1c100a386a2ff1c..0487d1b844a39bc4ee222d4200669ffcbf0c7c74 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 b7a09c3d5b81f9b6f51e976b12374cfecedd89be..a02784c279827f6972e664fb5ff58f744fc1e3cc 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 cb57c118f2b68df5ea070895c892252f5df13fef..afcac93a766ca3e84f4012ebd401b1049c0025ba 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 eae97ab0d8fbf2dfe65ac256c1c5828e11f2fed5..d6c00c7df590f3afca0cb11f6957c22db0c30e4f 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 99b1b73f9b645543b0470dc151c9be9cc387b116..cb72cffae6afea910ceb8c4005d50f921e558a64 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 dc234b2f63912172dc5ddbb80e2cba917e995daf..e550d2bf0fa77236310d457e014e2f904aa6811c 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 3b180f92e881a09c9d25c4a8339c3f6adb12e677..afbef565a621c2fde00cd1701956b22a889182e6 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 e6e53843c1a56500e2e2037f8a4ade163c3efc23..746dcd93a4222bacbf898acecc8448505b695e04 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 f5f93875f97c1d3ddede3dea4d06c4c971857dca..3ae78509908b65ca4b84a28b0902ca29393e6227 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 a7c1536569f07d68e092abfde3bf2cfdae3308aa..f9e045104eacc166e085bf15e33d58addf7c52a8 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 15c641ca0bb68a72f94f239ce92fea344e882796..816b0b530ec230a34919c02ed85d84ce4effeb02 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 3d4d380d9d3720d1fa6251c36e8179e502aabce3..96a2d60d3fa8d88b224430299cdeb794afc0ba62 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");