support yap_flag(system_options,...

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1016 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2004-03-04 18:33:34 +00:00
parent 307ccbc8ca
commit 0092e6fd45
5 changed files with 60 additions and 6 deletions

View File

@ -1220,8 +1220,28 @@ Yap_WakeUp(CELL *pt0) {
}
#endif
static Int
p_yap_has_rational_trees(void)
{
#if RATIONAL_TREES
return TRUE;
#else
return FALSE;
#endif
}
void Yap_InitCoroutPreds(void)
static Int
p_yap_has_coroutining(void)
{
#if COROUTINING
return TRUE;
#else
return FALSE;
#endif
}
void
Yap_InitCoroutPreds(void)
{
#ifdef COROUTINING
Atom at;
@ -1237,6 +1257,8 @@ void Yap_InitCoroutPreds(void)
WakeUpCode = pred;
Yap_InitAttVarPreds();
#endif /* COROUTINING */
Yap_InitCPred("$yap_has_rational_trees", 0, p_yap_has_rational_trees, SafePredFlag);
Yap_InitCPred("$yap_has_coroutining", 0, p_yap_has_coroutining, SafePredFlag);
Yap_InitCPred("$read_svar_list", 2, p_read_svar_list, SafePredFlag);
Yap_InitCPred("$set_svar_list", 2, p_set_svar_list, SafePredFlag);
Yap_InitCPred("$freeze", 2, p_freeze, 0);

View File

@ -2796,9 +2796,7 @@ Yap_InitCPreds(void)
#if defined(YAPOR) || defined(TABLING)
Yap_init_optyap_preds();
#endif /* YAPOR || TABLING */
#ifdef THREADS
Yap_InitThreadPreds();
#endif /* ANALYST */
{
void (*(*(p))) (void) = E_Modules;
while (*p)

View File

@ -10,7 +10,7 @@
* File: Yap.proto *
* mods: *
* comments: Function declarations for YAP *
* version: $Id: Yapproto.h,v 1.49 2004-03-02 16:44:58 vsc Exp $ *
* version: $Id: Yapproto.h,v 1.50 2004-03-04 18:33:33 vsc Exp $ *
*************************************************************************/
/* prototype file for Yap */
@ -284,9 +284,7 @@ int STD_PROTO(Yap_ProcessSIGINT,(void));
double STD_PROTO(Yap_random, (void));
/* threads.c */
#ifdef THREADS
void STD_PROTO(Yap_InitThreadPreds,(void));
#endif /* ANALYST */
/* tracer.c */
#ifdef LOW_LEVEL_TRACER

View File

@ -6460,6 +6460,14 @@ Report the syntax error and generate an error.
Just fail
@end table
@item system_options
@findex system_options (yap_flag/2 option)
@* This read only flag tells which options were used to compile
Yap. Currently it informs whether the system supports
@code{coroutining}, @code{depth_limit}, the @code{low_level_tracer},
@code{or-parallelism}, @code{rational_trees}, @code{tabling},
@code{threads}, or the @code{wam_profiler}.
@item to_chars_mode
@findex to_chars_modes (yap_flag/2 option)
@* Define whether YAP should follow @code{quintus}-like

View File

@ -404,6 +404,33 @@ yap_flag(single_var_warnings,X) :-
yap_flag(single_var_warnings,X) :-
'$do_error'(domain_error(flag_value,single_var_warnings+X),yap_flag(single_var_warnings,X)).
yap_flag(single_var_warnings,X) :-
var(X), !,
('$syntax_check_mode'(on,_), '$syntax_check_single_var'(on,_) ->
X = on
;
X = off
).
yap_flag(system_options,X) :-
'$system_options'(X).
'$system_options'(coroutining) :-
'$yap_has_coroutining'.
'$system_options'(depth_limit) :-
\+ '$undefined'(get_depth_limit(_), prolog).
'$system_options'(low_level_tracer) :-
\+ '$undefined'(start_low_level_trace, prolog).
'$system_options'(or_parallelism) :-
\+ '$undefined'('$yapor_on', prolog).
'$system_options'(rational_trees) :-
'$yap_has_rational_trees'.
'$system_options'(tabling) :-
\+ '$undefined'('$do_table'(_,_), prolog).
'$system_options'(threads) :-
\+ '$no_threads'.
'$system_options'(wam_profiler) :-
\+ '$undefined'(reset_op_counters, prolog).
yap_flag(unknown,X) :-
var(X), !,
unknown(X,_).
@ -565,6 +592,7 @@ yap_flag(host_type,X) :-
V = strict_iso ;
V = stack_dump_on_error ;
V = syntax_errors ;
V = system_options ;
V = to_chars_mode ;
V = toplevel_hook ;
V = toplevel_print_options ;