Foreign language interface builder

Author(s): Jose F. Morales, Manuel Carro.

Low-level utilities for building C foreign interfaces. End-users should not need to use them, as the Ciao compiler reads the user assertions and calls appropriately the predicates in this module.

Usage and interface

Documentation on exports

Usage:build_foreign_interface(File)

Reads assertions from File, generates the gluecode for the Ciao Prolog interface, compiles the foreign files and the gluecode file, and links everything in a shared object. Checks modification times to determine automatically which files must be generated/compiled/linked.

  • Call and exit should be compatible with:
    (stream_basic:sourcename/1)File is a source name.
  • The following properties should hold at call time:
    (term_typing:ground/1)File is currently ground (it contains no variables).
  • The following properties should hold upon exit:
    (term_typing:ground/1)File is currently ground (it contains no variables).

Usage:rebuild_foreign_interface(File)

Like build_foreign_interface/1, but it does not check the modification time of any file.

  • Call and exit should be compatible with:
    (stream_basic:sourcename/1)File is a source name.
  • The following properties should hold at call time:
    (term_typing:ground/1)File is currently ground (it contains no variables).
  • The following properties should hold upon exit:
    (term_typing:ground/1)File is currently ground (it contains no variables).

Usage:build_foreign_interface_explicit_decls(File,Decls)

Like build_foreign_interface/1, but use declarations in Decls instead of reading the declarations from File.

Usage:rebuild_foreign_interface_explicit_decls(File,Decls)

Like build_foreign_interface_explicit_decls/1, but it does not check the modification time of any file.

Usage:do_interface(Decls)

Given the declarations in Decls, this predicate succeeds if these declarations involve the creation of the foreign interface

  • Call and exit should be compatible with:
    (basic_props:list/2)Decls is a list of terms.
  • The following properties should hold at call time:
    (term_typing:ground/1)Decls is currently ground (it contains no variables).
  • The following properties should hold upon exit:
    (term_typing:ground/1)Decls is currently ground (it contains no variables).