Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap

This commit is contained in:
Vitor Santos Costa 2018-06-25 13:53:18 +01:00
commit 4495bb2661

View File

@ -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 bool 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);
@ -182,7 +183,9 @@ static bool consult(const char *b_file USES_REGS) {
CACHE_REGS
YAP_Reset(YAP_FULL_RESET, false);
Yap_StartSlots();
Term vs = MkVarTerm(), pos = MkVarTerm();
__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "read %s <%d>", b_file,
GLOBAL_Stream[c_stream].linecount);
Term vs = YAP_MkVarTerm(), pos = MkVarTerm();
t = YAP_ReadClauseFromStream(c_stream, vs, pos);
// Yap_GetNèwSlot(t);
if (t == TermEof)
@ -318,7 +321,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
@ -978,7 +981,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) {
@ -1056,8 +1059,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);