diff options
author | John Ankarström <john@ankarstrom.se> | 2022-01-22 19:14:53 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-01-22 19:14:53 +0100 |
commit | 259685f2aa2869177cc23715a6e89b0d2138b469 (patch) | |
tree | c6ef963734a7622199c6ec3be0a72c80cc9bca6d | |
parent | 136d027bca1d7bfc5bf796a79e5fb16a9b62e20b (diff) | |
download | save-259685f2aa2869177cc23715a6e89b0d2138b469.tar.gz |
Clean up save.c.
-rw-r--r-- | save.c | 27 |
1 files changed, 9 insertions, 18 deletions
@@ -1,32 +1,23 @@ #include <windows.h> #include <SWI-Prolog.h> -INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, +INT WINAPI +WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow) { char *plav[2]; - - /* make the argument vector for Prolog */ + int rval; + predicate_t pred; + term_t h0; 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; + 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); }
\ No newline at end of file |