summaryrefslogtreecommitdiff
path: root/save.c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-01-22 18:12:48 +0100
committerJohn Ankarström <john@ankarstrom.se>2022-01-22 18:12:48 +0100
commit594c22ef699fa44ca65bcb6c1b9a0c9c848114f0 (patch)
tree8f8c5aaa4958a7fe916cecf2dec55a6fb6135ccb /save.c
downloadsave-594c22ef699fa44ca65bcb6c1b9a0c9c848114f0.tar.gz
A mk.bat
A pce_file_search_path.pl A save.c A save.exe A save.pl A save.pl~
Diffstat (limited to 'save.c')
-rw-r--r--save.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/save.c b/save.c
new file mode 100644
index 0000000..faead35
--- /dev/null
+++ b/save.c
@@ -0,0 +1,32 @@
+#include <windows.h>
+#include <SWI-Prolog.h>
+
+INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+ PSTR lpCmdLine, INT nCmdShow)
+{
+ char *plav[2];
+
+ /* make the argument vector for Prolog */
+
+ plav[0] = "save";
+ plav[1] = NULL;
+
+ /* initialise Prolog */
+
+ if (!PL_initialise(1, plav))
+ PL_halt(1);
+
+ /* Lookup calc/1 and make the arguments and call */
+
+ {
+ predicate_t pred = PL_predicate("main", 0, "user");
+ term_t h0 = PL_new_term_refs(0);
+ int rval;
+
+ rval = PL_call_predicate(NULL, PL_Q_NORMAL, pred, h0);
+
+ PL_halt(rval ? 0 : 1);
+ }
+
+ return 0;
+} \ No newline at end of file