projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
compat: PHP-7.2
[m6w6/ext-psi]
/
README.md
diff --git
a/README.md
b/README.md
index 164a7982ad3f927e934a21b2ce5810b74c6c6bff..c859031c3abc162c31fc214e873d870ecc1b0c5e 100644
(file)
--- a/
README.md
+++ b/
README.md
@@
-1,5
+1,6
@@
# ext-psi
# ext-psi
+[![Join the chat at https://gitter.im/m6w6/ext-psi](https://badges.gitter.im/m6w6/ext-psi.svg)](https://gitter.im/m6w6/ext-psi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/m6w6/ext-psi.svg?branch=master)](https://travis-ci.org/m6w6/ext-psi)
PSI is a PHP extension, which provides a foreign function interface through
[![Build Status](https://travis-ci.org/m6w6/ext-psi.svg?branch=master)](https://travis-ci.org/m6w6/ext-psi)
PSI is a PHP extension, which provides a foreign function interface through
@@
-12,6
+13,9
@@
The acronym PSI may be read as:
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/).
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.
+
## Features
* standard scalar types mapped to stdint types
## Features
* standard scalar types mapped to stdint types
@@
-22,6
+26,9
@@
The latter because PSI can be configured to include declarations for most of the
## Installing
## Installing
+> **WARNING:**
+> This is heavy WIP. Installation only works from a source checkout yet.
+
### PECL
This extension is distributed through [PECL](http://pecl.php.net) and can be
### PECL
This extension is distributed through [PECL](http://pecl.php.net) and can be
@@
-102,6
+109,11
@@
The following modules are available to select:
### --with-psi-libjit
**Path to libjit.**
### --with-psi-libjit
**Path to libjit.**
+> **WARNING:**
+> We currently rely on a patched libjit, because of an apparent bug in how
+> libjit creates closures, which still needs to be verified, though.
+> See https://github.com/m6w6/libjit for the preliminary patch.
+
### --with-psi-libffi
**Path to libffi.**
### --with-psi-libffi
**Path to libffi.**
@@
-121,7
+133,6
@@
A colon separated list of directories to scan for `*.psi` files. Defaults to "ps
* C style multi line comments
* C++ style single line comments
* C style multi line comments
* C++ style single line comments
-* CPP directives are ignored, so the hash sign basically works as single line comment
```c
// this is a one line comment
```c
// this is a one line comment
@@
-129,7
+140,6
@@
A colon separated list of directories to scan for `*.psi` files. Defaults to "ps
by a multi
line comment
*/
by a multi
line comment
*/
-# this looks like a pre-processor directive and is ignored
```
### Typedefs
```
### Typedefs
@@
-214,7
+224,7
@@
extern char *strerror(int errnum);
You may specify a non-standard calling convention in place of `extern`, where `default` and `cdecl` have the same meaning as `extern`.
You may specify a non-standard calling convention in place of `extern`, where `default` and `cdecl` have the same meaning as `extern`.
-Additionally recognized calling conventions include: `
mscdecl`, `
stdcall` and `fastcall`.
+Additionally recognized calling conventions include: `stdcall` and `fastcall`.
### Constants
### Constants
@@
-241,10
+251,10
@@
Each implementation refers to exactly one declared foreign function referenced i
## Complete example
```c
## Complete example
```c
-
#
all declarations in this file should be looked up in libidn
+
//
all declarations in this file should be looked up in libidn
lib "idn";
lib "idn";
-
#
IDNA errors
+
//
IDNA errors
const int \IDNA_SUCCESS = 0;
const int \IDNA_STRINGPREP_ERROR = 1;
const int \IDNA_PUNYCODE_ERROR = 2;
const int \IDNA_SUCCESS = 0;
const int \IDNA_STRINGPREP_ERROR = 1;
const int \IDNA_PUNYCODE_ERROR = 2;
@@
-258,45
+268,45
@@
const int \IDNA_CONTAINS_ACE_PREFIX = 8;
const int \IDNA_ICONV_ERROR = 9;
const int \IDNA_MALLOC_ERROR = 201;
const int \IDNA_DLOPEN_ERROR = 202;
const int \IDNA_ICONV_ERROR = 9;
const int \IDNA_MALLOC_ERROR = 201;
const int \IDNA_DLOPEN_ERROR = 202;
-
#
IDNA flags
+
//
IDNA flags
const int \IDNA_ALLOW_UNASSIGNED = 1;
const int \IDNA_USE_STD3_ASCII_RULES = 2;
const int \IDNA_ALLOW_UNASSIGNED = 1;
const int \IDNA_USE_STD3_ASCII_RULES = 2;
-
#
nothing special about the declaration here
+
//
nothing special about the declaration here
default int idna_to_ascii_8z(char *host, char **buffer, int flags);
function idn\utf8_to_ascii(string $host, string &$result, int $flags = 0) : int {
default int idna_to_ascii_8z(char *host, char **buffer, int flags);
function idn\utf8_to_ascii(string $host, string &$result, int $flags = 0) : int {
-
#
there must be a `let` statement for each
-
#
declared argument of the called function
+
//
there must be a `let` statement for each
+
//
declared argument of the called function
-
#
setup a pointer to NULL
+
//
setup a pointer to NULL
let buffer = &NULL;
let buffer = &NULL;
-
#
setup a string pointer to $host
+
//
setup a string pointer to $host
let host = strval($host);
let host = strval($host);
-
#
assing the integer value of $flags
+
//
assing the integer value of $flags
let flags = intval($flags);
let flags = intval($flags);
-
#
the function to call is referenced in
-
#
the return statement, along with the
-
#
neccessary cast how to interpred the
-
#
returned native value
+
//
the function to call is referenced in
+
//
the return statement, along with the
+
//
neccessary cast how to interpred the
+
//
returned native value
return to_int(idna_to_ascii_8z);
return to_int(idna_to_ascii_8z);
-
#
by-ref vars might receive output values
-
#
through `set` statments, which also
-
#
require a cast how to marshal the
-
#
native data as PHP value
+
//
by-ref vars might receive output values
+
//
through `set` statments, which also
+
//
require a cast how to marshal the
+
//
native data as PHP value
set $result = to_string(*buffer);
set $result = to_string(*buffer);
-
#
after the buffer has been marshaled
-
#
for the PHP engine, we have to free
-
#
the buffer to avoid a memory leak
+
//
after the buffer has been marshaled
+
//
for the PHP engine, we have to free
+
//
the buffer to avoid a memory leak
free free(*buffer);
free free(*buffer);
-
#
note that in this example we omit the
-
#
declaration of the free() function called
-
#
in our `free` statement for brevity
+
//
note that in this example we omit the
+
//
declaration of the free() function called
+
//
in our `free` statement for brevity
}
default char *idna_strerror(int rc);
}
default char *idna_strerror(int rc);