diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-11 20:02:12 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-11 20:02:12 -0700 |
commit | e43849b3f941b12e14571aa09a5c18c3e105440f (patch) | |
tree | 335134dcf4b2093519eec949f2658e49821fbb53 /buf.c | |
parent | 1b615a6667660b353c7719d805a0a40cdd948789 (diff) | |
download | txr-e43849b3f941b12e14571aa09a5c18c3e105440f.tar.gz txr-e43849b3f941b12e14571aa09a5c18c3e105440f.tar.bz2 txr-e43849b3f941b12e14571aa09a5c18c3e105440f.zip |
ffi: support programmable abort return value.
* ffi.c (stuct txr_ffi_closure): New member, abort_retval.
(ffi_closure_mark_op): Mark the new member.
(ffi_closure_dispatch_safe): Implement the abort_retval.
If it is not nil, use put to place the value into the
return buffer. There is a risk that this could also throw
an exception, which is no longer protected: programer's
problem.
(ffi_make_closure): New abort_ret_in argument, which is
defaulted and stored.
(ffi_init): Update registration of ffi-make-closure to
reflect new argument.
* ffi.h (ffi_make_closure): Declaration updated.
* share/txr/stdlib/ffi.tl (sys:deffi-cb-expander):
Add abort-retval parameter; insert into ffi-make-closure
call.
(deffi-cb): Take optional abort-retval expression;
pass it down to the expander function.
(deffi-cb-unsafe): Pass nil as abort-retval down to expander.
* txr.1: Documented.
Diffstat (limited to 'buf.c')
0 files changed, 0 insertions, 0 deletions