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 read-only boolean, a machine running an Google's Android version of the
Linux Operating System */ 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__ #if __APPLE__
/**< /**<
read-only boolean, a machine running an Apple Operating System */ 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 #else
YAP_FLAG(APPLE_FLAG, "apple", false, booleanFlag, "false", NULL), YAP_FLAG(APPLE_FLAG, "apple", false, ro, "false", NULL),
#endif #endif
/**< /**<
read-only atom, it describes the ISA used in this version of YAP. read-only atom, it describes the ISA used in this version of YAP.
Available from YAP_ARCH. 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), 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); return (FALSE);
if (GLOBAL_Stream[sno].status & Binary_Stream_f) { if (GLOBAL_Stream[sno].status & Binary_Stream_f) {
UNLOCK(GLOBAL_Stream[sno].streamlock); 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); return (FALSE);
} }

View File

@ -202,7 +202,7 @@ user:file_search_path(dataset, '.').
:- dynamic user:prolog_file_type/2. :- dynamic user:prolog_file_type/2.
user:prolog_file_type( db, myddas ). user:prolog_file_type( db, dataset ).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% db_open/5 % 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,-Handle,+HostDb,+User,+Password)
%% @pred db_open(+Interface,+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. % _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`, % _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,HostDb,User,Password):-
db_open(Interface,myddas,HostDb,User,Password). db_open(Interface,myddas,HostDb,User,Password).
#ifdef MYDDAS_MYSQL #ifdef MYDDAS_MYSQL
db_open(mysql,Connection,Host/Db/Port/Socket,User,Password) :- !, db_open(mysql,Connection,Host/Db/Port/Socket,User,Password) :- !,
'$error_checks'(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 %% sqlite3
db_open(sqlite3,Connection,File,User,Password) :- 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)), '$error_checks'(db_open(sqlite3,Connection,Db,User,Password)),
c_sqlite3_connect(Db,User,Password,Con), c_sqlite3_connect(Db,User,Password,Con),
set_value(Connection,Con). set_value(Connection,Con).

View File

@ -7,27 +7,27 @@
:- begin_tests(sqlite3). :- begin_tests(sqlite3).
%:- if( yap_flag(android,true) ). :- if( current_prolog_flag(android,true) ).
%test(open) :- test(db_open) :-
% db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _). db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _).
%:- else. :- else.
test(open) :- test(db_open) :-
db_open(sqlite3,dataset('chinook'),_,_). db_open(sqlite3,con,dataset('chinook.db'),_,_).
%:-endif. :-endif.
test(schema0, all((Tables ==[(table albums), test(schema0, all((Desc ==[(albums),
(table artists), (artists),
(table customers), (customers),
(table employees), (employees),
(table genres), (genres),
(table invoice_items), (invoice_items),
(table invoices), (invoices),
(table media_types), (media_types),
(table playlist_track), (playlist_track),
(table playlists), (playlists),
(table sqlite_sequence), (sqlite_sequence),
(table sqlite_stat1),(table tracks)]))) :- (sqlite_stat1),(tracks)]))) :-
findall( Desc, db_show_tables(Desc), Tables). db_show_tables(con,Desc).
test(import) :- test(import) :-
db_import('artists', artists), 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/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 :- break :-
'$debug_state'(DState), '$debug_state'(DState),
'$debug_start', '$debug_stop',
'$break'( true ), '$break'( true ),
current_output(OutStream), current_input(InpStream), current_output(OutStream), current_input(InpStream),
current_prolog_flag(break_level, BL ), current_prolog_flag(break_level, BL ),