• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

12 Foreign Language Interface
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • Overview of the Interface
        • Linking Foreign Modules
        • Interface Data Types
        • The Foreign Include File
        • Linking embedded applications using swipl-ld
        • The Prolog‘home’directory
        • Example of Using the Foreign Interface
        • Notes on Using Foreign Code
        • Foreign access to Prolog IO streams
    • Packages

12.1 Overview of the Interface

The include file SWI-Prolog.h should be included with each C source file that is to be loaded via the foreign interface. The installation process installs this file in the directory include in the SWI-Prolog home directory (?- current_prolog_flag(home, Home).). This C header file defines various data types, macros and functions that can be used to communicate with SWI-Prolog. Functions and macros can be divided into the following categories:

  • Analysing Prolog terms
  • Constructing new terms
  • Unifying terms
  • Returning control information to Prolog
  • Registering foreign predicates with Prolog
  • Calling Prolog from C
  • Recorded database interactions
  • Global actions on Prolog (halt, break, abort, etc.)

ClioPatria (version V3.1.1-51-ga0b30a5)