11.4.14.4 Dealing with Prolog flags from C
Foreign code can set or create Prolog flags using PL_set_prolog_flag(). See set_prolog_flag/2 and create_prolog_flag/3.174The current C API does not provide for a dedicated mechanism for fetching the value of Prolog flags. Relatively slow access is provided by calling PL_call_predicate() using current_prolog_flag/2.
- int PL_set_prolog_flag(const char *name, int type, ...)
- Set/create a Prolog flag from C. name is the name of the
affected flag. type is one of the values below, which also
dictates the type of the final argument. The function returns
TRUE
on success andFALSE
on failure. This function can be called before PL_initialise(), making the flag available to the Prolog startup code.PL_BOOL
- Create a boolean (
true
orfalse
) flag. The argument must be anint
. PL_ATOM
- Create a flag with an atom as value. The argument must be of type
const char *
. PL_INTEGER
- Create a flag with an integer as value. The argument must be of type
intptr_t *
.