Summary of steps

Following is a summary of the steps that enable you to call foreign code from a Prolog predicate:

In the Prolog code:

  1. Declare the relevant object file(s), and the names of the functions defined in them, by defining clauses for foreign_file/2 (see fli-p2f-lnk).
  2. Specify the argument passing interface for each function by defining clauses for foreign/3 (see fli-p2f-api).
  3. Load the foreign files into Prolog by calling load_foreign_executable/1 or load_foreign_files/2 (see fli-p2f-uso).