aboutsummaryrefslogtreecommitdiff
path: root/c/pl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/pl.cpp')
-rw-r--r--c/pl.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/c/pl.cpp b/c/pl.cpp
index fe65714..a40865f 100644
--- a/c/pl.cpp
+++ b/c/pl.cpp
@@ -3,6 +3,31 @@
#include "pl.h"
+Frame::Frame()
+{
+ m_f = PL_open_foreign_frame();
+}
+
+Frame::~Frame()
+{
+ PL_close_foreign_frame(m_f);
+}
+
+void Frame::Close()
+{
+ PL_close_foreign_frame(m_f);
+}
+
+void Frame::Discard()
+{
+ PL_discard_foreign_frame(m_f);
+}
+
+void Frame::Rewind()
+{
+ PL_rewind_foreign_frame(m_f);
+}
+
Query::Query(const module_t ctx, const predicate_t p, const term_t t0)
{
m_q = PL_open_query(ctx, PL_Q_CATCH_EXCEPTION, p, t0);
@@ -50,6 +75,7 @@ int PL_get_tchars(const term_t t, TCHAR** const pTsz, const int iFlags)
int Plx(const char* const szMod, const char* const szPred)
{
+ Frame f;
const term_t t = PL_new_term_refs(0);
Query q(NULL, PL_predicate(szPred, 0, szMod), t);
return q.NextSolution();