Home | History | Annotate | Download | only in doc

Lines Matching full:code

66 Compilers for high level languages generate code that follow certain
82 provide a bridge from the interpreter program to compiled code.
91 code written in one language to call code written in another language.
119 The first thing you must do is create an @code{ffi_cif} object that
122 single @code{ffi_cif}. The @dfn{cif} in @code{ffi_cif} stands for
124 @code{ffi_prep_cif}.
131 @var{abi} is the ABI to use; normally @code{FFI_DEFAULT_ABI} is what
138 @var{rtype} is a pointer to an @code{ffi_type} structure that
141 @var{argtypes} is a vector of @code{ffi_type} pointers.
145 @code{ffi_prep_cif} returns a @code{libffi} status code, of type
146 @code{ffi_status}. This will be either @code{FFI_OK} if everything
147 worked properly; @code{FFI_BAD_TYPEDEF} if one of the @code{ffi_type}
148 objects is incorrect; or @code{FFI_BAD_ABI} if the @var{abi} parameter
153 To call a function using an initialized @code{ffi_cif}, use the
154 @code{ffi_call} function:
160 @code{ffi_prep_cif}.
166 @code{void} (using @code{ffi_type_void}), then @var{rvalue} is
170 @var{avalues} is a vector of @code{void *} pointers that point to the
180 Here is a trivial example that calls @code{puts} a few times.
230 @code{Libffi} provides a number of built-in type descriptors that can
233 @table @code
236 The type @code{void}. This cannot be used for argument types, only
273 The C @code{float} type.
277 The C @code{double} type.
281 The C @code{unsigned char} type.
285 The C @code{signed char} type. (Note that there is not an exact
286 equivalent to the C @code{char} type in @code{libffi}; ordinarily you
287 should either use @code{ffi_type_schar} or @code{ffi_type_uchar}
288 depending on whether @code{char} is signed.)
292 The C @code{unsigned short} type.
296 The C @code{short} type.
300 The C @code{unsigned int} type.
304 The C @code{int} type.
308 The C @code{unsigned long} type.
312 The C @code{long} type.
316 On platforms that have a C @code{long double} type, this is defined.
321 A generic @code{void *} pointer. You should use this for all
325 Each of these is of type @code{ffi_type}, so you must take the address
326 when passing to @code{ffi_prep_cif}.
335 new @code{ffi_type} object for it.
339 The @code{ffi_type} has the following members:
340 @table @code
342 This is set by @code{libffi}; you should initialize it to zero.
345 This is set by @code{libffi}; you should initialize it to zero.
348 For a structure, this should be set to @code{FFI_TYPE_STRUCT}.
351 This is a @samp{NULL}-terminated array of pointers to @code{ffi_type}
360 The following example initializes a @code{ffi_type} object
361 representing the @code{tm} struct from Linux's @file{time.h}.
382 Here is the corresponding code to describe this struct to
383 @code{libffi}:
414 @code{libffi} provides some support for this. However, this is
422 @code{libffi} also provides a way to write a generic function -- a
428 supported on all platforms; you can check the @code{FFI_CLOSURES}
441 @defun void *ffi_closure_alloc (size_t @var{size}, void **@var{code})
443 pointer to the writable address, and sets *@var{code} to the
446 @var{size} should be sufficient to hold a @code{ffi_closure} object.
451 Free memory allocated using @code{ffi_closure_alloc}. The argument is
457 @code{ffi_cif} describing the function call. Finally you can prepare
464 @var{closure} is the address of a @code{ffi_closure} object; this is
465 the writable address returned by @code{ffi_closure_alloc}.
467 @var{cif} is the @code{ffi_cif} describing the function parameters.
473 @code{ffi_closure_alloc}.
479 The @code{ffi_cif} passed to @code{ffi_prep_closure_loc}.
484 @code{void}.
492 @code{ffi_prep_closure_loc}.
495 @code{ffi_prep_closure_loc} will return @code{FFI_OK} if everything
499 After calling @code{ffi_prep_closure_loc}, you can cast @var{codeloc}
505 You may see old code referring to @code{ffi_prep_closure}. This
513 @code{libffi} is missing a few features. We welcome patches to add