This commit is contained in:
Vitor Santos Costa
2018-03-17 10:38:56 +00:00
parent c33a0d72db
commit cc6eca6903
30 changed files with 435 additions and 345 deletions

View File

@@ -2122,7 +2122,7 @@ X_API int YAP_InitConsult(int mode, const char *fname, char *full, int *osnop) {
}
}
bool consulted = (mode == YAP_CONSULT_MODE);
sno = Yap_OpenStream(fl, "r", MkAtomTerm(Yap_LookupAtom(fl)));
sno = Yap_OpenStream(fl, "r", MkAtomTerm(Yap_LookupAtom(fl)), LOCAL_encoding);
if (sno < 0)
return sno;
if (!Yap_ChDir(dirname((char *)fl))) return -1;

View File

@@ -4913,11 +4913,15 @@ static Int cont_current_key_integer(USES_REGS1) {
Term Yap_FetchTermFromDB(void *ref) {
CACHE_REGS
if (ref == NULL)
return 0;
return GetDBTerm(ref, FALSE PASS_REGS);
}
Term Yap_FetchClauseTermFromDB(void *ref) {
CACHE_REGS
if (ref == NULL)
return 0;
return GetDBTerm(ref, TRUE PASS_REGS);
}

View File

@@ -149,7 +149,10 @@ const char *Yap_BINDIR, *Yap_ROOTDIR, *Yap_SHAREDIR, *Yap_LIBDIR, *Yap_DLLDIR,
*Yap_PLDIR, *Yap_BOOTSTRAP, *Yap_COMMONSDIR, *Yap_STARTUP,
*Yap_INPUT_STARTUP, *Yap_OUTPUT_STARTUP, *Yap_BOOTFILE, *Yap_INCLUDEDIR;
/* do initial boot by consulting the file boot.yap */
/**
* consult loop in C: used to boot the system, butt supports goal execution and recursive consulting.
*
* */
static void consult(const char *b_file USES_REGS) {
Term t;
int c_stream, osno, oactive;
@@ -157,7 +160,7 @@ static void consult(const char *b_file USES_REGS) {
Functor functor_command1 = Yap_MkFunctor(Yap_LookupAtom(":-"), 1);
Functor functor_compile2 = Yap_MkFunctor(Yap_LookupAtom("c_compile"), 1);
/* consult boot.pl */
/* consult in C */
int lvl = push_text_stack();
char *full = Malloc(YAP_FILENAME_MAX + 1);
full[0] = '\0';