This commit is contained in:
Vitor Santos Costa 2018-11-24 10:35:19 +00:00
parent 4f7a5809d5
commit b87f0c79e9
6 changed files with 31 additions and 31 deletions

View File

@ -73,20 +73,20 @@ opportunity. Initial value is 10,000. May be changed. A value of 0
/**<
read-only boolean, a machine running an Google's Android version of the
Linux Operating System */
YAP_FLAG(ANDROID_FLAG, "android", false, booleanFlag, IN_ANDROID, NULL),
YAP_FLAG(ANDROID_FLAG, "android", false, ro, IN_ANDROID, NULL),
#if __APPLE__
/**<
read-only boolean, a machine running an Apple Operating System */
YAP_FLAG(APPLE_FLAG, "apple", false, booleanFlag, "true", NULL),
YAP_FLAG(APPLE_FLAG, "apple", false, ro, "true", NULL),
#else
YAP_FLAG(APPLE_FLAG, "apple", false, booleanFlag, "false", NULL),
YAP_FLAG(APPLE_FLAG, "apple", false, ro, "false", NULL),
#endif
/**<
read-only atom, it describes the ISA used in this version of YAP.
Available from YAP_ARCH.
*/
YAP_FLAG(ARCH_FLAG, "arch", false, isatom, YAP_ARCH, NULL),
YAP_FLAG(ARCH_FLAG, "arch", false, ro, YAP_ARCH, NULL),
YAP_FLAG(ARGV_FLAG, "argv", false, argv, "@boot", NULL),
/**<

View File

@ -586,7 +586,7 @@ static Int put_code(USES_REGS1) { /* '$put'(Stream,N) */
return (FALSE);
if (GLOBAL_Stream[sno].status & Binary_Stream_f) {
UNLOCK(GLOBAL_Stream[sno].streamlock);
Yap_Error(PERMISSION_ERROR_BINARY_STREAM, ARG1, "put/2");
Yap_Error(PERMISSION_ERROR_OUTPUT_BINARY_STREAM, ARG1, "put/2");
return (FALSE);
}

View File

@ -202,7 +202,7 @@ user:file_search_path(dataset, '.').
:- dynamic user:prolog_file_type/2.
user:prolog_file_type( db, myddas ).
user:prolog_file_type( db, dataset ).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% db_open/5
@ -213,7 +213,7 @@ user:prolog_file_type( db, myddas ).
%% @pred db_open(+Interface,-Handle,+HostDb,+User,+Password)
%% @pred db_open(+Interface,+HostDb,+User,+Password)
%
% Connect to a database-server, or open a file as a database, Paraameters are:
% Connect to a database-server, or open a file as a database, Parameters are:
%
% _Interface_ : a supported server, it may be one of mysql, odbc, postgres, sqlite3.
% _Handle_ : a name that refers to the database-conectionn. By default is `myddas`,
@ -225,7 +225,7 @@ user:prolog_file_type( db, myddas ).
%
db_open(Interface,HostDb,User,Password):-
db_open(Interface,myddas,HostDb,User,Password).
#ifdef MYDDAS_MYSQL
db_open(mysql,Connection,Host/Db/Port/Socket,User,Password) :- !,
'$error_checks'(db_open(mysql,Connection,Host/Db/Port/Socket,User,Password)),
@ -263,7 +263,7 @@ db_open(odbc,Connection,ODBCEntry,User,Password) :-
%% sqlite3
db_open(sqlite3,Connection,File,User,Password) :-
absolute_file_name(File,Db,[extensions(db),access(write),file_type(myddas),expand(true)]),
absolute_file_name(File,Db,[,access(write),file_type(myddas),expand(true)]),
'$error_checks'(db_open(sqlite3,Connection,Db,User,Password)),
c_sqlite3_connect(Db,User,Password,Con),
set_value(Connection,Con).

View File

@ -7,27 +7,27 @@
:- begin_tests(sqlite3).
%:- if( yap_flag(android,true) ).
%test(open) :-
% db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _).
%:- else.
test(open) :-
db_open(sqlite3,dataset('chinook'),_,_).
%:-endif.
:- if( current_prolog_flag(android,true) ).
test(db_open) :-
db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _).
:- else.
test(db_open) :-
db_open(sqlite3,con,dataset('chinook.db'),_,_).
:-endif.
test(schema0, all((Tables ==[(table albums),
(table artists),
(table customers),
(table employees),
(table genres),
(table invoice_items),
(table invoices),
(table media_types),
(table playlist_track),
(table playlists),
(table sqlite_sequence),
(table sqlite_stat1),(table tracks)]))) :-
findall( Desc, db_show_tables(Desc), Tables).
test(schema0, all((Desc ==[(albums),
(artists),
(customers),
(employees),
(genres),
(invoice_items),
(invoices),
(media_types),
(playlist_track),
(playlists),
(sqlite_sequence),
(sqlite_stat1),(tracks)]))) :-
db_show_tables(con,Desc).
test(import) :-
db_import('artists', artists),

View File

@ -476,7 +476,7 @@ If this hook preodicate succeeds it must instantiate the _Action_ argument to t
:- ensure_loaded('../pl/pathconf.yap').
:- ensure_loaded('../pl/android.yap').
:- current_prolog_fkag(android,true), ensure_loaded('../pl/android.yap').

View File

@ -513,7 +513,7 @@ debugging.
*/
break :-
'$debug_state'(DState),
'$debug_start',
'$debug_stop',
'$break'( true ),
current_output(OutStream), current_input(InpStream),
current_prolog_flag(break_level, BL ),