hi Michael,

it's pitty, I didn't found this extension before.
thanks for pointing, I'll definetly take a look.

I, also, like the idea of preloading ffi definitions on startup, but I would 
prefer to allow preloading any php files. Especially for FFI, PHP wrappers 
would able to hide dangerous implementation details.

Thanks. Dmitry.

On Apr 17, 2018 8:50 AM, Michael Wallner <m...@php.net> wrote:
Hi!

Nice that FFI is of interest again, so may I kindly point you to ext-psi?
https://github.com/m6w6/ext-psi


It follows a different approach, though, that it requires definition
files on startup, not at runtime.

Basically:

$ cat >time.psi <<EOF
#include <time.h>
/* time_t time(time_t *tloc); man 2 time */
function psi\time() : int {
        let tloc = NULL;
        return time(tloc) as to_int(time);
}
EOF


$ ./sapi/cli/php -d psi.directory=. -r 'var_dump(psi\time());'

It stalled the last months because I have been fighting health issues
since last summer, but I did post a link to internals about a year ago:
https://externals.io/message/98212#98259

--
Regards,
Mike


Hi!

Nice that FFI is of interest again, so may I kindly point you to ext-psi?
https://github.com/m6w6/ext-psi


It follows a different approach, though, that it requires definition
files on startup, not at runtime.

Basically:

$ cat >time.psi <<EOF
#include <time.h>
/* time_t time(time_t *tloc); man 2 time */
function psi\time() : int {
        let tloc = NULL;
        return time(tloc) as to_int(time);
}
EOF


$ ./sapi/cli/php -d psi.directory=. -r 'var_dump(psi\time());'

It stalled the last months because I have been fighting health issues
since last summer, but I did post a link to internals about a year ago:
https://externals.io/message/98212#98259

--
Regards,
Mike

Reply via email to