:fix merge
This commit is contained in:
parent
4495bb2661
commit
1fcc88865b
12
C/yap-args.c
12
C/yap-args.c
@ -159,14 +159,13 @@ static bool consult(const char *b_file USES_REGS) {
|
|||||||
Functor functor_query = Yap_MkFunctor(Yap_LookupAtom("?-"), 1);
|
Functor functor_query = Yap_MkFunctor(Yap_LookupAtom("?-"), 1);
|
||||||
Functor functor_command1 = Yap_MkFunctor(Yap_LookupAtom(":-"), 1);
|
Functor functor_command1 = Yap_MkFunctor(Yap_LookupAtom(":-"), 1);
|
||||||
Functor functor_compile2 = Yap_MkFunctor(Yap_LookupAtom("c_compile"), 1);
|
Functor functor_compile2 = Yap_MkFunctor(Yap_LookupAtom("c_compile"), 1);
|
||||||
char *full;
|
\
|
||||||
|
|
||||||
/* consult in C */
|
/* consult in C */
|
||||||
int lvl = push_text_stack();
|
int lvl = push_text_stack();
|
||||||
- char *full = Malloc(YAP_FILENAME_MAX + 1);
|
char *full = Malloc(YAP_FILENAME_MAX + 1);
|
||||||
full[0] = '\0';
|
full[0] = '\0';
|
||||||
/* the consult mode does not matter here, really */
|
/* the consult mode does not matter here, really */
|
||||||
vvvif ((osno = Yap_CheckAlias(AtomLoopStream)) < 0)
|
if ((osno = Yap_CheckAlias(AtomLoopStream)) < 0)
|
||||||
osno = 0;
|
osno = 0;
|
||||||
c_stream = YAP_InitConsult(YAP_BOOT_MODE, b_file, &full, &oactive);
|
c_stream = YAP_InitConsult(YAP_BOOT_MODE, b_file, &full, &oactive);
|
||||||
if (c_stream < 0) {
|
if (c_stream < 0) {
|
||||||
@ -321,7 +320,7 @@ static void Yap_set_locations(YAP_init_args *iap) {
|
|||||||
/// BOOTPLDIR: where we can find Prolog bootstrap files
|
/// BOOTPLDIR: where we can find Prolog bootstrap files
|
||||||
Yap_BOOTSTRAP = sel(true, iap->BOOTSTRAP != NULL, iap->BOOTSTRAP, true,
|
Yap_BOOTSTRAP = sel(true, iap->BOOTSTRAP != NULL, iap->BOOTSTRAP, true,
|
||||||
#if __ANDROID__
|
#if __ANDROID__
|
||||||
"/assets/Yap/pl/boot,yap",
|
"/assets/Yap/pl/boot.yap",
|
||||||
#else
|
#else
|
||||||
join(getenv("DESTDIR"), YAP_BOOTSTRAP),
|
join(getenv("DESTDIR"), YAP_BOOTSTRAP),
|
||||||
#endif
|
#endif
|
||||||
@ -981,7 +980,7 @@ static void end_init(YAP_init_args *iap) {
|
|||||||
YAP_initialized = true;
|
YAP_initialized = true;
|
||||||
if (iap->HaltAfterBoot) Yap_exit(0);
|
if (iap->HaltAfterBoot) Yap_exit(0);
|
||||||
LOCAL_PrologMode &= ~BootMode;
|
LOCAL_PrologMode &= ~BootMode;
|
||||||
CurrentModule = USER_MODULE
|
CurrentModule = USER_MODULE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void start_modules(void) {
|
static void start_modules(void) {
|
||||||
@ -1059,7 +1058,6 @@ X_API void YAP_Init(YAP_init_args *yap_init) {
|
|||||||
}
|
}
|
||||||
YAP_RunGoalOnce(TermInitProlog);
|
YAP_RunGoalOnce(TermInitProlog);
|
||||||
if (yap_init->install && Yap_OUTPUT_STARTUP) {
|
if (yap_init->install && Yap_OUTPUT_STARTUP) {
|
||||||
>>>>>>> ff2b867ec3c3831e10b8465e0a9e3c1a03e3d4d2
|
|
||||||
Term t = MkAtomTerm(Yap_LookupAtom(Yap_OUTPUT_STARTUP));
|
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);
|
1, &t);
|
||||||
|
@ -1130,7 +1130,7 @@ bool Yap_initStream(int sno, FILE *fd, const char *name, const char *io_mode,
|
|||||||
Term file_name, encoding_t encoding, stream_flags_t flags,
|
Term file_name, encoding_t encoding, stream_flags_t flags,
|
||||||
void *vfs) {
|
void *vfs) {
|
||||||
StreamDesc *st = &GLOBAL_Stream[sno];
|
StreamDesc *st = &GLOBAL_Stream[sno];
|
||||||
__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "init %s %s stream <%d>",io_mode,name,
|
__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "init %s %s stream <%d>",io_mode,name,
|
||||||
sno);
|
sno);
|
||||||
if (io_mode == NULL)
|
if (io_mode == NULL)
|
||||||
Yap_Error(PERMISSION_ERROR_NEW_ALIAS_FOR_STREAM, MkIntegerTerm(sno),
|
Yap_Error(PERMISSION_ERROR_NEW_ALIAS_FOR_STREAM, MkIntegerTerm(sno),
|
||||||
@ -2051,13 +2051,13 @@ void Yap_InitPlIO(struct yap_boot_params *argi) {
|
|||||||
Int i;
|
Int i;
|
||||||
if (argi->inp > 0)
|
if (argi->inp > 0)
|
||||||
Yap_stdin = fdopen(argi->inp - 1, "r");
|
Yap_stdin = fdopen(argi->inp - 1, "r");
|
||||||
else if (argi->inp)
|
else if (argi->inp < 0)
|
||||||
Yap_stdin = NULL;
|
Yap_stdin = NULL;
|
||||||
else
|
else
|
||||||
Yap_stdin = stdin;
|
Yap_stdin = stdin;
|
||||||
if (argi->out > 0)
|
if (argi->out > 0)
|
||||||
Yap_stdout = fdopen(argi->out - 1, "a");
|
Yap_stdout = fdopen(argi->out - 1, "a");
|
||||||
else if (argi->out)
|
else if (argi->out < 0)
|
||||||
Yap_stdout = NULL;
|
Yap_stdout = NULL;
|
||||||
else
|
else
|
||||||
Yap_stdout = stdout;
|
Yap_stdout = stdout;
|
||||||
|
@ -1036,6 +1036,7 @@ static void CloseStream(int sno) {
|
|||||||
GLOBAL_Stream[sno].vfs = NULL;
|
GLOBAL_Stream[sno].vfs = NULL;
|
||||||
GLOBAL_Stream[sno].file = NULL;
|
GLOBAL_Stream[sno].file = NULL;
|
||||||
GLOBAL_Stream[sno].status = Free_Stream_f;
|
GLOBAL_Stream[sno].status = Free_Stream_f;
|
||||||
|
// __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "close stream <%d>", sno);
|
||||||
|
|
||||||
/* if (st->status == Socket_Stream_f|Input_Stream_f|Output_Stream_f) {
|
/* if (st->status == Socket_Stream_f|Input_Stream_f|Output_Stream_f) {
|
||||||
Yap_CloseSocket();
|
Yap_CloseSocket();
|
||||||
|
Reference in New Issue
Block a user