• Home
  • Raw
  • Download

Lines Matching refs:is

1 This is ../libffi/doc/libffi.info, produced by makeinfo version 4.11
4 This manual is for Libffi, a portable foreign-function interface
9 Permission is granted to copy, distribute and/or modify this
12 (at your option) any later version. A copy of the license is
27 This manual is for Libffi, a portable foreign-function interface
32 Permission is granted to copy, distribute and/or modify this
35 (at your option) any later version. A copy of the license is
41 * Introduction:: What is libffi?
49 1 What is libffi?
54 compilation to work. One such convention is the "calling convention".
55 The calling convention is a set of assumptions made by the compiler
58 is found. The calling convention is also sometimes called the "ABI" or
72 interface is the popular name for the interface that allows code
103 The first thing you must do is create an `ffi_cif' object that
104 matches the signature of the function you wish to call. This is a
105 separate step because it is common to make multiple calls using a
113 ABI is the ABI to use; normally `FFI_DEFAULT_ABI' is what you
116 NARGS is the number of arguments that this function accepts.
120 RTYPE is a pointer to an `ffi_type' structure that describes the
123 ARGTYPES is a vector of `ffi_type' pointers. ARGTYPES must have
124 NARGS elements. If NARGS is 0, this argument is ignored.
128 properly; `FFI_BAD_TYPEDEF' if one of the `ffi_type' objects is
129 incorrect; or `FFI_BAD_ABI' if the ABI parameter is invalid.
139 RVALUE is a pointer to a chunk of memory that will hold the result
141 result and must be suitably aligned; it is the caller's
143 returns `void' (using `ffi_type_void'), then RVALUE is ignored.
144 If RVALUE is `NULL', then the return value is discarded.
146 AVALUES is a vector of `void *' pointers that point to the memory
149 AVALUES is ignored.
157 Here is a trivial example that calls `puts' a few times.
183 call puts() again all we need to do is change the
185 s = "This is cool!";
251 The C `signed char' type. (Note that there is not an exact
254 whether `char' is signed.)
275 On platforms that have a C `long double' type, this is defined.
276 On other platforms, it is not.
282 Each of these is of type `ffi_type', so you must take the address
292 is perfectly happy passing structures back and forth. You must first
299 This is set by `libffi'; you should initialize it to zero.
302 This is set by `libffi'; you should initialize it to zero.
308 This is a `NULL'-terminated array of pointers to `ffi_type'
309 objects. There is one element per field of the struct.
320 Here is how the struct is defined:
337 Here is the corresponding code to describe this struct to `libffi':
367 `libffi' provides some support for this. However, this is
381 This facility is called the "closure API". Closures are not
387 heap. Memory management for closures is handled by a pair of functions:
397 Free memory allocated using `ffi_closure_alloc'. The argument is
409 CLOSURE is the address of a `ffi_closure' object; this is the
412 CIF is the `ffi_cif' describing the function parameters.
414 USER_DATA is an arbitrary datum that is passed, uninterpreted, to
417 CODELOC is the executable address returned by `ffi_closure_alloc'.
419 FUN is the function which will be called when the closure is
420 invoked. It is called with the arguments:
426 FUN must fill this, unless the function is declared as
443 is deprecated, as it cannot handle the need for separate writable and
452 `libffi' is missing a few features. We welcome patches to add support
455 * There is no support for calling varargs functions. This may work
456 on some platforms, depending on how the ABI is defined, but it is
459 * There is no support for bit fields in structures.
461 * The closure API is
463 * The "raw" API is undocumented.