more SWI style flags: associate and shared_object_extension.

This commit is contained in:
Vítor Santos Costa 2011-06-22 12:27:05 +01:00
parent dba2fd398f
commit 0b6b471359
2 changed files with 35 additions and 0 deletions

View File

@ -7891,6 +7891,12 @@ atom-garbage collection, perform atom garbage collection at the first
opportunity. Initial value is 10,000. May be changed. A value of 0 opportunity. Initial value is 10,000. May be changed. A value of 0
(zero) disables atom garbage collection. (zero) disables atom garbage collection.
@item associate
@findex associate (yap_flag/2 option)
@*
Read-write flag telling a suffix for files associated to Prolog
sources. It is @code{yap} by default.
@item bounded [ISO] @item bounded [ISO]
@findex bounded (yap_flag/2 option) @findex bounded (yap_flag/2 option)
@* @*
@ -8141,6 +8147,10 @@ and if it is bound to @code{off} disable them. The default for YAP is
Name of the environment variable used by the system to search for shared Name of the environment variable used by the system to search for shared
objects. objects.
@item shared_object_extension
@findex shared_object_extension (yap_flag/2 option)
Suffix associated with loadable code.
@item single_var_warnings @item single_var_warnings
@findex single_var_warnings (yap_flag/2 option) @findex single_var_warnings (yap_flag/2 option)
@* @*

View File

@ -192,6 +192,30 @@ yap_flag(open_shared_object,X) :-
yap_flag(open_shared_object,X) :- yap_flag(open_shared_object,X) :-
'$do_error'(domain_error(flag_value,open_shared_object+X),yap_flag(open_shared_object,X)). '$do_error'(domain_error(flag_value,open_shared_object+X),yap_flag(open_shared_object,X)).
yap_flag(open_shared_object,X) :-
var(X), !,
('$open_shared_objects' -> X = true ; X = false).
yap_flag(open_shared_object,X) :-
(X = true ; X = false), !,
'$do_error'(permission_error(modify,flag,open_shared_object),yap_flag(open_shared_object,X)).
yap_flag(open_shared_object,X) :-
'$do_error'(domain_error(flag_value,open_shared_object+X),yap_flag(open_shared_object,X)).
yap_flag(shared_object_extension,X) :-
'$obj_suffix'([_|String]),
atom_codes(X, String).
:- set_value('$associate',yap).
yap_flag(associate,X) :-
var(X), !,
get_value('$associate',X).
yap_flag(associate,X) :-
atom(X), !,
set_value('$associate',X).
yap_flag(bounded,X) :-
'$do_error'(type_error(atom,X),associate(X)).
yap_flag(bounded,X) :- yap_flag(bounded,X) :-
var(X), !, var(X), !,
'$access_yap_flags'(0, X1), '$access_yap_flags'(0, X1),
@ -855,6 +879,7 @@ yap_flag(dialect,yap).
'$yap_system_flag'(readline). '$yap_system_flag'(readline).
'$yap_system_flag'(redefine_warnings). '$yap_system_flag'(redefine_warnings).
'$yap_system_flag'(shared_object_search_path). '$yap_system_flag'(shared_object_search_path).
'$yap_system_flag'(shared_object_extension).
'$yap_system_flag'(single_var_warnings). '$yap_system_flag'(single_var_warnings).
'$yap_system_flag'(stack_dump_on_error). '$yap_system_flag'(stack_dump_on_error).
'$yap_system_flag'(strict_iso). '$yap_system_flag'(strict_iso).