use SWI flags.
This commit is contained in:
parent
0bd0936683
commit
48cd3bd675
12
C/iopreds.c
12
C/iopreds.c
@ -215,17 +215,6 @@ Yap_DebugErrorPutc(int c)
|
||||
|
||||
|
||||
|
||||
static Int
|
||||
p_has_readline( USES_REGS1 )
|
||||
{
|
||||
#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
|
||||
return TRUE;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
Yap_GetCharForSIGINT(void)
|
||||
{
|
||||
@ -1163,6 +1152,5 @@ Yap_InitIOPreds(void)
|
||||
// Yap_InitCPred ("stream_select", 3, p_stream_select, SafePredFlag|SyncPredFlag);
|
||||
#endif
|
||||
Yap_InitCPred ("$float_format", 1, p_float_format, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
||||
Yap_InitCPred ("$has_readline", 0, p_has_readline, SafePredFlag|HiddenPredFlag);
|
||||
|
||||
}
|
||||
|
@ -1557,8 +1557,6 @@ InteractSIGINT(int ch) {
|
||||
switch (ch) {
|
||||
case 'a':
|
||||
/* abort computation */
|
||||
if (Yap_PrologMode &= InReadlineMode) {
|
||||
}
|
||||
if (Yap_PrologMode & (GCMode|ConsoleGetcMode|GrowStackMode|GrowHeapMode)) {
|
||||
Yap_PrologMode |= AbortMode;
|
||||
} else {
|
||||
@ -1566,6 +1564,7 @@ InteractSIGINT(int ch) {
|
||||
/* in case someone mangles the P register */
|
||||
}
|
||||
Yap_PrologMode &= ~AsyncIntMode;
|
||||
siglongjmp(Yap_RestartEnv,1);
|
||||
return -1;
|
||||
case 'b':
|
||||
/* continue */
|
||||
|
@ -4714,6 +4714,7 @@ static const PL_extension foreigns[] = {
|
||||
META|NDET),
|
||||
FRG("$raw_read", 1, pl_raw_read, 0),
|
||||
FRG("$raw_read", 2, pl_raw_read2, 0),
|
||||
FRG("$has_readline", 1, pl_has_readline, 0),
|
||||
/* DO NOT ADD ENTRIES BELOW THIS ONE */
|
||||
LFRG((char *)NULL, 0, NULL, 0)
|
||||
};
|
||||
|
@ -514,12 +514,6 @@ Sread_readline(void *handle, char *buf, size_t size)
|
||||
PL_clock_wait_ticks(clock() - oldclock);
|
||||
#endif
|
||||
|
||||
#if __YAP_PROLOG__
|
||||
/* handle abort */
|
||||
if (Yap_REGS.P_ == FAILCODE) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
@ -1023,14 +1023,20 @@ Yap_fetch_module_for_format(term_t args, YAP_Term *modp) {
|
||||
return YAP_InitSlot(nt);
|
||||
}
|
||||
|
||||
word
|
||||
pl_readline(term_t flag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#if THREADS
|
||||
|
||||
#define COUNT_MUTEX_INITIALIZER(name) \
|
||||
{ PTHREAD_MUTEX_INITIALIZER, \
|
||||
name, \
|
||||
0L \
|
||||
}
|
||||
|
||||
#if THREADS
|
||||
|
||||
static int
|
||||
recursive_attr(pthread_mutexattr_t **ap)
|
||||
{ static int done;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 66edc33d2d03b356751a7059dc36e3328183fa40
|
||||
Subproject commit b0fde37bf3338926ed4f1fd06bbbaa78fb389569
|
@ -1 +1 @@
|
||||
Subproject commit 4ec3a70be358ac793753d39022e099f722d280a4
|
||||
Subproject commit dd614178a5e334aa7f40d157d849514e99a9f48b
|
@ -1 +1 @@
|
||||
Subproject commit 52469bccc1cc81d06e47a3a781128689f4658542
|
||||
Subproject commit dcdc7f12929bf921ee49f85983c7cd9a9171a32e
|
@ -145,7 +145,9 @@ true :- true.
|
||||
|
||||
/* main execution loop */
|
||||
'$read_vars'(user_input, Goal, Mod, Pos, Bindings) :-
|
||||
writeln(c:Raw),
|
||||
get_value('$readline',true), !,
|
||||
writeln(d:Raw),
|
||||
read_history(h, '!h',
|
||||
[trace, end_of_file],
|
||||
' ?- ', Goal, Bindings),
|
||||
|
@ -207,12 +207,12 @@ yap_flag(home,X) :-
|
||||
|
||||
yap_flag(readline,X) :-
|
||||
var(X), !,
|
||||
get_value('$readline',X).
|
||||
( '$has_readline'(X) ).
|
||||
yap_flag(readline,X) :-
|
||||
( X = true ; X = false ), !,
|
||||
set_value('$readline',X).
|
||||
'$has_readline'(X).
|
||||
yap_flag(readline,X) :-
|
||||
'$do_error'(domain_error(flag_value,readline+X),yap_flag(bounded,X)).
|
||||
'$do_error'(domain_error(flag_value,readline+X),yap_flag(readline,X)).
|
||||
|
||||
% tabling mode
|
||||
yap_flag(tabling_mode,Options) :-
|
||||
|
Reference in New Issue
Block a user