aboutsummaryrefslogtreecommitdiff
path: root/c/pl.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-04 16:26:27 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-04 17:25:01 +0200
commit2ac7d06a503b256b290678f5bba158bf7d219bdd (patch)
tree86abdf303f8a3059efbd040c6eae95accf5b432c /c/pl.cpp
parent407b6cab4093b3c0ee23412ac07cf83fd9f03b82 (diff)
downloadEpisodeBrowser-2ac7d06a503b256b290678f5bba158bf7d219bdd.tar.gz
Add comments.
Diffstat (limited to 'c/pl.cpp')
-rw-r--r--c/pl.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/c/pl.cpp b/c/pl.cpp
index b0e7f8e..bab2f31 100644
--- a/c/pl.cpp
+++ b/c/pl.cpp
@@ -3,8 +3,6 @@
#include "pl.h"
-/* Frame: Wrapper for opening and closing Prolog foreign frames. */
-
Frame::Frame()
{
m_f = PL_open_foreign_frame();
@@ -20,7 +18,6 @@ void Frame::Close()
PL_close_foreign_frame(m_f);
}
-/* Close foreign frame and invalidate associated data. */
void Frame::Discard()
{
PL_discard_foreign_frame(m_f);
@@ -31,8 +28,6 @@ void Frame::Rewind()
PL_rewind_foreign_frame(m_f);
}
-/* Mark: Wrapper for marking and releasing strings on the Prolog stack. */
-
Mark::Mark()
{
PL_mark_string_buffers(&m_m);
@@ -43,8 +38,6 @@ Mark::~Mark()
PL_release_string_buffers_from_mark(m_m);
}
-/* Query: Wrapper for opening, solving and cutting Prolog query. */
-
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);
@@ -66,11 +59,11 @@ int Query::Cut()
return 0;
}
-/* Cut query and invalidate associated data. */
int Query::Close(std::nothrow_t)
{
return PL_close_query(m_q);
}
+
int Query::Close()
{
if (PL_close_query(m_q)) return 1;
@@ -82,6 +75,7 @@ int Query::NextSolution(std::nothrow_t)
{
return PL_next_solution(m_q);
}
+
int Query::NextSolution()
{
if (PL_next_solution(m_q)) return 1;
@@ -89,7 +83,6 @@ int Query::NextSolution()
return 0;
}
-/* Convert Prolog term to wide characters. */
WcharPtr PlString(const term_t t, const int flags)
{
char* s;