-q flag
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2150 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
abbfff0917
commit
3101d1ff61
@ -10,8 +10,11 @@
|
||||
* File: c_interface.c *
|
||||
* comments: c_interface primitives definition *
|
||||
* *
|
||||
* Last rev: $Date: 2008-02-12 17:03:50 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2008-03-13 18:41:50 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.106 2008/02/12 17:03:50 vsc
|
||||
* SWI-portability changes
|
||||
*
|
||||
* Revision 1.105 2008/01/28 10:42:19 vsc
|
||||
* fix BOM trouble
|
||||
*
|
||||
@ -1681,6 +1684,9 @@ YAP_Init(YAP_init_args *yap_init)
|
||||
yap_init->DelayedReleaseLoad
|
||||
);
|
||||
Yap_InitExStacks (Trail, Stack);
|
||||
if (yap_init->QuietMode) {
|
||||
yap_flags[QUIET_MODE_FLAG] = TRUE;
|
||||
}
|
||||
|
||||
{ BACKUP_MACHINE_REGS();
|
||||
Yap_InitYaamRegs();
|
||||
@ -1773,6 +1779,9 @@ YAP_Init(YAP_init_args *yap_init)
|
||||
if (yap_init->YapPrologAddPath) {
|
||||
Yap_PutValue(Yap_FullLookupAtom("$extend_file_search_path"), MkAtomTerm(Yap_LookupAtom(yap_init->YapPrologAddPath)));
|
||||
}
|
||||
if (yap_init->QuietMode) {
|
||||
yap_flags[QUIET_MODE_FLAG] = TRUE;
|
||||
}
|
||||
if (yap_init->SavedState != NULL ||
|
||||
yap_init->YapPrologBootFile == NULL) {
|
||||
if (restore_result == FAIL_RESTORE) {
|
||||
@ -1816,6 +1825,7 @@ YAP_FastInit(char saved_state[])
|
||||
init_args.Argv = NULL;
|
||||
init_args.ErrorNo = 0;
|
||||
init_args.ErrorCause = NULL;
|
||||
init_args.QuietMode = FALSE;
|
||||
out = YAP_Init(&init_args);
|
||||
if (out == YAP_BOOT_FROM_SAVED_ERROR) {
|
||||
Yap_Error(init_args.ErrorNo,TermNil,init_args.ErrorCause);
|
||||
|
1
C/init.c
1
C/init.c
@ -859,6 +859,7 @@ InitFlags(void)
|
||||
/* current default */
|
||||
yap_flags[INDEXING_MODE_FLAG] = INDEX_MODE_MULTI;
|
||||
yap_flags[TABLING_MODE_FLAG] = 0;
|
||||
yap_flags[QUIET_MODE_FLAG] = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
2
C/save.c
2
C/save.c
@ -1398,7 +1398,7 @@ commit_to_saved_state(char *s, CELL *Astate, CELL *ATrail, CELL *AStack, CELL *A
|
||||
return(FAIL_RESTORE);
|
||||
Yap_PrologMode = BootMode;
|
||||
if (Yap_HeapBase) {
|
||||
if (!yap_flags[HALT_AFTER_CONSULT_FLAG]) {
|
||||
if (!yap_flags[HALT_AFTER_CONSULT_FLAG] && !yap_flags[QUIET_MODE_FLAG]) {
|
||||
Yap_TrueFileName(s,Yap_FileNameBuf2, YAP_FILENAME_MAX);
|
||||
fprintf(stderr, "%% Restoring file %s\n", Yap_FileNameBuf2);
|
||||
}
|
||||
|
5
H/Yap.h
5
H/Yap.h
@ -10,7 +10,7 @@
|
||||
* File: Yap.h.m4 *
|
||||
* mods: *
|
||||
* comments: main header file for YAP *
|
||||
* version: $Id: Yap.h,v 1.27 2008-02-12 21:50:58 vsc Exp $ *
|
||||
* version: $Id: Yap.h,v 1.28 2008-03-13 18:41:50 vsc Exp $ *
|
||||
*************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
@ -521,8 +521,9 @@ typedef enum
|
||||
INDEXING_MODE_FLAG = 19,
|
||||
TABLING_MODE_FLAG = 20,
|
||||
VARS_CAN_HAVE_QUOTE_FLAG = 21,
|
||||
QUIET_MODE_FLAG = 22,
|
||||
/* let this be the last one */
|
||||
LAST_FLAG = 22
|
||||
LAST_FLAG = 23
|
||||
} yap_flags;
|
||||
|
||||
#define STRING_AS_CHARS 0
|
||||
|
@ -17,6 +17,10 @@ xb
|
||||
|
||||
<h2>Yap-5.1.3:</h2>
|
||||
<ul>
|
||||
<li> NEW: upgrade clpqr and chr (SWI compatibility).</li>
|
||||
<li> NEW: expects_dialect/1 directive (SWI compatibility).</li>
|
||||
<li> NEW: terms:unifiable/3 (SWI compatibility).</li>
|
||||
<li> NEW: -q flag for silent booting (request from Nicos Angelopoulos).</li>
|
||||
<li> NEW: verbose prolog_flag fixes silent (obs from Nicos
|
||||
Angelopoulos).</li>
|
||||
<li> FIXED: true_file_name/3 was totally broken (obs from Nicos Angelopoulos).</li>
|
||||
|
@ -233,8 +233,10 @@ print_usage(void)
|
||||
fprintf(stderr,"\n[ Valid switches for command line arguments: ]\n");
|
||||
fprintf(stderr," -? Shows this screen\n");
|
||||
fprintf(stderr," -b Boot file \n");
|
||||
fprintf(stderr," -f Do not consult startup prolog files\n");
|
||||
fprintf(stderr," -g Run Goal Before Top-Level \n");
|
||||
fprintf(stderr," -z Run Goal Before Top-Level \n");
|
||||
fprintf(stderr," -q start with informational messages off\n");
|
||||
fprintf(stderr," -l load Prolog file\n");
|
||||
fprintf(stderr," -L run Prolog file and exit\n");
|
||||
fprintf(stderr," -p extra path for file-search-path\n");
|
||||
@ -295,6 +297,9 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
||||
case '?':
|
||||
print_usage();
|
||||
exit(EXIT_SUCCESS);
|
||||
case 'q':
|
||||
iap->QuietMode = TRUE;
|
||||
break;
|
||||
case 'w':
|
||||
ssize = &(iap->NumberWorkers);
|
||||
goto GetSize;
|
||||
@ -432,7 +437,8 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
||||
break;
|
||||
#endif
|
||||
case 'L':
|
||||
iap->HaltAfterConsult = TRUE;
|
||||
iap->QuietMode = TRUE;
|
||||
iap->HaltAfterConsult = TRUE;
|
||||
case 'l':
|
||||
p++;
|
||||
if (!*++argv) {
|
||||
@ -590,6 +596,7 @@ init_standard_system(int argc, char *argv[], YAP_init_args *iap)
|
||||
#endif
|
||||
iap->ErrorNo = 0;
|
||||
iap->ErrorCause = NULL;
|
||||
iap->QuietMode = FALSE;
|
||||
|
||||
BootMode = parse_yap_arguments(argc,argv,iap);
|
||||
|
||||
|
12
docs/yap.tex
12
docs/yap.tex
@ -890,6 +890,10 @@ the predicate '$live'/0.
|
||||
connect standard streams to host @t{IP_HOST} at port @t{port}
|
||||
@item filename
|
||||
restore state saved in the given file
|
||||
@item -f
|
||||
do not consult initial files
|
||||
@item -q
|
||||
do not print informational messages
|
||||
@item --
|
||||
separator for arguments to Prolog code. These arguments are visible
|
||||
through the unix/1 built-in.
|
||||
@ -10509,6 +10513,14 @@ variable in @var{Term1}.
|
||||
Succeed if the second argument @var{Var} is a variable and occurs in
|
||||
term @var{Term}.
|
||||
|
||||
@item unifiable(?@var{Term1}, ?@var{Term2}, -@var{Bindings})
|
||||
@findex unifiable/3
|
||||
@syindex unifiable/3
|
||||
@cnindex unifiable/3
|
||||
|
||||
Succeed if @var{Term1} and @var{Term2} are unifiable with substitution
|
||||
@var{Bindings}.
|
||||
|
||||
@end table
|
||||
|
||||
@node Tries, Cleanup, Terms, Library
|
||||
|
@ -114,6 +114,8 @@ typedef struct {
|
||||
int Argc;
|
||||
/* array of arguments as seen by Prolog */
|
||||
char **Argv;
|
||||
/* QuietMode */
|
||||
int QuietMode;
|
||||
#ifdef MYDDAS_MYSQL
|
||||
/* If any myddas option was given */
|
||||
short myddas;
|
||||
|
11
pl/boot.yap
11
pl/boot.yap
@ -40,11 +40,20 @@ true :- true.
|
||||
'$change_alias_to_stream'('$loop_stream','$stream'(0)),
|
||||
% do catch as early as possible
|
||||
(
|
||||
'$access_yap_flags'(15, 0), \+ '$uncaught_throw' ->
|
||||
'$access_yap_flags'(15, 0),
|
||||
'$access_yap_flags'(22, 0),
|
||||
\+ '$uncaught_throw'
|
||||
->
|
||||
'$version'
|
||||
;
|
||||
true
|
||||
),
|
||||
(
|
||||
'$access_yap_flags'(22, 0) ->
|
||||
set_value('$verbose',on)
|
||||
;
|
||||
set_value('$verbose',off)
|
||||
),
|
||||
(
|
||||
retractall(user:library_directory(_)),
|
||||
'$system_library_directories'(D),
|
||||
|
@ -320,16 +320,24 @@ yap_flag(tabling_mode,Options) :-
|
||||
|
||||
yap_flag(informational_messages,X) :- var(X), !,
|
||||
get_value('$verbose',X).
|
||||
yap_flag(informational_messages,on) :- !, set_value('$verbose',on).
|
||||
yap_flag(informational_messages,off) :- !, set_value('$verbose',off).
|
||||
yap_flag(informational_messages,on) :- !,
|
||||
set_value('$verbose',on),
|
||||
'$set_yap_flags'(22,0).
|
||||
yap_flag(informational_messages,off) :- !,
|
||||
set_value('$verbose',off),
|
||||
'$set_yap_flags'(22,1).
|
||||
yap_flag(informational_messages,X) :-
|
||||
'$do_error'(domain_error(flag_value,informational_messages+X),yap_flag(informational_messages,X)).
|
||||
|
||||
yap_flag(verbose,X) :- var(X), !,
|
||||
get_value('$verbose',X0),
|
||||
(X0 == on -> X = normal ; X = silent).
|
||||
yap_flag(verbose,normal) :- !, set_value('$verbose',on).
|
||||
yap_flag(verbose,silent) :- !, set_value('$verbose',off).
|
||||
yap_flag(verbose,normal) :- !,
|
||||
set_value('$verbose',on),
|
||||
'$set_yap_flags'(22,0).
|
||||
yap_flag(verbose,silent) :- !,
|
||||
set_value('$verbose',off),
|
||||
'$set_yap_flags'(22,1).
|
||||
yap_flag(verbose,X) :-
|
||||
'$do_error'(domain_error(flag_value,verbose+X),yap_flag(verbose,X)).
|
||||
|
||||
|
Reference in New Issue
Block a user