Did you know ... Search Documentation:
Pack ffi -- prolog/cdecls.pl
PublicShow source

This module parses the header string, produces an AST for the C code and extracts type information for a requested set of functions. This implies it finds the function prototypes and recursively unwraps typedefs until it reaches types defined by the C language. This process is split in two:

  1. Find involved declarations from the AST (prototypes//2)
  2. Unwrap the types (expand_types//1)
 c99_types(+Header, +Flags, +Functions, -Types) is det
 c99_types(+Header, +Flags, +Functions, -Types, Consts) is det
True when Types contains the necessary declarations for Functions. Types are expanded to scalar types, structs, unions and enums.
Arguments:
Functions- is a list of function names. Optionally, a name may be embedded in a list to indicate it is not an error if the funtion is not present.
 ast_constant(+AST, -Constant) is det
 ast_constant(+AST, -Constant, +Types) is det
Evaluate an AST expression to a constant.
To be done
- : complete operators. Clarify what to do with limited range integers and overflows.
 c99_header_ast(+Header, +Flags, -AST)
 c99_types(+Header, +Flags, +Functions, -Types) is det
 c99_types(+Header, +Flags, +Functions, -Types, Consts) is det
True when Types contains the necessary declarations for Functions. Types are expanded to scalar types, structs, unions and enums.
Arguments:
Functions- is a list of function names. Optionally, a name may be embedded in a list to indicate it is not an error if the funtion is not present.