io/foreign
Higher-level wrappers around the LuaJIT ffi module.
(define-foreign-function name lambda-list do-errno-check)
Macro defined at lib/io/foreign.lisp:8:2
Define a foreign function wrapper for the C
symbol NAME
, taking
arguments LAMBDA-LIST
.
Additionally, if DO-ERRNO-CHECK
is true or a number, assume that
negative return values (or the number, if given) signal an error
condition, and raise an exception with the message determined by
strerror(3).
The symbol NAME
will be mangled by replacing -
s with _
s. If this
is undesirable, you may give an argument of the form (quote foo)
,
in which foo will not be mangled.
Example:
> (ffi/cdef "char *get_current_dir_name(void);")
out = nil
> (define-foreign-function get-current-dir-name () 0)
out = function: 0x42e22188
> (get-current-dir-name)
out = cdata<char *>: 0x00d26610
> (ffi/string (get-current-dir-name))
out = "/home/hydraz/Projects/urn/compiler"
(define-foreign-functions c-definitions &functions)
Macro defined at lib/io/foreign.lisp:61:2
Declare all the foreign functions specified in C-DEFINITIONS
, and
additionally build the wrappers as described in FUNCTIONS
, using
define-foreign-function
(ffi/defun-ffi name typedecl)
Macro defined at lib/luajit/ffi.lisp:22:2
Warning: ffi/defun-ffi is deprecated: Use cdef and index the
C
table directly
Define the external symbol NAME
with the C
type signature
given by TYPEDECL
.
Undocumented symbols
C
Native defined at lib/luajit/ffi.lisp:19:1bit/arshift
Native defined at lib/luajit/bit.lisp:9:1bit/band
Native defined at lib/luajit/bit.lisp:4:1bit/bnot
Native defined at lib/luajit/bit.lisp:3:1bit/bor
Native defined at lib/luajit/bit.lisp:5:1bit/bswap
Native defined at lib/luajit/bit.lisp:12:1bit/bxor
Native defined at lib/luajit/bit.lisp:6:1bit/lshift
Native defined at lib/luajit/bit.lisp:7:1bit/rol
Native defined at lib/luajit/bit.lisp:10:1bit/ror
Native defined at lib/luajit/bit.lisp:11:1bit/rshift
Native defined at lib/luajit/bit.lisp:8:1bit/tobit
Native defined at lib/luajit/bit.lisp:1:1bit/tohex
Native defined at lib/luajit/bit.lisp:2:1cdef
Native defined at lib/luajit/ffi.lisp:8:1ffi/C
Native defined at lib/luajit/ffi.lisp:19:1ffi/abi
Native defined at lib/luajit/ffi.lisp:9:1ffi/alignof
Native defined at lib/luajit/ffi.lisp:5:1ffi/arch
Native defined at lib/luajit/ffi.lisp:12:1ffi/cast
Native defined at lib/luajit/ffi.lisp:2:1ffi/cdef
Native defined at lib/luajit/ffi.lisp:8:1ffi/copy
Native defined at lib/luajit/ffi.lisp:11:1ffi/errno
Native defined at lib/luajit/ffi.lisp:18:1ffi/fill
Native defined at lib/luajit/ffi.lisp:7:1ffi/gc
Native defined at lib/luajit/ffi.lisp:17:1ffi/istype
Native defined at lib/luajit/ffi.lisp:6:1ffi/load
Native defined at lib/luajit/ffi.lisp:14:1ffi/metatype
Native defined at lib/luajit/ffi.lisp:10:1ffi/new
Native defined at lib/luajit/ffi.lisp:1:1ffi/offsetof
Native defined at lib/luajit/ffi.lisp:20:1ffi/os
Native defined at lib/luajit/ffi.lisp:15:1ffi/sizeof
Native defined at lib/luajit/ffi.lisp:4:1ffi/string
Native defined at lib/luajit/ffi.lisp:16:1ffi/typeinfo
Native defined at lib/luajit/ffi.lisp:13:1ffi/typeof
Native defined at lib/luajit/ffi.lisp:3:1