git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2150 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2008-03-13 18:41:52 +00:00
parent abbfff0917
commit 3101d1ff61
10 changed files with 64 additions and 10 deletions

View File

@ -10,8 +10,11 @@
* File: c_interface.c * * File: c_interface.c *
* comments: c_interface primitives definition * * 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 $ * $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 * Revision 1.105 2008/01/28 10:42:19 vsc
* fix BOM trouble * fix BOM trouble
* *
@ -1681,6 +1684,9 @@ YAP_Init(YAP_init_args *yap_init)
yap_init->DelayedReleaseLoad yap_init->DelayedReleaseLoad
); );
Yap_InitExStacks (Trail, Stack); Yap_InitExStacks (Trail, Stack);
if (yap_init->QuietMode) {
yap_flags[QUIET_MODE_FLAG] = TRUE;
}
{ BACKUP_MACHINE_REGS(); { BACKUP_MACHINE_REGS();
Yap_InitYaamRegs(); Yap_InitYaamRegs();
@ -1773,6 +1779,9 @@ YAP_Init(YAP_init_args *yap_init)
if (yap_init->YapPrologAddPath) { if (yap_init->YapPrologAddPath) {
Yap_PutValue(Yap_FullLookupAtom("$extend_file_search_path"), MkAtomTerm(Yap_LookupAtom(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 || if (yap_init->SavedState != NULL ||
yap_init->YapPrologBootFile == NULL) { yap_init->YapPrologBootFile == NULL) {
if (restore_result == FAIL_RESTORE) { if (restore_result == FAIL_RESTORE) {
@ -1816,6 +1825,7 @@ YAP_FastInit(char saved_state[])
init_args.Argv = NULL; init_args.Argv = NULL;
init_args.ErrorNo = 0; init_args.ErrorNo = 0;
init_args.ErrorCause = NULL; init_args.ErrorCause = NULL;
init_args.QuietMode = FALSE;
out = YAP_Init(&init_args); out = YAP_Init(&init_args);
if (out == YAP_BOOT_FROM_SAVED_ERROR) { if (out == YAP_BOOT_FROM_SAVED_ERROR) {
Yap_Error(init_args.ErrorNo,TermNil,init_args.ErrorCause); Yap_Error(init_args.ErrorNo,TermNil,init_args.ErrorCause);

View File

@ -859,6 +859,7 @@ InitFlags(void)
/* current default */ /* current default */
yap_flags[INDEXING_MODE_FLAG] = INDEX_MODE_MULTI; yap_flags[INDEXING_MODE_FLAG] = INDEX_MODE_MULTI;
yap_flags[TABLING_MODE_FLAG] = 0; yap_flags[TABLING_MODE_FLAG] = 0;
yap_flags[QUIET_MODE_FLAG] = FALSE;
} }
static void static void

View File

@ -1398,7 +1398,7 @@ commit_to_saved_state(char *s, CELL *Astate, CELL *ATrail, CELL *AStack, CELL *A
return(FAIL_RESTORE); return(FAIL_RESTORE);
Yap_PrologMode = BootMode; Yap_PrologMode = BootMode;
if (Yap_HeapBase) { 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); Yap_TrueFileName(s,Yap_FileNameBuf2, YAP_FILENAME_MAX);
fprintf(stderr, "%% Restoring file %s\n", Yap_FileNameBuf2); fprintf(stderr, "%% Restoring file %s\n", Yap_FileNameBuf2);
} }

View File

@ -10,7 +10,7 @@
* File: Yap.h.m4 * * File: Yap.h.m4 *
* mods: * * mods: *
* comments: main header file for YAP * * 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" #include "config.h"
@ -521,8 +521,9 @@ typedef enum
INDEXING_MODE_FLAG = 19, INDEXING_MODE_FLAG = 19,
TABLING_MODE_FLAG = 20, TABLING_MODE_FLAG = 20,
VARS_CAN_HAVE_QUOTE_FLAG = 21, VARS_CAN_HAVE_QUOTE_FLAG = 21,
QUIET_MODE_FLAG = 22,
/* let this be the last one */ /* let this be the last one */
LAST_FLAG = 22 LAST_FLAG = 23
} yap_flags; } yap_flags;
#define STRING_AS_CHARS 0 #define STRING_AS_CHARS 0

View File

@ -17,6 +17,10 @@ xb
<h2>Yap-5.1.3:</h2> <h2>Yap-5.1.3:</h2>
<ul> <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 <li> NEW: verbose prolog_flag fixes silent (obs from Nicos
Angelopoulos).</li> Angelopoulos).</li>
<li> FIXED: true_file_name/3 was totally broken (obs from Nicos Angelopoulos).</li> <li> FIXED: true_file_name/3 was totally broken (obs from Nicos Angelopoulos).</li>

View File

@ -233,8 +233,10 @@ print_usage(void)
fprintf(stderr,"\n[ Valid switches for command line arguments: ]\n"); fprintf(stderr,"\n[ Valid switches for command line arguments: ]\n");
fprintf(stderr," -? Shows this screen\n"); fprintf(stderr," -? Shows this screen\n");
fprintf(stderr," -b Boot file \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," -g Run Goal Before Top-Level \n");
fprintf(stderr," -z 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 load Prolog file\n");
fprintf(stderr," -L run Prolog file and exit\n"); fprintf(stderr," -L run Prolog file and exit\n");
fprintf(stderr," -p extra path for file-search-path\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 '?': case '?':
print_usage(); print_usage();
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
case 'q':
iap->QuietMode = TRUE;
break;
case 'w': case 'w':
ssize = &(iap->NumberWorkers); ssize = &(iap->NumberWorkers);
goto GetSize; goto GetSize;
@ -432,6 +437,7 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
break; break;
#endif #endif
case 'L': case 'L':
iap->QuietMode = TRUE;
iap->HaltAfterConsult = TRUE; iap->HaltAfterConsult = TRUE;
case 'l': case 'l':
p++; p++;
@ -590,6 +596,7 @@ init_standard_system(int argc, char *argv[], YAP_init_args *iap)
#endif #endif
iap->ErrorNo = 0; iap->ErrorNo = 0;
iap->ErrorCause = NULL; iap->ErrorCause = NULL;
iap->QuietMode = FALSE;
BootMode = parse_yap_arguments(argc,argv,iap); BootMode = parse_yap_arguments(argc,argv,iap);

View File

@ -890,6 +890,10 @@ the predicate '$live'/0.
connect standard streams to host @t{IP_HOST} at port @t{port} connect standard streams to host @t{IP_HOST} at port @t{port}
@item filename @item filename
restore state saved in the given file restore state saved in the given file
@item -f
do not consult initial files
@item -q
do not print informational messages
@item -- @item --
separator for arguments to Prolog code. These arguments are visible separator for arguments to Prolog code. These arguments are visible
through the unix/1 built-in. 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 Succeed if the second argument @var{Var} is a variable and occurs in
term @var{Term}. 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 @end table
@node Tries, Cleanup, Terms, Library @node Tries, Cleanup, Terms, Library

View File

@ -114,6 +114,8 @@ typedef struct {
int Argc; int Argc;
/* array of arguments as seen by Prolog */ /* array of arguments as seen by Prolog */
char **Argv; char **Argv;
/* QuietMode */
int QuietMode;
#ifdef MYDDAS_MYSQL #ifdef MYDDAS_MYSQL
/* If any myddas option was given */ /* If any myddas option was given */
short myddas; short myddas;

View File

@ -40,11 +40,20 @@ true :- true.
'$change_alias_to_stream'('$loop_stream','$stream'(0)), '$change_alias_to_stream'('$loop_stream','$stream'(0)),
% do catch as early as possible % 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' '$version'
; ;
true true
), ),
(
'$access_yap_flags'(22, 0) ->
set_value('$verbose',on)
;
set_value('$verbose',off)
),
( (
retractall(user:library_directory(_)), retractall(user:library_directory(_)),
'$system_library_directories'(D), '$system_library_directories'(D),

View File

@ -320,16 +320,24 @@ yap_flag(tabling_mode,Options) :-
yap_flag(informational_messages,X) :- var(X), !, yap_flag(informational_messages,X) :- var(X), !,
get_value('$verbose',X). get_value('$verbose',X).
yap_flag(informational_messages,on) :- !, set_value('$verbose',on). yap_flag(informational_messages,on) :- !,
yap_flag(informational_messages,off) :- !, set_value('$verbose',off). 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) :- yap_flag(informational_messages,X) :-
'$do_error'(domain_error(flag_value,informational_messages+X),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), !, yap_flag(verbose,X) :- var(X), !,
get_value('$verbose',X0), get_value('$verbose',X0),
(X0 == on -> X = normal ; X = silent). (X0 == on -> X = normal ; X = silent).
yap_flag(verbose,normal) :- !, set_value('$verbose',on). yap_flag(verbose,normal) :- !,
yap_flag(verbose,silent) :- !, set_value('$verbose',off). 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) :- yap_flag(verbose,X) :-
'$do_error'(domain_error(flag_value,verbose+X),yap_flag(verbose,X)). '$do_error'(domain_error(flag_value,verbose+X),yap_flag(verbose,X)).