login

9.4.17 Querying Prolog

long PL_query(int)
Obtain status information on the Prolog system. The actual argument type depends on the information required. int describes what information is wanted.116Returning pointers and integers as a long is bad style. The signature of this function should be changed. The options are given in table 8.
PL_QUERY_ARGC Return an integer holding the number of arguments given to Prolog from Unix.
PL_QUERY_ARGV Return a char ** holding the argument vector given to Prolog from Unix.
PL_QUERY_SYMBOLFILE Return a char * holding the current symbol file of the running process.
PL_MAX_INTEGER Return a long, representing the maximal integer value represented by a Prolog integer.
PL_MIN_INTEGER Return a long, representing the minimal integer value.
PL_QUERY_VERSION Return a long, representing the version as 10,000 × M + 100 × m + p, where M is the major, m the minor version number and p the patch level. For example, 20717 means 2.7.17.
PL_QUERY_ENCODING Return the default stream encoding of Prolog (of type IOENC).
PL_QUERY_USER_CPU Get amount of user CPU time of the process in milliseconds.
Table 8 : PL_query() options