add timezone flag

This commit is contained in:
Vitor Santos Costa 2011-08-16 13:31:19 +00:00
parent 2ab46f753d
commit 2256c3bf8b
2 changed files with 14 additions and 0 deletions

View File

@ -74,7 +74,9 @@ too much.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef __YAP_PROLOG__ #ifndef __YAP_PROLOG__
static void setArgvPrologFlag(void); static void setArgvPrologFlag(void);
#endif
static void setTZPrologFlag(void); static void setTZPrologFlag(void);
#ifndef __YAP_PROLOG__
static void setVersionPrologFlag(void); static void setVersionPrologFlag(void);
#endif #endif
static atom_t lookupAtomFlag(atom_t key); static atom_t lookupAtomFlag(atom_t key);
@ -1111,7 +1113,9 @@ initPrologFlags(void)
#ifndef __YAP_PROLOG__ #ifndef __YAP_PROLOG__
setArgvPrologFlag(); setArgvPrologFlag();
#endif /* YAP_PROLOG */
setTZPrologFlag(); setTZPrologFlag();
#ifndef __YAP_PROLOG__
setOSPrologFlags(); setOSPrologFlags();
setVersionPrologFlag(); setVersionPrologFlag();
#endif /* YAP_PROLOG */ #endif /* YAP_PROLOG */
@ -1141,6 +1145,8 @@ setArgvPrologFlag()
PL_discard_foreign_frame(fid); PL_discard_foreign_frame(fid);
} }
#endif
static void static void
setTZPrologFlag() setTZPrologFlag()
{ tzset(); { tzset();
@ -1148,6 +1154,7 @@ setTZPrologFlag()
setPrologFlag("timezone", FT_INTEGER|FF_READONLY, timezone); setPrologFlag("timezone", FT_INTEGER|FF_READONLY, timezone);
} }
#ifndef __YAP_PROLOG__
static void static void
setVersionPrologFlag(void) setVersionPrologFlag(void)

View File

@ -288,6 +288,12 @@ yap_flag(informational_messages,off) :- !,
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(timezone,X) :-
var(X), !,
'$swi_current_prolog_flag'(timezone, X).
yap_flag(timezone,X) :-
'$swi_set_prolog_flag'(timezone, 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).
@ -885,6 +891,7 @@ yap_flag(dialect,yap).
'$yap_system_flag'(strict_iso). '$yap_system_flag'(strict_iso).
'$yap_system_flag'(syntax_errors). '$yap_system_flag'(syntax_errors).
'$yap_system_flag'(system_options). '$yap_system_flag'(system_options).
'$yap_system_flag'(timezone).
'$yap_system_flag'(to_chars_mode). '$yap_system_flag'(to_chars_mode).
'$yap_system_flag'(toplevel_hook). '$yap_system_flag'(toplevel_hook).
'$yap_system_flag'(toplevel_print_options). '$yap_system_flag'(toplevel_print_options).