aboutsummaryrefslogtreecommitdiff
path: root/c/pl.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/pl.h')
-rw-r--r--c/pl.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/c/pl.h b/c/pl.h
index 1ad0967..4268dad 100644
--- a/c/pl.h
+++ b/c/pl.h
@@ -7,6 +7,17 @@
int PL_get_tchars(term_t t, TCHAR** pTsz, int iFlags);
int Plx(const char* szMod, const char* szPred);
+struct Frame
+{
+ Frame();
+ ~Frame();
+ void Close();
+ void Discard();
+ void Rewind();
+private:
+ fid_t m_f;
+};
+
struct Query
{
Query(module_t ctx, predicate_t p, term_t t0);
@@ -65,6 +76,7 @@ int Countv(const int i, T, R... rest) { return Countv(i+1, rest...); }
template <typename ...T>
int Plx(const char* const szMod, const char* const szPred, T... args)
{
+ Frame f;
const int iArity = Countv(0, args...);
const term_t t = PL_new_term_refs(iArity);
if (!PlPutv(t, args...)) return 0;