12.3.43 SP_initialize() [macro]


     #include <sicstus/sicstus.h>
     SP_initialize(int argc,
     	      char **argv,
     	      void *reserved);

Initializes the Prolog engine.


The number of elements of the argv vector.
A vector of strings that can be accessed by prolog_flag(argv,X). This argument is copied by SP_initialize() so it can be discarded by the caller. May be passed as NULL if argc is zero.

Each entry should be an encoded string, i.e. encoded using `UTF-8'. This may not be the encoding used by the operating system when invoking main(). A better alternative is to pass zero for argc, NULL for argv and use SP_set_argv() to pass the argv entries.

Should be NULL

Return Value

SP_SUCCESS if initialization was successful. If initialization was successful, further calls to SP_initialize() will be no-ops (and return SP_SUCCESS).


This must be done before any interface functions are called, except those annotated as [preinit]. The function will allocate data areas used by Prolog, initialize command line arguments so that they can be accessed by the argv Prolog flag, and load the Runtime Library.

See Also

Initializing the Prolog Engine.

Send feedback on this subject.