[top] [up] [next]

External Prolog clauses and classes


Prolog clauses and Trinc-Prolog classes can be implemented in so called extension libraries, these extension libraries are Windows DLL (Dynamic Link Libraries) files. It is possible to extend Trinc-Prolog with your own built-in predicates written in C/C++ or any other language, programming tool, which can create Windows DLL's. 

Predicates and classes implemented in an extension library are declared as external, if Trinc-Prolog detects that an external predicate is being used it automatically calls a function with the same name in the associated library. There is no difference between calling 'normal' built-in predicates like put_char/1 and external predicates.

Extension libraries can be installed in two different folders, it is possible to install them in a subfolder called plugin of the executable using the libraries or in the same folder as the executable. With the predicate load_external_library/1 it is possible to load an extension library that is located at a different position.

  1. An empty extension library
  2. External Prolog clauses
  3. Clause arguments
  4. Returning a value
  5. External events
  6. External classes
  7. Prolog predicates to manage external libraries
  8. Types and functions

[top] [up] [next]

arrow.gif (1632 bytes)New in R3B: a second method to send events from an extension library to Trinc-Prolog
 

info@trinc-prolog.com