summaryrefslogtreecommitdiff
path: root/save.c
blob: 1cc6abbcb7bb5882cc4db7dd9f74c49ecb582b95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <windows.h>
#include <SWI-Prolog.h>

INT WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    PSTR lpCmdLine, INT nCmdShow)
{
	char *plav[2];
	int rval;
	predicate_t pred;
	term_t h0;

	plav[0] = "save";
	plav[1] = NULL;

	if (!PL_initialise(1, plav))
		PL_halt(1);

	pred = PL_predicate("main", 0, "user");
	h0 = PL_new_term_refs(0);
	rval = PL_call_predicate(NULL, PL_Q_NORMAL, pred, h0);
	PL_halt(rval ? 0 : 1);
}