next up previous index
Next: Data Structures Up: External Language Interface Previous: External Procedures

Mapping between C and Prolog

In order that a piece of C code may be used to implement a Prolog procedure it is necessary that a mapping between the data structures of C and those of Prolog exist. ECLiPSe provides a set of predefined primitives and macros for use in C to reduce the work for the user in carrying out this mapping.   These will be introduced gradually in the following explanation. The ECLiPSe primitives are very powerful, they actually enable the user to write her/his own built-in predicates, access the Prolog stacks, heaps and other data. As ECLiPSe is a host for the integration of extensions, these features of the C interface are necessary in order to allow the extensions to plug into the core of the system. The normal user, however, is not likely to benefit from these features, they may even constitute a source of problems, since if the user corrupts some vital system information, there is no way for the system to detect and/or fix it. The provided macros, however, enable the user to write easily most of the necessary interface functions without the possibility of corrupting the system. The future ECLiPSe releases may provide as well a simplified external interface where no macros need to be used in the C function.





next up previous index
Next: Data Structures Up: External Language Interface Previous: External Procedures



Micha Meier
Mon Mar 4 12:11:45 MET 1996