android debugging plus clean-ups

This commit is contained in:
Vítor Santos Costa
2015-04-13 13:28:17 +01:00
parent d1a230eb56
commit ef586e264e
77 changed files with 2346 additions and 4054 deletions

View File

@@ -29,7 +29,7 @@ Constraints supported are:
:- module(gecode_clpfd, [
op(100, yf, []),
op(100, yf, []),
op(760, yfx, #<==>),
op(750, xfy, #==>),
op(750, yfx, #<==),
@@ -116,7 +116,7 @@ Constraints supported are:
]).
/** @pred _X_ #< _B_ is det
reified implication
reified implication
As an example. consider finding out the people who wanted to sit
next to a friend and that are are actually sitting together:
@@ -127,7 +127,7 @@ preference_satisfied(X-Y, B) :-
~~~~~
Note that not all constraints may be reifiable.
*/
/** @pred _X_ #< _Y_ is semidet
smaller or equal
@@ -137,7 +137,7 @@ Arguments to this constraint may be an arithmetic expression with <tt>+</tt>,
<tt>count</tt>, and
<tt>abs</tt>. Boolean variables support conjunction (/\), disjunction (\/),
implication (=>), equivalence (<=>), and xor. The <tt>sum</tt> constraint allows a two argument version using the
`where` conditional, in Zinc style.
`where` conditional, in Zinc style.
The send more money equation may be written as:
@@ -157,35 +157,35 @@ OutFlow[I] #= sum(J in 1..N where D[J,I]<M, X[J,I])
The <tt>count</tt> constraint counts the number of elements that match a
certain constant or variable (integer sets are not available).
*/
/** @pred _X_ #<==> _B_ is det
reified equivalence
*/
/** @pred _X_ #= _Y_ is semidet
equality
*/
/** @pred _X_ #=< _Y_ is semidet
smaller
*/
/** @pred _X_ #==> _B_ is det
Reified implication
*/
/** @pred _X_ #> _Y_ is semidet
larger
*/
/** @pred _X_ #>= _Y_ is semidet
larger or equal
*/
/** @pred _X_ #\= _Y_ is semidet
disequality
*/
/** @pred labeling( _Opts_, _Xs_)
performs labeling, several variable and value selection options are
@@ -217,14 +217,14 @@ median
all value starting from the minimum.
*/
/** @pred scalar_product(+ _Cs_, + _Vs_, + _Rel_, ? _V_ )
The product of constant _Cs_ by _Vs_ must be in relation
_Rel_ with _V_ .
*/
:- use_module(library(gecode)).
@@ -341,7 +341,7 @@ process_constraints(B, B, _Env).
post( rel(NA, (#=)), Env, _).
/** @pred _X_ #= is det
all elements of _X_ must take the same value
*/
( A #\= ) :-
get_home(Env),
@@ -350,7 +350,7 @@ all elements of _X_ must take the same value
/** @pred _X_ #< is det
elements of _X_ must be decreasing or equal
*/
( A #< ) :-
get_home(Env),
@@ -358,7 +358,7 @@ elements of _X_ must be decreasing or equal
post( rel(NA, (#<)), Env, _).
/** @pred _X_ #> is det
elements of _X_ must be increasing
*/
( A #> ) :-
get_home(Env),
@@ -366,7 +366,7 @@ elements of _X_ must be increasing
post( rel(NA, (#>)), Env, _).
/** @pred _X_ #=< is det
elements of _X_ must be decreasing
*/
( A #=< ) :-
get_home(Env),
@@ -374,7 +374,7 @@ elements of _X_ must be decreasing
post( rel(NA, (#=<) ), Env, _).
/** @pred _X_ #>= is det
elements of _X_ must be increasinga or equal
*/
( A #>= ) :-
get_home(Env),
@@ -537,7 +537,7 @@ clause( or, Ps, Ns, V ) :-
labeling(Opts, Xs) :-
get_home(Space-Map),
foldl2( processs_lab_opt, Opts, 'INT_VAR_SIZE_MIN', BranchVar, 'INT_VAL_MIN', BranchVal),
foldl2( processs_lab_opt, Opts, 'INT_VAR_SIZE_MIN', BranchVar, 'INT_VAL_MIN', BranchVal),
term_variables(Xs, Vs),
check( Vs, X1s ),
( X1s == [] -> true ;
@@ -602,7 +602,7 @@ post( rel( A, Op), Space-Map, Reify):-
(var(Reify) -> Space += rel(IA, GOP) ;
Space += rel(IA, GOP, Reify) ).
% X #< Y
% X #< Y
% X #< 2
post( rel( A, Op, B), Space-Map, Reify):-
var(A),
@@ -672,12 +672,12 @@ post( rel(A1+A2, Op, B), Space-Map, Reify):-
(var(Reify) ->
( checklist(is_one, CAs) ->
Space += linear(As, GOP, B0);
Space += linear(CAs, As, GOP, B0)
Space += linear(CAs, As, GOP, B0)
)
;
( checklist(is_one, CAs) ->
Space += linear(As, GOP, B0, Reify);
Space += linear(CAs, As, GOP, B0, Reify)
Space += linear(CAs, As, GOP, B0, Reify)
)
).
@@ -689,18 +689,18 @@ post( rel(A1-A2, Op, B), Space-Map, Reify):-
(var(Reify) ->
( checklist(is_one, CAs) ->
Space += linear(As, GOP, B0);
Space += linear(CAs, As, GOP, B0)
Space += linear(CAs, As, GOP, B0)
)
;
( checklist(is_one, CAs) ->
Space += linear(As, GOP, B0, Reify);
Space += linear(CAs, As, GOP, B0, Reify)
Space += linear(CAs, As, GOP, B0, Reify)
)
).
post( rel(A, Op, B), Space-Map, Reify):-
arith(A, Name),
A =.. [_Op,A1],
A =.. [_Op,A1],
is_list(A1), !,
( _Op = min -> true ; _Op = max ),
maplist(equality_l( Space-Map), A1, NA1),
@@ -710,7 +710,7 @@ post( rel(A, Op, B), Space-Map, Reify):-
post( rel(A, Op, B), Space-Map, Reify):-
arith(A, Name),
A =.. [_Op,A1], !,
A =.. [_Op,A1], !,
equality(A1, NA1, Space-Map),
in_c(NA1, VA1, Space-Map), !,
equality(B, B1, Space-Map),
@@ -718,7 +718,7 @@ post( rel(A, Op, B), Space-Map, Reify):-
post( rel(A, Op, B), Space-Map, Reify):-
arith(A, Name),
A =.. [_Op,A1,A2], !,
A =.. [_Op,A1,A2], !,
equality(A1, NA1, Space-Map),
in_c(NA1, VA1, Space-Map),
equality(A2, NA2, Space-Map),
@@ -828,7 +828,7 @@ reverse_arith_op( (#>=) , (#=<) ).
reverse_arith_op( (#<) , (#>) ).
reverse_arith_op( (#=<) , (#>=) ).
linearize(V, C, [A|As], As, [C|CAs], CAs, I, I, _-Map) :-
linearize(V, C, [A|As], As, [C|CAs], CAs, I, I, _-Map) :-
var(V), !,
l(V, A, Map).
linearize(A+B, C, As, Bs, CAs, CBs, I, IF, Env) :-
@@ -953,7 +953,7 @@ out_c(Name, A1, B, Op, Space-Map, Reify) :-
new_arith( Name, A1, NB, Space-Map),
gecode_arith_op( Op, BOP ),
l(NB, IB, Map),
( var(Reify) ->
( var(Reify) ->
Space += rel(IB, BOP, B)
;
Space += rel(IB, BOP, B, Reify)
@@ -988,7 +988,7 @@ out_c(Name, A1, A2, B, Op, Space-Map, Reify) :-
new_arith( Name, A1, A2, NB, Space-Map),
l(NB, IB, Map),
gecode_arith_op( Op, BOP ),
( var(Reify) ->
( var(Reify) ->
Space += rel(IB, BOP, B)
;
Space += rel(IB, BOP, B, Reify)
@@ -1198,7 +1198,7 @@ sum_l(Map, V, Min0, Min, Max0, Max) :-
in_c(A, A, _y) :-
var(A), !.
in_c(C, A, Space-Map) :-
integer(C),
integer(C),
Min is C-1,
NX := intvar(Space, Min, C),
m(A, NX, Min, C, Map),
@@ -1221,7 +1221,7 @@ init_gecode(Space-Map, new) :-
b_setval(gecode_space, Space-Map).
close_gecode(_Space, _Vs, old) :- !.
close_gecode(Space-Map, Vs0, new) :-
close_gecode(Space-Map, Vs0, new) :-
term_variables(Vs0, Vs),
selectlist(intvar(Map), Vs, CVs),
maplist(ll(Map), CVs, IVs),
@@ -1294,7 +1294,7 @@ l(NV, OV, [v(V, OV, _A, _B)|_Vs]) :-
l(NV, OV, [_|Vs]) :-
l(NV, OV, Vs).
*/
ll(Map, X, Y) :-
l(X, Y, Map).

View File

@@ -62,7 +62,7 @@ MYDDAS_PROLOG= \
myddas_assert_predicates.ypp \
myddas_mysql.ypp \
myddas_sqlite3.ypp \
myddas_top_level.ypp \
myddas_top_level.ypp \
myddas_errors.ypp \
myddas_postgres.ypp \
myddas_prolog2sql.ypp \
@@ -85,7 +85,7 @@ all: $(SOBJS) $(MYDDAS_YAP)
$(CC) -c $(CFLAGS) $< -o $@
%.yap: $(srcdir)/pl/%.ypp
$(ECPP) $(YAP_EXTRAS) -P -w $< -o $@
$(ECPP) $(YAP_EXTRAS) -P -w $< > $@
@DO_SECOND_LD@%.@SO@: $(OBJS)
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $(OBJS) @EXTRA_LIBS_FOR_DLLS@ @MYDDAS_LIBS@

View File

@@ -195,14 +195,14 @@ else
ENABLE_MYDDAS=""
fi
INCLUDE_MYDDAS="#"
OBJECTS_MYDDAS="#"
if test x"$ENABLE_MYDDAS" = x -a x"$STARTUP_ANDROID" = x
then
#in Android we have to actually include myddas in the binary
INCLUDE_MYDDAS=""
OBJECTS_MYDDAS="$(ALL_MYDDAS_OBJECTS)"
fi
AC_SUBST(PKG_MYDDAS)
AC_SUBST(INCLUDE_MYDDAS)
AC_SUBST(OBJECTS_MYDDAS)
AC_SUBST(MYDDAS_CPPFLAGS)
AC_SUBST(MYDDAS_LIBS)

View File

@@ -127,7 +127,7 @@ c_db_connection_type ( USES_REGS1 ){
switch (type) {
case API_MYSQL:
/* MYSQL Connection */
/* MYSQL Connection */
return Yap_unify(arg_type, MkAtomTerm(Yap_LookupAtom("mysql")));
case API_ODBC:
/* ODBC Connection */

View File

@@ -26,9 +26,8 @@ LOCAL_MODULE := example
LOCAL_SHARED_LIBRARIES := yap0 yap1 sqliteX yap2
LOCAL_STATIC_LIBRARIES := @abs_top_builddir@/libYap.ar
LOCAL_SRC_FILES += @abs_top_builddir@/packages/swig/android/jni/yap_wrap.cpp
LOCAL_SRC_FILES += @srcdir@/../prosqlite/c/prosqlite.c
LOCAL_C_INCLUDES := @abs_top_builddir@ @GMPDIR@/include @srcdir@/../../H @srcdir@/../../include @srcdir@/../../os @srcdir@/../../OPTYap @srcdir@/../../BEAM @srcdir@/../../CXX sqlite
LOCAL_CFLAGS := @YAP_EXTRAS@ @DEFS@ -D_YAP_NOT_INSTALLED_=1 -DDESTDIR=\"\"
LOCAL_CPP_FEATURES := rtti
# LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
LOCAL_ALLOW_UNDEFINED_SYMBOLS := false
include $(BUILD_SHARED_LIBRARY)

View File

@@ -26,11 +26,9 @@ JAVA_SQLITE="$(srcdir)/android/src/org"
SQLITE=$(JNI_SQLITE) $(JAVA_SQLITE)
PROSQLITE=$(srcdir)/../prosqlite/prolog/prosqlite.pl
PYTHON_PROGRAMS = $(srcdir)/python/demo.py
ANDROID_PROGRAMS=$(srcdir)/android/JavaYap.java $(PROSQLITE) $(SQLITE)
ANDROID_PROGRAMS=$(srcdir)/android/JavaYap.java $(SQLITE)
PROGRAMS= $(PYTHON_PROGRAMS) $(JAVA_PROGRAMS) $(ANDROID_PROGRAMS)
@@ -42,7 +40,7 @@ YAP_EXPORT_SAVED_STATE="../../startup.yss"
PYTHON_PROGRAMS = $(srcdir)/python/demo.py
ANDROID_PROGRAMS=$(srcdir)/android/JavaYap.java $(PROSQLITE) $(SQLITE)
ANDROID_PROGRAMS=$(srcdir)/android/JavaYap.java $(SQLITE)
SWIG_FILES= \
$(srcdir)/yap.i
@@ -89,9 +87,6 @@ JavaYap-debug.apk: android/libs/armeabi/libexample.so
android/libs/armeabi/libexample.so: android/jni/Android.mk android/jni/Application.mk android/jni/yap_wrap.cpp
( cd android/jni && NDK_DEBUG=1 ndk-build )
cp -r $(YAP_EXPORT_PLS)/* android/assets/share/Yap
cp -r $(YAP_EXPORT_DLLS)/*.so android/jni
cp -r $(YAP_EXPORT_SAVED_STATE) android/assets/lib/Yap
android/jni/Application.mk: android/jni/Android.mk
cp $(srcdir)/android/jni/Application.mk android/jni
@@ -124,11 +119,13 @@ R:
yap.i: $(srcdir)/../../../../include/YapInterface.h
install:
install: all
clean:
rm -fr android/* jni/* java/* python/*
rm -fr android/libs/armeabi/libexample.so JavaYap-debug.apk android/jni/Application.mk \
android/jni/Android.mk android/jni/yap_wrap.cpp python/_yap.so jni/yap_wrap.o \
python/yap_wrap.cpp python/yap.py jni/yap_wrap.cpp java/yap.java
distclean: clean
rm -f *def Makefile

View File

@@ -60,9 +60,10 @@ public class JavaYap extends Activity
String str;
String buf;
YAPQuery q;
Boolean running = false;
Boolean running = false, compute = true;
int i=1;
YAPListTerm vs0;
private AssetManager mgr;
void runQuery(String str, Boolean more)
{
@@ -70,13 +71,18 @@ public class JavaYap extends Activity
{
// check if at initial query
if (!running) {
if (BuildConfig.DEBUG) {
Log.i(TAG, "query "+str);
}
q = eng.query( str );
// get the uninstantiated query variables.
vs0 = q.namedVars();
running = true;
}
// start computing
Boolean compute = true;
compute = true;
if (BuildConfig.DEBUG) {
Log.i(TAG, "onQueryButtonClick called");
@@ -89,7 +95,7 @@ public class JavaYap extends Activity
if (BuildConfig.DEBUG) {
Log.i(TAG, "q0=\n");
}
if (compute && q.next()) {
if (compute && (rc = q.next())) {
outputText.append( "yes\n" );
running = compute = more;
} else {
@@ -102,7 +108,7 @@ public class JavaYap extends Activity
Log.i(TAG, "q1= "+vs0.text()+"\n");
}
while (compute && (rc = q.next()) ) {
YAPListTerm vs = vs0;
YAPListTerm vs = q.namedVars();
while(!vs.nil()){
if (BuildConfig.DEBUG) {
Log.i(TAG, "q= "+vs0.text()+"\n");
@@ -118,11 +124,14 @@ public class JavaYap extends Activity
}
if ( !rc) {
q.close();
running = compute = false;
compute = true;
running = false;
}
} catch(Exception e){
outputText.append("Exception thrown :" + e);
return;
q.close();
compute = true;
running = false;
}
}
@@ -139,8 +148,8 @@ public class JavaYap extends Activity
s = getPackageName();
PackageInfo p = m.getPackageInfo(s, 0);
//s = p.applicationInfo.dataDir;
AssetManager mgr = getResources().getAssets();
Log.i(TAG, "mgr=" +mgr + " " + s);
mgr = getResources().getAssets();
Log.i(TAG, "mgr0=" +mgr + " " + s);
load(mgr);
} catch(NameNotFoundException e) {
Log.e(TAG, "Couldn't find package information in PackageManager", e);
@@ -239,8 +248,6 @@ public class JavaYap extends Activity
private static native void load(AssetManager mgr);
private AssetManager mgr;
private static final String TAG = "JavaYap";
}
@@ -256,13 +263,6 @@ class JavaCallback extends YAPCallback
Log.i(TAG, "java callback init");
}
public void run()
{
Log.i(TAG, "java callback ");
System.out.println("JavaCallback.run() ");
}
public void run(String s)
{
Log.i(TAG, "java callback ");

View File

@@ -3567,7 +3567,7 @@ SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N);
** UTF-16 encoded strings and the other functions return UTF-8.
**
** ^These APIs are only available if the library was compiled with the
** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol.
** [SQLITE_ENABLE_COLUMN_METAPDATA] C-preprocessor symbol.
**
** If two or more threads call one or more of these routines against the same
** prepared statement and column at the same time then the results are
@@ -5130,7 +5130,7 @@ SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);
** in the [database connection] (to be retrieved using sqlite3_errmsg()).)^
**
** ^This API is only available if the library was compiled with the
** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined.
** [SQLITE_ENABLE_COLUMN_METAPDATA] C-preprocessor symbol defined.
*/
SQLITE_API int sqlite3_table_column_metadata(
sqlite3 *db, /* Connection handle */
@@ -8674,7 +8674,7 @@ typedef struct WhereInfo WhereInfo;
/* TODO: This definition is just included so other modules compile. It
** needs to be revisited.
*/
#define SQLITE_N_BTREE_META 10
#define SQLITE_N_BTREE_METAP 10
/*
** If defined as non-zero, auto-vacuum is enabled by default. Otherwise
@@ -9045,7 +9045,7 @@ typedef struct VdbeOpList VdbeOpList;
#define COLNAME_DATABASE 2
#define COLNAME_TABLE 3
#define COLNAME_COLUMN 4
#ifdef SQLITE_ENABLE_COLUMN_METADATA
#ifdef SQLITE_ENABLE_COLUMN_METAPDATA
# define COLNAME_N 5 /* Number of COLNAME_xxx symbols */
#else
# ifdef SQLITE_OMIT_DECLTYPE
@@ -13104,8 +13104,8 @@ static const char * const azCompileOpt[] = {
#ifdef SQLITE_ENABLE_CEROD
"ENABLE_CEROD",
#endif
#ifdef SQLITE_ENABLE_COLUMN_METADATA
"ENABLE_COLUMN_METADATA",
#ifdef SQLITE_ENABLE_COLUMN_METAPDATA
"ENABLE_COLUMN_METAPDATA",
#endif
#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT
"ENABLE_EXPENSIVE_ASSERT",
@@ -65428,12 +65428,12 @@ SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
#endif
/*
** Constraint: If you have ENABLE_COLUMN_METADATA then you must
** Constraint: If you have ENABLE_COLUMN_METAPDATA then you must
** not define OMIT_DECLTYPE.
*/
#if defined(SQLITE_OMIT_DECLTYPE) && defined(SQLITE_ENABLE_COLUMN_METADATA)
#if defined(SQLITE_OMIT_DECLTYPE) && defined(SQLITE_ENABLE_COLUMN_METAPDATA)
# error "Must not define both SQLITE_OMIT_DECLTYPE \
and SQLITE_ENABLE_COLUMN_METADATA"
and SQLITE_ENABLE_COLUMN_METAPDATA"
#endif
#ifndef SQLITE_OMIT_DECLTYPE
@@ -65453,7 +65453,7 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
#endif /* SQLITE_OMIT_UTF16 */
#endif /* SQLITE_OMIT_DECLTYPE */
#ifdef SQLITE_ENABLE_COLUMN_METADATA
#ifdef SQLITE_ENABLE_COLUMN_METAPDATA
/*
** Return the name of the database from which a result column derives.
** NULL is returned if the result column is an expression or constant or
@@ -65501,7 +65501,7 @@ SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
}
#endif /* SQLITE_OMIT_UTF16 */
#endif /* SQLITE_ENABLE_COLUMN_METADATA */
#endif /* SQLITE_ENABLE_COLUMN_METAPDATA */
/******************************* sqlite3_bind_ ***************************
@@ -69285,7 +69285,7 @@ case OP_ReadCookie: { /* out2-prerelease */
assert( p->bIsReader );
iDb = pOp->p1;
iCookie = pOp->p3;
assert( pOp->p3<SQLITE_N_BTREE_META );
assert( pOp->p3<SQLITE_N_BTREE_METAP );
assert( iDb>=0 && iDb<db->nDb );
assert( db->aDb[iDb].pBt!=0 );
assert( (p->btreeMask & (((yDbMask)1)<<iDb))!=0 );
@@ -69307,7 +69307,7 @@ case OP_ReadCookie: { /* out2-prerelease */
*/
case OP_SetCookie: { /* in3 */
Db *pDb;
assert( pOp->p2<SQLITE_N_BTREE_META );
assert( pOp->p2<SQLITE_N_BTREE_METAP );
assert( pOp->p1>=0 && pOp->p1<db->nDb );
assert( (p->btreeMask & (((yDbMask)1)<<pOp->p1))!=0 );
assert( p->readOnly==0 );
@@ -95154,7 +95154,7 @@ struct sqlite3_api_routines {
** excluded from a build of SQLite. Substitute a NULL pointer
** for any missing APIs.
*/
#ifndef SQLITE_ENABLE_COLUMN_METADATA
#ifndef SQLITE_ENABLE_COLUMN_METAPDATA
# define sqlite3_column_database_name 0
# define sqlite3_column_database_name16 0
# define sqlite3_column_table_name 0
@@ -100186,9 +100186,9 @@ static void generateSortTail(
** The declaration type for any expression other than a column is NULL.
**
** This routine has either 3 or 6 parameters depending on whether or not
** the SQLITE_ENABLE_COLUMN_METADATA compile-time option is used.
** the SQLITE_ENABLE_COLUMN_METAPDATA compile-time option is used.
*/
#ifdef SQLITE_ENABLE_COLUMN_METADATA
#ifdef SQLITE_ENABLE_COLUMN_METAPDATA
# define columnType(A,B,C,D,E,F) columnTypeImpl(A,B,C,D,E,F)
static const char *columnTypeImpl(
NameContext *pNC,
@@ -100201,14 +100201,14 @@ static const char *columnTypeImpl(
char const *zOrigDb = 0;
char const *zOrigTab = 0;
char const *zOrigCol = 0;
#else /* if !defined(SQLITE_ENABLE_COLUMN_METADATA) */
#else /* if !defined(SQLITE_ENABLE_COLUMN_METAPDATA) */
# define columnType(A,B,C,D,E,F) columnTypeImpl(A,B,F)
static const char *columnTypeImpl(
NameContext *pNC,
Expr *pExpr,
u8 *pEstWidth
){
#endif /* !defined(SQLITE_ENABLE_COLUMN_METADATA) */
#endif /* !defined(SQLITE_ENABLE_COLUMN_METAPDATA) */
char const *zType = 0;
int j;
u8 estWidth = 1;
@@ -100281,7 +100281,7 @@ static const char *columnTypeImpl(
assert( !pS );
if( iCol<0 ) iCol = pTab->iPKey;
assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
#ifdef SQLITE_ENABLE_COLUMN_METADATA
#ifdef SQLITE_ENABLE_COLUMN_METAPDATA
if( iCol<0 ){
zType = "INTEGER";
zOrigCol = "rowid";
@@ -100325,7 +100325,7 @@ static const char *columnTypeImpl(
#endif
}
#ifdef SQLITE_ENABLE_COLUMN_METADATA
#ifdef SQLITE_ENABLE_COLUMN_METAPDATA
if( pzOrigDb ){
assert( pzOrigTab && pzOrigCol );
*pzOrigDb = zOrigDb;
@@ -100355,7 +100355,7 @@ static void generateColumnTypes(
for(i=0; i<pEList->nExpr; i++){
Expr *p = pEList->a[i].pExpr;
const char *zType;
#ifdef SQLITE_ENABLE_COLUMN_METADATA
#ifdef SQLITE_ENABLE_COLUMN_METAPDATA
const char *zOrigDb = 0;
const char *zOrigTab = 0;
const char *zOrigCol = 0;
@@ -121509,7 +121509,7 @@ SQLITE_API void sqlite3_thread_cleanup(void){
** Return meta information about a specific column of a database table.
** See comment in sqlite3.h (sqlite.h.in) for details.
*/
#ifdef SQLITE_ENABLE_COLUMN_METADATA
#ifdef SQLITE_ENABLE_COLUMN_METAPDATA
SQLITE_API int sqlite3_table_column_metadata(
sqlite3 *db, /* Connection handle */
const char *zDbName, /* Database name or NULL */

File diff suppressed because it is too large Load Diff

View File

@@ -21,10 +21,11 @@ fi
if test "$PKG_SWIG" != ""; then
mkdir -p packages/swig/android
mkdir -p packages/swig/android/usr
mkdir -p packages/swig/python
mkdir -p packages/swig/R
mkdir -p packages/swig/java
mkdir -p packages/swig/fli
mkdir -p packages/swig/jni
AC_SUBST(SWIG)

View File

@@ -3,20 +3,31 @@
import sys
import yap
#
# initialize engine
engine = yap.YAPEngine();
# engine = yap.YAPEngine(yap.YAPParams());
def go():
while True:
s = raw_input("Prolog Query: ")
q = engine.query(s)
while q.next():
vs = q.namedVars();
if vs.length() == 0:
print "yes"
else:
while vs.length() > 0:
eq = vs.car()
print eq.getArg(1).text() + " = " + eq.getArg(2).text()
vs = vs.cdr()
print "no more answers"
def query( s ):
q = engine.query(s)
while q.next():
vs = q.namedVars()
if vs.length() == 0:
print( "yes" )
return
else:
while vs.length() > 0:
eq = vs.car()
print( eq.getArg(1).text() + " = " + eq.getArg(2).text() )
vs = vs.cdr()
s = raw_input("next: ?")
if s.find(';') != 0 :
return
print( "no more answers" )
return
def live():
loop = True
while loop:
s = raw_input("?- ")
query( s )

View File

@@ -2,7 +2,7 @@
%module(directors="1") yap
// Language independent exception handler
%include exception.i
%include exception.i
class YAPPredicate;
class YAPEngine;
@@ -21,7 +21,7 @@
%exception query {
try {
$action
}
}
catch (YAPError YAP_SYMTAX_ERROR) {
SWIG_exception(SWIG_SyntaxError,"Syntax Error exception");
}
@@ -33,7 +33,7 @@
%exception next {
try {
$action
}
}
catch (...) {
SWIG_exception(SWIG_RuntimeError,"Unknown exception");
}
@@ -42,16 +42,14 @@
%{
/* Put header files here or function declarations like below */
#define YAP_CPP_INTERFACE 1
#include "yapi.hh"
extern "C" {
extern Term Yap_StringToTerm(const char *s, size_t len, term_t bindings);
#if THREADS
#define Yap_regp regcache
#endif
@@ -61,11 +59,11 @@
}
%}
/* turn on director wrapping Callback */
%feature("director") YAPCallback;
%include "yapi.hh"
%include "yapa.hh"
@@ -89,4 +87,3 @@
}
}
#endif