android debugging plus clean-ups
This commit is contained in:
@@ -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 ");
|
||||
|
@@ -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
Reference in New Issue
Block a user