The term reference mechanism was first used by Quintus Prolog version 3.
SICStus Prolog version 3 is strongly based on the Quintus interface. The
described SWI-Prolog interface is similar to using the Quintus or
SICStus interfaces, defining all foreign-predicate arguments of type
+term. SWI-Prolog explicitly uses type
while Quintus and SICStus use <name> and <arity>.
As the names of the functions differ from Prolog to Prolog, a simple
macro layer dealing with the names can also deal with this detail. For
#define QP_put_functor(t, n, a) \ PL_put_functor(t, PL_new_functor(n, a))
PL_unify_*() functions are lacking from the Quintus
and SICStus interface. They can easily be emulated, or the put/unify
approach should be used to write compatible code.
The PL_open_foreign_frame()/PL_close_foreign_frame() combination is lacking from both other Prologs. SICStus has PL_new_term_refs(0), followed by PL_reset_term_refs(), that allows for discarding term references.
The Prolog interface for the graphical user interface package XPCE shares about 90% of the code using a simple macro layer to deal with different naming and calling conventions of the interfaces.