12.3.54 SP_load_sicstus_run_time()

Synopsis

     #include <sicstus/sicstus.h>
     
     int
     SP_load_sicstus_run_time(SP_get_dispatch_type **pfuncp,
                              void *reserved);

Arguments

pfuncp
On success the address of the SP_get_dispatch() function of the newly loaded SICStus runtime is stored at this address.
reserved
Reserved, should be NULL.

Return Value

Positive if a new runtime could be loaded, non-positive on error. Please note: The return value was incorrectly described prior to SICStus Prolog 4.0.5. Also note that, for historical reasons, the meaning of the return value is different from the convention used by most of the SICStus Prolog C API.

Description

SP_load_sicstus_run_time() loads a new SICStus runtime.

As a special case, if SP_load_sicstus_run_time() is called from a SICStus runtime that has not been initialized (with SP_initialize()) and that has not previously been loaded as the result of calling SP_load_sicstus_run_time(), no new runtime is loaded. Instead, the SP_get_dispatch() of the runtime itself is returned. In particular, the first time SP_load_sicstus_run_time() is called on the initial SICStus runtime, and if this happens before the initial SICStus runtime is initialized, no new runtime is loaded.

Calling SP_load_sicstus_run_time() from a particular runtime can be done from any thread.

An application that links statically with the SICStus runtime should not call SP_load_sicstus_run_time().

You should not use pre-linked foreign resources when using multiple SICStus runtimes in the same process.

For an example of loading and using multiple SICStus runtimes, see library/jasper/spnative.c that implements this functionality for the Java interface Jasper.

See Also

Multiple SICStus Runtimes.


Send feedback on this subject.