From 25faa8f67cda026a7718b1f30d4156b382d18919 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 19 Jun 2018 12:29:16 +0100 Subject: [PATCH] droid --- C/yap-args.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/C/yap-args.c b/C/yap-args.c index 9b82a61bb..0f6fe0c0d 100755 --- a/C/yap-args.c +++ b/C/yap-args.c @@ -15,11 +15,12 @@ * * *************************************************************************/ /* static char SccsId[] = "X 4.3.3"; */ -#include "config.h" + #include "Yap.h" #include "YapHeap.h" #include "YapInterface.h" #include "YapStreams.h" +#include "config.h" #include "iopreds.h" #if HAVE_UNISTD_H @@ -158,15 +159,15 @@ static void consult(const char *b_file USES_REGS) { Functor functor_query = Yap_MkFunctor(Yap_LookupAtom("?-"), 1); Functor functor_command1 = Yap_MkFunctor(Yap_LookupAtom(":-"), 1); Functor functor_compile2 = Yap_MkFunctor(Yap_LookupAtom("c_compile"), 1); + char *full; /* consult in C */ int lvl = push_text_stack(); - char *full = Malloc(YAP_FILENAME_MAX + 1); + - char *full = Malloc(YAP_FILENAME_MAX + 1); full[0] = '\0'; /* the consult mode does not matter here, really */ - if ((osno = Yap_CheckAlias(AtomLoopStream)) < 0) { + vvvif ((osno = Yap_CheckAlias(AtomLoopStream)) < 0) osno = 0; - } c_stream = YAP_InitConsult(YAP_BOOT_MODE, b_file, &full, &oactive); if (c_stream < 0) { fprintf(stderr, "[ FATAL ERROR: could not open file %s ]\n", b_file); @@ -184,7 +185,7 @@ static void consult(const char *b_file USES_REGS) { Yap_StartSlots(); __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "read %s <%d>", b_file, GLOBAL_Stream[c_stream].linecount); - Term vs = MkVarTerm(), pos = MkVarTerm(); + Term vs = YAP_MkVarTerm(), pos = MkVarTerm(); t = YAP_ReadClauseFromStream(c_stream, vs, pos); // Yap_GetNèwSlot(t); if (t == 0) { @@ -317,7 +318,7 @@ static void Yap_set_locations(YAP_init_args *iap) { /// BOOTPLDIR: where we can find Prolog bootstrap files Yap_BOOTSTRAP = sel(true, iap->BOOTSTRAP != NULL, iap->BOOTSTRAP, true, #if __ANDROID__ - "/assets/Yap/pl/boot.yap", + "/assets/Yap/pl/boot,yap", #else join(getenv("DESTDIR"), YAP_BOOTSTRAP), #endif @@ -977,7 +978,7 @@ static void end_init(YAP_init_args *iap) { YAP_initialized = true; if (iap->HaltAfterBoot) Yap_exit(0); LOCAL_PrologMode &= ~BootMode; - CurrentModule = USER_MODULE; + CurrentModule = USER_MODULE } static void start_modules(void) { @@ -1054,8 +1055,9 @@ X_API void YAP_Init(YAP_init_args *yap_init) { YAP_RunGoalOnce(TermInitProlog); if (yap_init->install && Yap_OUTPUT_STARTUP) { +>>>>>>> ff2b867ec3c3831e10b8465e0a9e3c1a03e3d4d2 Term t = MkAtomTerm(Yap_LookupAtom(Yap_OUTPUT_STARTUP)); - Term g = Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("qsave_program"), 1), + Term g = Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("qsave_program"), 1), 1, &t); YAP_RunGoalOnce(g);