|Did you know ...||Search Documentation:|
TRUEif t1 and t2 refer to physically the same compound term and
In some applications it is useful to store and retrieve Prolog terms from C code. For example, the XPCE graphical environment does this for storing arbitrary Prolog data as slot-data of XPCE objects.
Please note that the returned handles have no meaning at the Prolog level and the recorded terms are not visible from Prolog. The functions PL_recorded() and PL_erase() are the only functions that can operate on the stored term.
Two groups of functions are provided. The first group (PL_record() and friends) store Prolog terms on the Prolog heap for retrieval during the same session. These functions are also used by recorda/3 and friends. The recorded database may be used to communicate Prolog terms between threads.
TRUEon success, and
FALSEif there is not enough space on the stack to accommodate the term. See also PL_record() and PL_erase().
The second group (headed by PL_record_external()) provides the same functionality, but the returned data has properties that enable storing the data on an external device. It has been designed to make it possible to store Prolog terms fast and compact in an external database. Here are the main features:
It is allowed to copy the data and use PL_recorded_external() on the copy. The user is responsible for the memory management of the copy. After copying, the original may be discarded using PL_erase_external().
PL_recorded_external() is used to copy such recorded terms back to the Prolog stack.
The function PL_get_file_name() provides access to Prolog filenames and its file-search mechanism described with absolute_file_name/3. Its existence is motivated to realise a uniform interface to deal with file properties, search, naming conventions, etc., from foreign code.
BUF_RING. Conversion from the internal UNICODE encoding is done using standard C library functions. flags is a bit-mask controlling the conversion process. Options are:
is used to separate directories rather than the canonical
PL_FILE_OSPATHmust be provided to fetch a filename in OS native (e.g.,
TRUEon success and
FALSEon failure. This function can be called before PL_initialise(), making the flag available to the Prolog startup code.
false) flag. The argument must be an
const char *.
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 appropiate size/type (see the returned types below to determine the size/type). The function returns
TRUEon success and
atom. The returned value is an atom handle of type
integer. The returned value is an integer of type
float. The returned value is a floating point number of type
term. The returned value is a term handle of type