- install missing includes

- path handling  in python
- android-only stuff,
This commit is contained in:
Vitor Santos Costa 2018-03-19 23:01:55 +00:00
parent 1b2aa6417c
commit 98d52ba347
8 changed files with 14 additions and 74 deletions

View File

@ -2,6 +2,7 @@ set (YAPOS_HEADERS
getw.h
iopreds.h
yapio.h
encoding.h
)
set (YAPOS_SOURCES

View File

@ -99,6 +99,7 @@ static bool myddas_initialised;
/* Initialize all of the MYDDAS global structures */
static Int c_db_initialize_myddas(USES_REGS1) {
if (!myddas_initialised) {
myddas_initialised= true;
init_myddas();
}
Yap_REGS.MYDDAS_GLOBAL_POINTER = myddas_init_initialize_myddas();
@ -681,8 +682,9 @@ void init_myddas(void) {
CACHE_REGS
if (myddas_initialised)
return;
init_sqlite3();
myddas_initialised = TRUE;
#ifdef __ANDROID__
init_sqlite3();
#endif
#if defined MYDDAS_ODBC
Yap_InitBackMYDDAS_ODBCPreds();
#endif
@ -710,6 +712,7 @@ void init_myddas(void) {
Yap_MYDDAS_delete_all_myddas_structs();
#endif
c_db_initialize_myddas(PASS_REGS1);
myddas_initialised = TRUE;
}
#ifdef _WIN32
@ -732,4 +735,3 @@ int WINAPI win_myddas(HANDLE hinst, DWORD reason, LPVOID reserved) {
return 1;
}
#endif

View File

@ -72,7 +72,7 @@ foreach (driver ${MYDDAS_DBMS})
cpp_driver(MYDDAS_YAP ${driver} myddas_driver.ypp)
endforeach ()
list (APPEND MYDDAS_YAP ${CMAKE_CURRENT_SOURCE_DIR}/../sqlite3/test.yap ${CMAKE_CURRENT_SOURCE_DIR}/../sqlite3/chinook.db)
#list (APPEND MYDDAS_YAP ${CMAKE_CURRENT_SOURCE_DIR}/../sqlite3/test.yap ${CMAKE_CURRENT_SOURCE_DIR}/../sqlite3/chinook.db)
add_to_group(MYDDAS_YAP pl_library )
add_custom_target(plmyddas ALL DEPENDS ${MYDDAS_YAP} )

View File

@ -54,5 +54,5 @@ install(TARGETS sqlite4YAP
)
endif()
file (INSTALL chinook.db test.yap DESTINATION ${libpl})
# file (INSTALL chinook.db test.yap DESTINATION ${libpl})

View File

@ -88,64 +88,15 @@ static Int c_sqlite3_connect(USES_REGS1) {
CALL_SQLITE(ARG1, open(file, &db));
if (!Yap_unify(arg_db, MkAddressTerm(db)))
if (!Yap_unify(arg_db, MkAddressTerm(db))) {
return FALSE;
else {
} else {
/* Criar um novo no na lista de ligacoes*/
new = myddas_util_add_connection(db, NULL, API_SQLITE3);
if (new == NULL) {
#ifdef DEBUG
fprintf(stderr, "ERROR: ** c_db_my_connect ** Error allocating memory\n");135761 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4011d 240 0 FAIL RETRY: prolog:$user_expansion(user:main, _135757:_135758 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4012d 173 0 CALL: prolog:$import_expansion(user:main, _135760:_135761 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4013d 239 0 CALL: prolog:$imported_predicate(main, user, _135761, _135760 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4014d 255 0 CALL: prolog:$is_system_predicate(main, prolog )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4015d 255 0 FAIL RETRY: prolog:$imported_predicate(main, user, _135761, _135760 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4016d 239 0 CALL: prolog:$undefined(main, user )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4017d 239 0 FAIL RETRY: prolog:$import_expansion(user:main, _135760:_135761 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4018d 173 0 CALL: prolog:$meta_expansion(user:main, user, [], _1048348 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4019d 238 0 CALL: prolog:$yap_strip_module(user:main, _135763, _1048327 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4020d 238 0 CALL: prolog:functor(main, _135766, _135767 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4021d 238 0 CALL: prolog:$meta_predicate(main, user, 0, _1048328 )
03-16 17:31:30.590 25588-25588/? E/YAPDroid: 4022d 238 0 FAIL RETRY: prolog:$meta_expansion(user:main, user, [], _1048348 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4023d 173 0 CALL: prolog:$yap_strip_module(user:main, _135763, _135764 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4024d 173 0 CALL: prolog:$yap_strip_module(user:main, _135765, _135766 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4025d 173 0 CALL: prolog:$end_goal_expansion(main, _135738, _135740, user, user, user, :-user:main )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4026d 173 0 CALL: prolog:$match_mod(main, user, user, user, _135738 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4027d 173 0 CALL: prolog:$is_system_predicate(main, user )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4028d 173 0 TRY_OR
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4029d 216 0 CALL: prolog:==(user, user )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4030d 216 0 CALL: prolog:==(user, user )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4031d 173 0 CALL: prolog:$c_built_in(main, user, :-user:main, _1048378 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4032d 209 0 CALL: prolog:get_value('$c_arith', true )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4033d 173 0 CALL: prolog:do_c_built_in(main, user, :-user:main, _1048378 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4034d 220 0 CALL: prolog:$compop(main, _1048340, _1048341, _1048343 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4035d 220 0 FAIL RETRY: prolog:do_c_built_in(main, user, :-user:main, _1048378 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4036d 220 0 CALL: prolog:$yap_strip_module(user:main, _135770, _135771 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4037d 220 0 CALL: prolog:$match_mod(main, user, user, user, _135740 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4038d 220 0 CALL: prolog:$is_system_predicate(main, user )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4039d 220 0 TRY_OR
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4040d 236 0 CALL: prolog:==(user, user )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4041d 236 0 CALL: prolog:==(user, user )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4042d 220 0 CALL: prolog:$yap_strip_module(user: (:-main), _135727, _135728 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4043d 158 0 TRY_OR
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4044d 172 0 CALL: prolog:==(158, 158 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4045d 105 0 CALL: prolog:$yap_strip_module(user: (:-main), _1048434, _135775 )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4046d 105 0 TRY_OR
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4047d 105 0 CALL: prolog:$process_directive(main, reconsult, user, [], '$stream_position'(1342,80,1,0) )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4048d 130 0 FAIL RETRY: prolog:$process_directive(main, reconsult, user, [], '$stream_position'(1342,80,1,0) )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4049d 130 0 FAIL RETRY: prolog:$process_directive(main, reconsult, user, [], '$stream_position'(1342,80,1,0) )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4050d 130 0 CALL: prolog:$all_directives(main )
03-16 17:31:30.591 25588-25588/? E/YAPDroid: 4051d 130 0 CALL: prolog:$directive(main )
03-16 17:31:30.592 25588-25588/? E/YAPDroid: 4052d 130 0 FAIL RETRY: prolog:$process_directive(main, reconsult, user, [], '$stream_position'(1342,80,1,0) )
03-16 17:31:30.592 25588-25588/? E/YAPDroid: 4053d 130 0 CALL: prolog:current_prolog_flag(language_mode, iso )
03-16 17:31:30.592 25588-25588/? E/YAPDroid: 4054d 130 0 FAIL RETRY: prolog:$process_directive(main, reconsult, user, [], '$stream_position'(1342,80,1,0) )
03-16 17:31:30.592 25588-25588/? E/YAPDroid: 4055d 130 0 CALL: prolog:$execute(user:main )
03-16 17:31:30.592 25588-25588/? E/YAPDroid: 4056d 130 0 CALL: user:main
03-16 17:31:30.592 25588-25588/? E/YAPDroid: 4057d 130 0 CALL: user:init
03-16 17:31:30.592 25588-25588/? E/YAPDroid: 4058d 130 0 CALL: user:db_open(sqlite3, '/data/user/0/pt.up.yap.yapdroid/files/Yap/chinook.db', _1048428, _1048429 )
03-16 17:31:30.592 25588-25588/? E/YAPDroid: 4059d 130 0 CALL: user:db_open(sqlite3, myddas, '/data/user/0/pt.up.yap.yapdr
fprintf(stderr, "ERROR: ** c_db_my_connect ** Error allocating memory\n");
#endif
return FALSE;
}
@ -714,17 +665,10 @@ static void Yap_InitBackMYDDAS_SQLITE3Preds(void) {
X_API void init_sqlite3(void) {
Yap_InitMYDDAS_SQLITE3Preds();
Yap_InitBackMYDDAS_SQLITE3Preds();
}
#if _ANDROID_
//JNIEXPORT void JNICALL lib_yap_up_pt_init_sqlite(JNIEnv *env);
// JNIEXPORT void JNICALL lib_yap_up_pt_init_sqlite(JNIEnv *env) {
init_sqlite3();
}
#endif
#ifdef _WIN32

View File

@ -19,7 +19,7 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/yap4py)
set(YAP4PY_PL prolog/yapi.yap)
set(YAP4PY_PY yap4py/__main__.py yap4py/yapi.py)
configure_file("setup.py.in" setup.py)
configure_file("setup.py.in" ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
configure_file("MANIFEST.in" ${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.in)
configure_file("YAP4PY.md" README.md)
configure_file(yap4py/__init__.py.in yap4py/__init__.py)

View File

@ -69,7 +69,7 @@ elif platform.system() == 'Darwin':
win_libs = []
local_libs = ['Py4YAP']
elif platform.system() == 'Linux':
my_extra_link_args = ['-L','..','-Wl,-rpath,'+abspath(join(sysconfig.get_path('platlib'),'yap4py')),'-Wl,-rpath,${CMAKE_INSTALL_FULL_LIBDIR}','-Wl,-rpath,../yap4py']
my_extra_link_args = ['-L','..','-Wl,-rpath,'+abspath(join(sysconfig.get_path('platlib'),'yap4py')),'-Wl,-rpath,@CMAKE_INSTALL_FULL_LIBDIR@','-Wl,-rpath,'+join('@CMAKE_INSTALL_FULL_LIBDIR@','..'),'-Wl,-rpath,../yap4py']
win_libs = []
local_libs = ['Py4YAP']

View File

@ -463,10 +463,3 @@ If this hook preodicate succeeds it must instantiate the _Action_ argument to t
:- yap_flag(user:unknown,error).
:- compile('../myddas').
:- start_low_level_trace.
%:- db_open(sqlite3, '/asssets/Yap/chinook.db', _, _).
:- compile('../test').