From: Michael Wallner Date: Tue, 17 Apr 2018 05:07:35 +0000 (+0200) Subject: update README and package.xml X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=fe451dea5c2e622db1e8610f742752a73a21b865;p=m6w6%2Fext-psi update README and package.xml --- diff --git a/README.md b/README.md index c859031..a3dfa91 100644 --- a/README.md +++ b/README.md @@ -8,26 +8,21 @@ PSI is a PHP extension, which provides a foreign function interface through The acronym PSI may be read as: * PHP System Interface -* POSIX Standard Interface - -The latter because PSI can be configured to include declarations for most of the -[base definitions and system interfaces of POSIX.1-2008](http://pubs.opengroup.org/onlinepubs/9699919799/). > **WARNING:** -> This is heavy WIP. Only a small part of configuration and implementation has been completed yet. +> This is heavy WIP. ## Features -* standard scalar types mapped to stdint types * structs, unions, enums and typedefs -* simple numeric expressions -* string and int constants +* numeric and boolean expressions +* scalar constants * vararg calls ## Installing > **WARNING:** -> This is heavy WIP. Installation only works from a source checkout yet. +> This is heavy WIP. Installation only works from a source checkout with php-src@master yet. ### PECL @@ -66,46 +61,6 @@ PSI supports the following configure switches: This is only relevant for an in-tree build. Use `--enable-psi` to include the PSI extension in the build. -### --enable-psi-posix -**Pre-define POSIX decls.** - -Use `--enable-psi-posix=all` to enable all available POSIX checks. - -Use `--enable-psi-posix=section,another,onemore` to enable specific modules only. - -The following modules are included by default: - -[stdint](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html), -[stddef](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html), -[stdlib](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdlib.h.html), -[sys/types](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html) - -The following modules are available to select: - -[errno](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html), -[fcntl](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html), -[glob](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/glob.h.html), -[locale](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html), -[ndbm](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ndbm.h.html), -[netdb](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netdb.h.html), -[netinet/in](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html), -[netinet/tcp](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_tcp.h.html), -[poll](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/poll.h.html), -[signal](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html), -[stdio](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdio.h.html), -[sys/select](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_select.h.html), -[sys/socket](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html), -[sys/stat](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html), -[sys/time](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html), -[sys/times](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_times.h.html), -[sys/uio](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_uio.h.html), -[sys/utsname](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_utsname.h.html), -[syslog](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/syslog.h.html), -[time](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html), -[unistd](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html), -[wchar](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wchar.h.html), -[wctype](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wctype.h.html), - ### --with-psi-libjit **Path to libjit.** @@ -127,8 +82,25 @@ The backend that PSI should use as FFI, either _jit_ for `libjit` or _ffi_ for ` A colon separated list of directories to scan for `*.psi` files. Defaults to "psi.d". +### psi.blacklist.decls + +A comma separated list of C function declarations to ignore. + +### psi.blacklist.vars + +A comma separated list of C variable declarations do ignore. + ## PSI files +### CPP + +* conditional parsing +* including headers + +```c +#include +``` + ### Comments * C style multi line comments @@ -212,7 +184,7 @@ lib "awesome"; ``` These statements define what library should be `dlopen()`-ed to look up symbols from declarations. -They must only occur once in a file. When a `lib` statement is omitted, stdlib is assumed. +When a `lib` statement is omitted, stdlib is assumed. ### Declarations diff --git a/package.xml b/package.xml index d5d9220..8d760a4 100644 --- a/package.xml +++ b/package.xml @@ -7,12 +7,7 @@ PSI is a PHP extension, which provides a foreign function interface through libffi and/or libjit. The acronym PSI may be read as: - PHP System Interface - POSIX Standard Interface - -The latter because PSI can be configured to include declarations for most of the base definitions -and system interfaces of POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699919799/). ]]> Michael Wallner @@ -46,9 +41,48 @@ and system interfaces of POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -59,22 +93,24 @@ and system interfaces of POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699 + + - - - + + + @@ -82,16 +118,20 @@ and system interfaces of POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699 + - + + + + @@ -113,18 +153,22 @@ and system interfaces of POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699 + - + + + + @@ -147,6 +191,7 @@ and system interfaces of POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699 + @@ -192,13 +237,14 @@ and system interfaces of POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699 + - + @@ -207,6 +253,7 @@ and system interfaces of POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699 + @@ -244,7 +291,7 @@ and system interfaces of POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699 - 7.0.0-dev + 7.3.0-dev 1.4.1 diff --git a/scripts/gen_package_xml.php b/scripts/gen_package_xml.php old mode 100644 new mode 100755 index d2bc1d2..f608f03 --- a/scripts/gen_package_xml.php +++ b/scripts/gen_package_xml.php @@ -29,23 +29,49 @@ function add($dir, $mask, $role, $node, $indent = " ") { $doc = new DOMDocument; $doc->load(__DIR__."/../package.xml"); +$m4 = $doc->createElement("dir"); +$m4->setAttribute("name", "m4"); +$m4->appendChild($doc->createTextNode("\n")); +add(__DIR__."/../m4", "*.*", "src", $m4); +$m4->appendChild($doc->createTextNode(" ")); + $src = $doc->createElement("dir"); $src->setAttribute("name", "src"); $src->appendChild($doc->createTextNode("\n")); add(__DIR__."/../src", "*.{c,h,y,re,inc}", "src", $src); $src->appendChild($doc->createTextNode(" ")); +$scripts = $doc->createElement("dir"); +$scripts->setAttribute("name", "scripts"); +$scripts->appendChild($doc->createTextNode("\n")); +add(__DIR__."/../scripts", "*.*", "src", $scripts); +$scripts->appendChild($doc->createTextNode(" ")); + +$psid = $doc->createElement("dir"); +$psid->setAttribute("name", "psi.d"); +$psid->appendChild($doc->createTextNode("\n")); +add(__DIR__."/../psi.d", "*", "src", $psid); +$psid->appendChild($doc->createTextNode(" ")); + $tests = $doc->createElement("dir"); $tests->setAttribute("name", "tests"); $tests->appendChild($doc->createTextNode("\n")); add(__DIR__."/../tests", "*.{phpt,inc,psi}", "test", $tests); $tests->appendChild($doc->createTextNode(" ")); + $xpath = new DOMXpath($doc); $xpath->registerNamespace("p", "http://pear.php.net/dtd/package-2.0"); $root = $xpath->query("/p:package/p:contents/p:dir[@name='/']")->item(0); + +$root->replaceChild($m4, + $xpath->query("/p:package/p:contents/p:dir[@name='/']/p:dir[@name='m4']")->item(0)); +$root->replaceChild($psid, + $xpath->query("/p:package/p:contents/p:dir[@name='/']/p:dir[@name='psi.d']")->item(0)); $root->replaceChild($src, $xpath->query("/p:package/p:contents/p:dir[@name='/']/p:dir[@name='src']")->item(0)); +$root->replaceChild($scripts, + $xpath->query("/p:package/p:contents/p:dir[@name='/']/p:dir[@name='scripts']")->item(0)); $root->replaceChild($tests, $xpath->query("/p:package/p:contents/p:dir[@name='/']/p:dir[@name='tests']")->item(0));