:more db stuff

This commit is contained in:
Vitor Santos Costa
2018-06-28 12:48:29 +01:00
parent d3370ee141
commit 6c1d3d1a95
18 changed files with 122 additions and 71 deletions

View File

@@ -1001,6 +1001,15 @@ static Int read_exception(USES_REGS1) {
return Yap_unify(ARG2, rc);
}
static Int print_exception(USES_REGS1) {
yap_error_descriptor_t *t = AddressOfTerm(Deref(ARG1));
printErr(t);
// Yap_DebugPlWriteln(rc);
return true;
}
static Int query_exception(USES_REGS1) {
const char *query;
Term t;
@@ -1022,6 +1031,7 @@ static Int query_exception(USES_REGS1) {
}
}
static Int drop_exception(USES_REGS1) {
yap_error_descriptor_t *t = AddressOfTerm(Deref(ARG1));
free(t);
@@ -1226,6 +1236,7 @@ static Int is_predicate_indicator(USES_REGS1) {
void Yap_InitErrorPreds(void) {
CACHE_REGS
Yap_InitCPred("$print_exception", 1, print_exception, 0);
Yap_InitCPred("$reset_exception", 1, reset_exception, 0);
Yap_InitCPred("$new_exception", 1, new_exception, 0);
Yap_InitCPred("$get_exception", 1, get_exception, 0);