• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

12.4.18 Miscellaneous
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • The Foreign Include File
          • Miscellaneous
            • Term Comparison
            • Recorded database
            • Database
            • Getting file names
            • Dealing with Prolog flags from C
              • PL_set_prolog_flag()
              • PL_current_prolog_flag()
            • Foreign code and Well Founded Semantics
    • Packages

12.4.18.5 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. To retrieve the value of a flag you can use PL_current_prolog_flag().

bool 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 and FALSE 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 or false) flag. The argument must be an int.
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 *.
int PL_current_prolog_flag(atom_t name, int type, void *value)
Retrieve the value of a Prolog flag from C. name is the name of the flag as an 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_ATOM
Retrieve a flag whose value is an atom. The returned value is an atom handle of type atom_t.
PL_INTEGER
Retrieve a flag whose value is an integer. The returned value is an integer of type int64_t.
PL_FLOAT
Retrieve a flag whose value is a float. The returned value is a floating point number of type double.
PL_TERM
Retrieve a flag whose value is a term. The returned value is a term handle of type term_t.

ClioPatria (version V3.1.1-51-ga0b30a5)