embedded YAP should ignore int by default.
This commit is contained in:
parent
f98dfa6994
commit
c9309dce75
@ -2261,7 +2261,7 @@ static void start_modules(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// whether Yap is under control of some other system
|
/// whether Yap is under control of some other system
|
||||||
bool Yap_embedded;
|
bool Yap_embedded = true;
|
||||||
|
|
||||||
/* this routine is supposed to be called from an external program
|
/* this routine is supposed to be called from an external program
|
||||||
that wants to control Yap */
|
that wants to control Yap */
|
||||||
@ -2285,7 +2285,8 @@ YAP_file_type_t YAP_Init(YAP_init_args *yap_init) {
|
|||||||
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA)
|
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA)
|
||||||
Yap_init_yapor_global_local_memory();
|
Yap_init_yapor_global_local_memory();
|
||||||
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */
|
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */
|
||||||
GLOBAL_PrologShouldHandleInterrupts = yap_init->PrologShouldHandleInterrupts;
|
GLOBAL_PrologShouldHandleInterrupts = yap_init->PrologShouldHandleInterrupts &&
|
||||||
|
!yap_init->Embedded;
|
||||||
Yap_InitSysbits(0); /* init signal handling and time, required by later
|
Yap_InitSysbits(0); /* init signal handling and time, required by later
|
||||||
functions */
|
functions */
|
||||||
GLOBAL_argv = yap_init->Argv;
|
GLOBAL_argv = yap_init->Argv;
|
||||||
|
@ -346,7 +346,8 @@ static void InitStdStreams(void) {
|
|||||||
#if USE_READLINE
|
#if USE_READLINE
|
||||||
if (GLOBAL_Stream[StdInStream].status & Tty_Stream_f &&
|
if (GLOBAL_Stream[StdInStream].status & Tty_Stream_f &&
|
||||||
GLOBAL_Stream[StdOutStream].status & Tty_Stream_f &&
|
GLOBAL_Stream[StdOutStream].status & Tty_Stream_f &&
|
||||||
GLOBAL_Stream[StdErrStream].status & Tty_Stream_f) {
|
GLOBAL_Stream[StdErrStream].status & Tty_Stream_f &&
|
||||||
|
! Yap_embedded) {
|
||||||
Yap_InitReadline(TermTrue);
|
Yap_InitReadline(TermTrue);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -283,6 +283,8 @@ static int prolog_complete(int ignore, int key) {
|
|||||||
|
|
||||||
bool Yap_InitReadline(Term enable) {
|
bool Yap_InitReadline(Term enable) {
|
||||||
// don't call readline within emacs
|
// don't call readline within emacs
|
||||||
|
if (Yap_embedded)
|
||||||
|
return false;
|
||||||
if (!(GLOBAL_Stream[StdInStream].status & Tty_Stream_f) ||
|
if (!(GLOBAL_Stream[StdInStream].status & Tty_Stream_f) ||
|
||||||
getenv("INSIDE_EMACS") || enable != TermTrue) {
|
getenv("INSIDE_EMACS") || enable != TermTrue) {
|
||||||
if (GLOBAL_Flags)
|
if (GLOBAL_Flags)
|
||||||
|
Reference in New Issue
Block a user