prolog_flag executable (obs from Aubrey Barnard).
This commit is contained in:
parent
1be390d31a
commit
ac2cf2434a
11
C/stdpreds.c
11
C/stdpreds.c
@ -3499,7 +3499,15 @@ static Int
|
|||||||
p_argv(void)
|
p_argv(void)
|
||||||
{
|
{
|
||||||
Term t = mk_argc_list();
|
Term t = mk_argc_list();
|
||||||
return(Yap_unify(t, ARG1));
|
return Yap_unify(t, ARG1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Int
|
||||||
|
p_executable(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
Yap_TrueFileName (Yap_argv[0], Yap_FileNameBuf, FALSE);
|
||||||
|
return Yap_unify(MkAtomTerm(Yap_LookupAtom(Yap_FileNameBuf)),ARG1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Int
|
static Int
|
||||||
@ -3972,6 +3980,7 @@ Yap_InitCPreds(void)
|
|||||||
Yap_InitCPred("$statistics_db_size", 4, p_statistics_db_size, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_db_size", 4, p_statistics_db_size, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
||||||
Yap_InitCPred("$statistics_lu_db_size", 5, p_statistics_lu_db_size, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$statistics_lu_db_size", 5, p_statistics_lu_db_size, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
||||||
Yap_InitCPred("$argv", 1, p_argv, SafePredFlag|HiddenPredFlag);
|
Yap_InitCPred("$argv", 1, p_argv, SafePredFlag|HiddenPredFlag);
|
||||||
|
Yap_InitCPred("$executable", 1, p_executable, SafePredFlag|HiddenPredFlag);
|
||||||
Yap_InitCPred("$runtime", 2, p_runtime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$runtime", 2, p_runtime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
||||||
Yap_InitCPred("$cputime", 2, p_cputime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$cputime", 2, p_cputime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
||||||
Yap_InitCPred("$systime", 2, p_systime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
Yap_InitCPred("$systime", 2, p_systime, SafePredFlag|SyncPredFlag|HiddenPredFlag);
|
||||||
|
@ -7595,6 +7595,11 @@ token is converted to a list of atoms, @code{chars}, to a list of integers,
|
|||||||
@code{codes}, or to a single atom, @code{atom}. If @var{Value} is bound, set to
|
@code{codes}, or to a single atom, @code{atom}. If @var{Value} is bound, set to
|
||||||
the corresponding behavior. The default value is @code{codes}.
|
the corresponding behavior. The default value is @code{codes}.
|
||||||
|
|
||||||
|
@item executable
|
||||||
|
@findex executable(yap_flag/2 option)
|
||||||
|
@* Read-only flag. It unifies with an atom that gives the
|
||||||
|
original program path.
|
||||||
|
|
||||||
@item fast
|
@item fast
|
||||||
@findex fast (yap_flag/2 option)
|
@findex fast (yap_flag/2 option)
|
||||||
@*
|
@*
|
||||||
|
@ -183,6 +183,9 @@ yap_flag(fast,off) :- !, set_value('$fast',[]).
|
|||||||
% do or do not machine code
|
% do or do not machine code
|
||||||
yap_flag(argv,L) :- '$argv'(L).
|
yap_flag(argv,L) :- '$argv'(L).
|
||||||
|
|
||||||
|
% do or do not machine code
|
||||||
|
yap_flag(executable,L) :- '$executable'(L).
|
||||||
|
|
||||||
% hide/unhide atoms
|
% hide/unhide atoms
|
||||||
yap_flag(hide,Atom) :- !, hide(Atom).
|
yap_flag(hide,Atom) :- !, hide(Atom).
|
||||||
yap_flag(unhide,Atom) :- !, unhide(Atom).
|
yap_flag(unhide,Atom) :- !, unhide(Atom).
|
||||||
@ -887,6 +890,7 @@ yap_flag(dialect,yap).
|
|||||||
V = dollar_as_lower_case ;
|
V = dollar_as_lower_case ;
|
||||||
V = double_quotes ;
|
V = double_quotes ;
|
||||||
V = encoding ;
|
V = encoding ;
|
||||||
|
V = executable ;
|
||||||
% V = fast ;
|
% V = fast ;
|
||||||
V = fileerrors ;
|
V = fileerrors ;
|
||||||
V = float_format ;
|
V = float_format ;
|
||||||
|
Reference in New Issue
Block a user