Foreign Language Interface Builder

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

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

Documentation on exports

PREDICATE

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:
    (streams_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).

PREDICATE

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:
    (streams_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).

PREDICATE

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.

  • Call and exit should be compatible with:
    (streams_basic:sourcename/1)File is a source name.
    (basic_props:list/2)Decls is a list of terms.
  • The following properties should hold at call time:
    (term_typing:ground/1)File is currently ground (it contains no variables).
    (term_typing:ground/1)Decls 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).
    (term_typing:ground/1)Decls is currently ground (it contains no variables).

PREDICATE

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.

  • Call and exit should be compatible with:
    (streams_basic:sourcename/1)File is a source name.
    (basic_props:list/2)Decls is a list of terms.
  • The following properties should hold at call time:
    (term_typing:ground/1)File is currently ground (it contains no variables).
    (term_typing:ground/1)Decls 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).
    (term_typing:ground/1)Decls is currently ground (it contains no variables).

PREDICATE

Usage:build_foreign_interface_object(File)

Compiles the gluecode file with the foreign source files producing an unique object file.

  • Call and exit should be compatible with:
    (streams_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).

PREDICATE

Usage:rebuild_foreign_interface_object(File)

Compiles (again) the gluecode file with the foreign source files producing an unique object file.

  • Call and exit should be compatible with:
    (streams_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).

PREDICATE

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).