diff --git a/H/YapGFlagInfo.h b/H/YapGFlagInfo.h index 2b998c1a5..64d3c279a 100644 --- a/H/YapGFlagInfo.h +++ b/H/YapGFlagInfo.h @@ -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), /**< diff --git a/os/charsio.c b/os/charsio.c index 22520f244..f199a9544 100644 --- a/os/charsio.c +++ b/os/charsio.c @@ -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); } diff --git a/packages/myddas/pl/myddas.ypp b/packages/myddas/pl/myddas.ypp index dcc33c499..8a3a47772 100644 --- a/packages/myddas/pl/myddas.ypp +++ b/packages/myddas/pl/myddas.ypp @@ -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). diff --git a/packages/myddas/sqlite3/sqlitest.yap b/packages/myddas/sqlite3/sqlitest.yap index 3a99d7cb2..7c5124355 100644 --- a/packages/myddas/sqlite3/sqlitest.yap +++ b/packages/myddas/sqlite3/sqlitest.yap @@ -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), diff --git a/pl/boot.yap b/pl/boot.yap index 6d2693c10..e57399718 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -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'). diff --git a/pl/control.yap b/pl/control.yap index 1945e8591..e1f0aad3d 100644 --- a/pl/control.yap +++ b/pl/control.yap @@ -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 ),