Foreign code can set or create Prolog flags using PL_set_prolog_flag(). See set_prolog_flag/2 and create_prolog_flag/3. To retrieve the value of a flag you can use PL_current_prolog_flag().
TRUE on success and FALSE on failure. This 
function can be called before PL_initialise(), 
making the flag available to the Prolog startup code.
PL_BOOLtrue or false) flag. The 
argument must be an int.PL_ATOMconst char *.PL_INTEGERintptr_t *.atom_t (see current_prolog_flag/2).
type specifies the kind of value to be retrieved, it is one 
of the values below. value is a pointer to a location where 
to store the value. The user is responsible for making sure this memory 
location is of the appropriate size/type (see the returned types below 
to determine the size/type). The function returns TRUE on 
success and FALSE on failure.
PL_ATOMatom. The returned value 
is an atom handle of type atom_t.PL_INTEGERinteger. The returned 
value is an integer of type int64_t.PL_FLOATfloat. The returned value 
is a floating point number of type double.PL_TERMterm. The returned value 
is a term handle of type term_t.