8.3.2 Foreign Resources Supporting Multiple SICStus Runtimes

A foreign resource that wants to be shared between several SICStus runtimes must somehow know which SICStus runtime is calling it so that it can make callbacks using the SICStus API into the right SICStus runtime. In addition, the foreign resource may have global variables that should have different values depending on which SICStus runtime is calling the foreign resource.

A header file is generated by splfr when it builds a foreign resource (before any C code is compiled). This header file provides prototypes for any foreign-declared function, but it also provides other things needed for multiple SICStus runtime support. This header file must be included by any C file that contains code that either calls any SICStus API function or that contains any of the functions called by SICStus. See The Foreign Resource Linker.


Send feedback on this subject.