d_external(term_t
+t, size_t *len)Record the term t into the Prolog database as recorda/3
and return an opaque handle to the term. The returned handle remains
valid until PL_erase_external()
is called on it. Currently aborts the process with a fatal error
on failure. Future versions may raise a resource exception and return
int PL_recorded_external(const
char *record, term_t -t) Copy a recorded term back to the Prolog stack. The same record may be
used to copy multiple instances at any time to the Prolog stack. See
also PL_record_external()
and PL_erase_external().
int PL_erase_external(char
*record) Remove the recorded term from the Prolog database, reclaiming all
associated memory resources.
(char*)0
.
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_record_external() will fail if the term contains blobs that cannot be serialized, such as streams.
PL_recorded_external() is used to copy such recorded terms back to the Prolog stack.
12.4.18.3 Database
- int PL_assert(term_t t, module_t m, int flags)
- Provides direct access to asserta/1
and assertz/1
by asserting t into the database in the module m.
Defined flags are:
- PL_ASSERTZ
- Add the new clause as last. Calls assertz/1. This macros is defined as 0 and thus the default.
- PL_ASSERTA
- Add the new clause as first. Calls