# Be explicit about which Java files to compile so that we can work on
# in-progress files without requiring them to be in a compilable statae.
JAVA_FILES.main := $(patsubst %,$(dir.src.jni)/%,\
- authorizer_callback.java \
- auto_extension_callback.java \
- busy_handler_callback.java \
- collation_callback.java \
- collation_needed_callback.java \
- commit_hook_callback.java \
- config_sqllog_callback.java \
- preupdate_hook_callback.java \
- progress_handler_callback.java \
- rollback_hook_callback.java \
- trace_v2_callback.java \
- update_hook_callback.java \
+ AuthorizerCallback.java \
+ AutoExtensionCallback.java \
+ BusyHandlerCallback.java \
+ Collation.java \
+ CollationNeededCallback.java \
+ CommitHookCallback.java \
+ ConfigSqllogCallback.java \
NativePointerHolder.java \
NotNull.java \
Nullable.java \
OutputPointer.java \
+ PreupdateHookCallback.java \
+ ProgressHandlerCallback.java \
ResultCode.java \
+ RollbackHookCallback.java \
SQLFunction.java \
SQLite3Jni.java \
Tester1.java \
+ TraceV2Callback.java \
+ UpdateHookCallback.java \
ValueHolder.java \
+ XDestroyCallback.java \
package-info.java \
sqlite3.java \
sqlite3_context.java \
sqlite3_stmt.java \
sqlite3_value.java \
- xDestroy_callback.java \
)
ifeq (1,$(enable.fts5))
JAVA_FILES.main += $(patsubst %,$(dir.src.jni)/%,\
? (int)sizeof(void*)
: 0))
: 0;
- return (jlong)p / sizeof(void*);
+ return (jlong)p;
}
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_auto_extension
- * Signature: (Lorg/sqlite/jni/auto_extension_callback;)I
+ * Signature: (Lorg/sqlite/jni/AutoExtensionCallback;)I
*/
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1auto_1extension
(JNIEnv *, jclass, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_busy_handler
- * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/busy_handler_callback;)I
+ * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/BusyHandlerCallback;)I
*/
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1busy_1handler
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_cancel_auto_extension
- * Signature: (Lorg/sqlite/jni/auto_extension_callback;)Z
+ * Signature: (Lorg/sqlite/jni/AutoExtensionCallback;)Z
*/
JNIEXPORT jboolean JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1cancel_1auto_1extension
(JNIEnv *, jclass, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_collation_needed
- * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/collation_needed_callback;)I
+ * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/CollationNeededCallback;)I
*/
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1collation_1needed
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_commit_hook
- * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/commit_hook_callback;)Lorg/sqlite/jni/commit_hook_callback;
+ * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/CommitHookCallback;)Lorg/sqlite/jni/CommitHookCallback;
*/
JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1commit_1hook
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_config
- * Signature: (Lorg/sqlite/jni/config_sqllog_callback;)I
+ * Signature: (Lorg/sqlite/jni/ConfigSqllogCallback;)I
*/
-JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1config__Lorg_sqlite_jni_config_1sqllog_1callback_2
+JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1config__Lorg_sqlite_jni_ConfigSqllogCallback_2
(JNIEnv *, jclass, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_create_collation
- * Signature: (Lorg/sqlite/jni/sqlite3;Ljava/lang/String;ILorg/sqlite/jni/collation_callback;)I
+ * Signature: (Lorg/sqlite/jni/sqlite3;Ljava/lang/String;ILorg/sqlite/jni/Collation;)I
*/
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1create_1collation
(JNIEnv *, jclass, jobject, jstring, jint, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_preupdate_hook
- * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/preupdate_hook_callback;)Lorg/sqlite/jni/preupdate_hook_callback;
+ * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/PreupdateHookCallback;)Lorg/sqlite/jni/PreupdateHookCallback;
*/
JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1preupdate_1hook
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_progress_handler
- * Signature: (Lorg/sqlite/jni/sqlite3;ILorg/sqlite/jni/progress_handler_callback;)V
+ * Signature: (Lorg/sqlite/jni/sqlite3;ILorg/sqlite/jni/ProgressHandlerCallback;)V
*/
JNIEXPORT void JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1progress_1handler
(JNIEnv *, jclass, jobject, jint, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_rollback_hook
- * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/rollback_hook_callback;)Lorg/sqlite/jni/rollback_hook_callback;
+ * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/RollbackHookCallback;)Lorg/sqlite/jni/RollbackHookCallback;
*/
JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1rollback_1hook
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_set_authorizer
- * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/authorizer_callback;)I
+ * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/AuthorizerCallback;)I
*/
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1set_1authorizer
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_trace_v2
- * Signature: (Lorg/sqlite/jni/sqlite3;ILorg/sqlite/jni/trace_v2_callback;)I
+ * Signature: (Lorg/sqlite/jni/sqlite3;ILorg/sqlite/jni/TraceV2Callback;)I
*/
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1trace_1v2
(JNIEnv *, jclass, jobject, jint, jobject);
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_update_hook
- * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/update_hook_callback;)Lorg/sqlite/jni/update_hook_callback;
+ * Signature: (Lorg/sqlite/jni/sqlite3;Lorg/sqlite/jni/UpdateHookCallback;)Lorg/sqlite/jni/UpdateHookCallback;
*/
JNIEXPORT jobject JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1update_1hook
(JNIEnv *, jclass, jobject, jobject);
/**
Callback for use with sqlite3_set_authorizer().
*/
-public interface authorizer_callback extends sqlite3_callback_proxy {
+public interface AuthorizerCallback extends SQLite3CallbackProxy {
/**
Must function as described for the C-level
sqlite3_set_authorizer() callback.
A callback for use with the sqlite3_auto_extension() family of
APIs.
*/
-public interface auto_extension_callback extends sqlite3_callback_proxy {
+public interface AutoExtensionCallback extends SQLite3CallbackProxy {
/**
Must function as described for a C-level
sqlite3_auto_extension() callback, with the caveat that the
/**
Callback for use with sqlite3_busy_handler()
*/
-public abstract class busy_handler_callback
- implements sqlite3_callback_proxy, xDestroy_callback {
+public abstract class BusyHandlerCallback
+ implements SQLite3CallbackProxy, XDestroyCallback {
/**
Must function as documented for the C-level
sqlite3_busy_handler() callback argument, minus the (void*)
/**
Callback for use with sqlite3_create_collation()
*/
-public abstract class collation_callback
- implements sqlite3_callback_proxy, xDestroy_callback {
+public abstract class Collation
+ implements SQLite3CallbackProxy, XDestroyCallback {
/**
Must compare the given byte arrays using memcmp() semantics.
*/
/**
Callback for use with sqlite3_collation_needed().
*/
-public interface collation_needed_callback extends sqlite3_callback_proxy {
+public interface CollationNeededCallback extends SQLite3CallbackProxy {
/**
Has the same semantics as the C-level sqlite3_create_collation()
callback.
/**
Callback for use with sqlite3_commit_hook()
*/
-public interface commit_hook_callback extends sqlite3_callback_proxy {
+public interface CommitHookCallback extends SQLite3CallbackProxy {
/**
Works as documented for the C-level sqlite3_commit_hook()
callback. Must not throw.
/**
A callback for use with sqlite3_config().
*/
-public interface config_sqllog_callback {
+public interface ConfigSqllogCallback {
/**
- Must function as described for sqlite3_config(SQLITE_CONFIG_SQLLOG)
- callback, with the slight signature change.
+ Must function as described for a C-level callback for
+ {@link SQLite3Jni#sqlite3_config(ConfigSqllogCallback)}, with the slight signature change.
*/
void call(sqlite3 db, String msg, int msgType );
}
/**
This annotation is for flagging parameters which may not legally be
- null. Note that the C-style API does not throw any
- NullPointerExceptions on its own because it has a no-throw policy
- in order to retain its C-style semantics.
+ null. Note that the C-style API does not throw any exceptions on
+ its own because it has a no-throw policy in order to retain its
+ C-style semantics, but it may trigger NullPointerExceptions (or
+ similar) if passed a null for a parameter flagged with this
+ annotation.
<p>This annotation is informational only. No policy is in place to
programmatically ensure that NotNull is conformed to in client
/**
Callback for use with sqlite3_preupdate_hook().
*/
-public interface preupdate_hook_callback extends sqlite3_callback_proxy {
+public interface PreupdateHookCallback extends SQLite3CallbackProxy {
/**
Must function as described for the C-level sqlite3_preupdate_hook()
callback. Must not throw.
/**
Callback for use with sqlite3_progress_handler()
*/
-public interface progress_handler_callback extends sqlite3_callback_proxy {
+public interface ProgressHandlerCallback extends SQLite3CallbackProxy {
/**
Works as documented for the C-level sqlite3_progress_handler() callback.
/**
Callback for use with sqlite3_rollback_hook()
*/
-public interface rollback_hook_callback extends sqlite3_callback_proxy {
+public interface RollbackHookCallback extends SQLite3CallbackProxy {
/**
Works as documented for the C-level sqlite3_rollback_hook()
callback. Must not throw.
managing their accumulator state across calls to the UDF's
callbacks.
+ <p>T must be of a type which can be legally stored as a value in
+ java.util.HashMap<KeyType,T>.
+
<p>If a given aggregate or window function is called multiple times
in a single SQL statement, e.g. SELECT MYFUNC(A), MYFUNC(B)...,
then the clients need some way of knowing which call is which so
Client UDFs are free to perform such mappings using custom
approaches. The provided Aggregate<T> and Window<T> classes
use this.
-
- <p>T must be of a type which can be legally stored as a value in
- java.util.HashMap<KeyType,T>.
*/
public static final class PerContextState<T> {
private final java.util.Map<Long,ValueHolder<T>> map
<p>Callbacks of this style follow a common naming convention:
- <p>1) They almost all have the same class or interface name as the
- C function they are proxying a callback for, minus the sqlite3_
- prefix, plus a _callback suffix. e.g. sqlite3_busy_handler()'s
- callback is named busy_handler_callback. Exceptions are made where
- that would potentially be ambiguous, e.g. config_sqllog_callback
- instead of config_callback because the sqlite3_config() interface
- may need to support more callback types in the future.
+ <p>1) They use the UpperCamelCase form of the C function they're
+ proxying for, minus the sqlite3_ prefix, plus a Callback
+ suffix. e.g. sqlite3_busy_handler()'s callback is named
+ BusyHandlerCallback. Exceptions are made where that would
+ potentially be ambiguous, e.g. ConfigSqllogCallback instead of
+ config_callback because the sqlite3_config() interface may need to
+ support more callback types in the future.
<p>2) They all have a call() method but its signature is
callback-specific.
*/
-public interface sqlite3_callback_proxy {}
+public interface SQLite3CallbackProxy {}
<p>See the AutoExtension class docs for more information.
*/
- public static native int sqlite3_auto_extension(@NotNull auto_extension_callback callback);
+ public static native int sqlite3_auto_extension(@NotNull AutoExtensionCallback callback);
/**
Results are undefined if data is not null and n<0 || n>=data.length.
);
/**
- As for the C-level function of the same name, with a busy_handler_callback
+ As for the C-level function of the same name, with a BusyHandlerCallback
instance in place of a callback function. Pass it a null handler
to clear the busy handler.
*/
public static native int sqlite3_busy_handler(
- @NotNull sqlite3 db, @Nullable busy_handler_callback handler
+ @NotNull sqlite3 db, @Nullable BusyHandlerCallback handler
);
public static native int sqlite3_busy_timeout(
);
public static native boolean sqlite3_cancel_auto_extension(
- @NotNull auto_extension_callback ax
+ @NotNull AutoExtensionCallback ax
);
public static native int sqlite3_changes(
Java's string type is compatible with that interface.
*/
public static native int sqlite3_collation_needed(
- @NotNull sqlite3 db, @Nullable collation_needed_callback callback
+ @NotNull sqlite3 db, @Nullable CollationNeededCallback callback
);
/**
@NotNull sqlite3_context cx
);
- public static native commit_hook_callback sqlite3_commit_hook(
- @NotNull sqlite3 db, @Nullable commit_hook_callback hook
+ public static native CommitHookCallback sqlite3_commit_hook(
+ @NotNull sqlite3 db, @Nullable CommitHookCallback hook
);
public static native String sqlite3_compileoption_get(
@NotNull String optName
);
- /*
- ** Works like in the C API with the exception that it only supports
- ** the following subset of configution flags:
- **
- ** - SQLITE_CONFIG_SINGLETHREAD
- ** - SQLITE_CONFIG_MULTITHREAD
- ** - SQLITE_CONFIG_SERIALIZED
- **
- ** Others may be added in the future. It returns SQLITE_MISUSE if
- ** given an argument it does not handle.
+ /**
+ <p>Works like in the C API with the exception that it only supports
+ the following subset of configution flags:
+
+ <p>SQLITE_CONFIG_SINGLETHREAD
+ SQLITE_CONFIG_MULTITHREAD
+ SQLITE_CONFIG_SERIALIZED
+
+ <p>Others may be added in the future. It returns SQLITE_MISUSE if
+ given an argument it does not handle.
*/
public static native int sqlite3_config(int op);
- /*
- ** If the native library was built with SQLITE_ENABLE_SQLLOG defined
- ** then this acts as a proxy for C's
- ** sqlite3_config(SQLITE_ENABLE_SQLLOG,...). This sets or clears the
- ** logger. If installation of a logger fails, any previous logger is
- ** retained.
- **
- ** If not built with SQLITE_ENABLE_SQLLOG defined, this returns
- ** SQLITE_MISUSE.
+ /**
+ If the native library was built with SQLITE_ENABLE_SQLLOG defined
+ then this acts as a proxy for C's
+ sqlite3_config(SQLITE_ENABLE_SQLLOG,...). This sets or clears the
+ logger. If installation of a logger fails, any previous logger is
+ retained.
+
+ If not built with SQLITE_ENABLE_SQLLOG defined, this returns
+ SQLITE_MISUSE.
*/
- public static native int sqlite3_config( @Nullable config_sqllog_callback logger );
+ public static native int sqlite3_config( @Nullable ConfigSqllogCallback logger );
public static native int sqlite3_create_collation(
@NotNull sqlite3 db, @NotNull String name, int eTextRep,
- @NotNull collation_callback col
+ @NotNull Collation col
);
/**
acts as a proxy for C's sqlite3_preupdate_hook(), else it returns null
with no side effects.
*/
- public static native preupdate_hook_callback sqlite3_preupdate_hook(
- @NotNull sqlite3 db, @Nullable preupdate_hook_callback hook
+ public static native PreupdateHookCallback sqlite3_preupdate_hook(
+ @NotNull sqlite3 db, @Nullable PreupdateHookCallback hook
);
/**
}
public static native void sqlite3_progress_handler(
- @NotNull sqlite3 db, int n, @Nullable progress_handler_callback h
+ @NotNull sqlite3 db, int n, @Nullable ProgressHandlerCallback h
);
public static native int sqlite3_reset(@NotNull sqlite3_stmt stmt);
}
}
- public static native rollback_hook_callback sqlite3_rollback_hook(
- @NotNull sqlite3 db, @Nullable rollback_hook_callback hook
+ public static native RollbackHookCallback sqlite3_rollback_hook(
+ @NotNull sqlite3 db, @Nullable RollbackHookCallback hook
);
//! Sets or unsets (if auth is null) the current authorizer.
public static native int sqlite3_set_authorizer(
- @NotNull sqlite3 db, @Nullable authorizer_callback auth
+ @NotNull sqlite3 db, @Nullable AuthorizerCallback auth
);
public static native void sqlite3_set_last_insert_rowid(
cannot be processed propertly (i.e. an internal error).
*/
public static native int sqlite3_trace_v2(
- @NotNull sqlite3 db, int traceMask, @Nullable trace_v2_callback tracer
+ @NotNull sqlite3 db, int traceMask, @Nullable TraceV2Callback tracer
);
- public static native update_hook_callback sqlite3_update_hook(
- sqlite3 db, update_hook_callback hook
+ public static native UpdateHookCallback sqlite3_update_hook(
+ sqlite3 db, UpdateHookCallback hook
);
public static native byte[] sqlite3_value_blob(@NotNull sqlite3_value v);
final sqlite3 db = createNewDb();
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
final ValueHolder<Boolean> xDestroyCalled = new ValueHolder<>(false);
- final collation_callback myCollation = new collation_callback() {
+ final Collation myCollation = new Collation() {
private String myState =
"this is local state. There is much like it, but this is mine.";
@Override
xDestroyCalled.value = true;
}
};
- final collation_needed_callback collLoader = new collation_needed_callback(){
+ final CollationNeededCallback collLoader = new CollationNeededCallback(){
@Override
public int call(sqlite3 dbArg, int eTextRep, String collationName){
affirm(dbArg == db/* as opposed to a temporary object*/);
int rc = sqlite3_trace_v2(
db, SQLITE_TRACE_STMT | SQLITE_TRACE_PROFILE
| SQLITE_TRACE_ROW | SQLITE_TRACE_CLOSE,
- new trace_v2_callback(){
+ new TraceV2Callback(){
@Override public int call(int traceFlag, Object pNative, Object x){
++counter.value;
//outln("TRACE "+traceFlag+" pNative = "+pNative.getClass().getName());
final ValueHolder<Boolean> xDestroyed = new ValueHolder<>(false);
final ValueHolder<Integer> xBusyCalled = new ValueHolder<>(0);
- busy_handler_callback handler = new busy_handler_callback(){
+ BusyHandlerCallback handler = new BusyHandlerCallback(){
@Override public int call(int n){
//outln("busy handler #"+n);
return n > 2 ? 0 : ++xBusyCalled.value;
private void testProgress(){
final sqlite3 db = createNewDb();
final ValueHolder<Integer> counter = new ValueHolder<>(0);
- sqlite3_progress_handler(db, 1, new progress_handler_callback(){
+ sqlite3_progress_handler(db, 1, new ProgressHandlerCallback(){
@Override public int call(){
++counter.value;
return 0;
final sqlite3 db = createNewDb();
final ValueHolder<Integer> counter = new ValueHolder<>(0);
final ValueHolder<Integer> hookResult = new ValueHolder<>(0);
- final commit_hook_callback theHook = new commit_hook_callback(){
+ final CommitHookCallback theHook = new CommitHookCallback(){
@Override public int call(){
++counter.value;
return hookResult.value;
}
};
- commit_hook_callback oldHook = sqlite3_commit_hook(db, theHook);
+ CommitHookCallback oldHook = sqlite3_commit_hook(db, theHook);
affirm( null == oldHook );
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
affirm( 2 == counter.value );
execSql(db, "BEGIN; update t set a='g' where a='f'; COMMIT;");
affirm( 4 == counter.value );
- final commit_hook_callback newHook = new commit_hook_callback(){
+ final CommitHookCallback newHook = new CommitHookCallback(){
@Override public int call(){return 0;}
};
oldHook = sqlite3_commit_hook(db, newHook);
final sqlite3 db = createNewDb();
final ValueHolder<Integer> counter = new ValueHolder<>(0);
final ValueHolder<Integer> expectedOp = new ValueHolder<>(0);
- final update_hook_callback theHook = new update_hook_callback(){
+ final UpdateHookCallback theHook = new UpdateHookCallback(){
@Override
public void call(int opId, String dbName, String tableName, long rowId){
++counter.value;
}
}
};
- update_hook_callback oldHook = sqlite3_update_hook(db, theHook);
+ UpdateHookCallback oldHook = sqlite3_update_hook(db, theHook);
affirm( null == oldHook );
expectedOp.value = SQLITE_INSERT;
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
oldHook = sqlite3_update_hook(db, null);
affirm( null == oldHook );
- final update_hook_callback newHook = new update_hook_callback(){
+ final UpdateHookCallback newHook = new UpdateHookCallback(){
@Override public void call(int opId, String dbName, String tableName, long rowId){
}
};
final sqlite3 db = createNewDb();
final ValueHolder<Integer> counter = new ValueHolder<>(0);
final ValueHolder<Integer> expectedOp = new ValueHolder<>(0);
- final preupdate_hook_callback theHook = new preupdate_hook_callback(){
+ final PreupdateHookCallback theHook = new PreupdateHookCallback(){
@Override
public void call(sqlite3 db, int opId, String dbName, String dbTable,
long iKey1, long iKey2 ){
}
}
};
- preupdate_hook_callback oldHook = sqlite3_preupdate_hook(db, theHook);
+ PreupdateHookCallback oldHook = sqlite3_preupdate_hook(db, theHook);
affirm( null == oldHook );
expectedOp.value = SQLITE_INSERT;
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
oldHook = sqlite3_preupdate_hook(db, null);
affirm( null == oldHook );
- final preupdate_hook_callback newHook = new preupdate_hook_callback(){
+ final PreupdateHookCallback newHook = new PreupdateHookCallback(){
@Override
public void call(sqlite3 db, int opId, String dbName,
String tableName, long iKey1, long iKey2){
private void testRollbackHook(){
final sqlite3 db = createNewDb();
final ValueHolder<Integer> counter = new ValueHolder<>(0);
- final rollback_hook_callback theHook = new rollback_hook_callback(){
+ final RollbackHookCallback theHook = new RollbackHookCallback(){
@Override public void call(){
++counter.value;
}
};
- rollback_hook_callback oldHook = sqlite3_rollback_hook(db, theHook);
+ RollbackHookCallback oldHook = sqlite3_rollback_hook(db, theHook);
affirm( null == oldHook );
execSql(db, "CREATE TABLE t(a); INSERT INTO t(a) VALUES('a'),('b'),('c')");
affirm( 0 == counter.value );
execSql(db, false, "BEGIN; SELECT 1; SELECT 2; ROLLBACK;");
affirm( 1 == counter.value /* contra to commit hook, is invoked if no changes are made */ );
- final rollback_hook_callback newHook = new rollback_hook_callback(){
+ final RollbackHookCallback newHook = new RollbackHookCallback(){
@Override public void call(){return;}
};
oldHook = sqlite3_rollback_hook(db, newHook);
final sqlite3 db = createNewDb();
final ValueHolder<Integer> counter = new ValueHolder<>(0);
final ValueHolder<Integer> authRc = new ValueHolder<>(0);
- final authorizer_callback auth = new authorizer_callback(){
+ final AuthorizerCallback auth = new AuthorizerCallback(){
public int call(int op, String s0, String s1, String s2, String s3){
++counter.value;
//outln("xAuth(): "+s0+" "+s1+" "+s2+" "+s3);
private synchronized void testAutoExtension(){
final ValueHolder<Integer> val = new ValueHolder<>(0);
final ValueHolder<String> toss = new ValueHolder<>(null);
- final auto_extension_callback ax = new auto_extension_callback(){
+ final AutoExtensionCallback ax = new AutoExtensionCallback(){
@Override public synchronized int call(sqlite3 db){
++val.value;
if( null!=toss.value ){
toss.value = null;
val.value = 0;
- final auto_extension_callback ax2 = new auto_extension_callback(){
+ final AutoExtensionCallback ax2 = new AutoExtensionCallback(){
@Override public synchronized int call(sqlite3 db){
++val.value;
return 0;
if( sqlLog ){
if( sqlite3_compileoption_used("ENABLE_SQLLOG") ){
- int rc = sqlite3_config( new config_sqllog_callback() {
+ int rc = sqlite3_config( new ConfigSqllogCallback() {
@Override public void call(sqlite3 db, String msg, int op){
switch(op){
case 0: outln("Opening db: ",db); break;
/**
Callback proxy for use with sqlite3_trace_v2().
*/
-public interface trace_v2_callback extends sqlite3_callback_proxy {
+public interface TraceV2Callback extends SQLite3CallbackProxy {
/**
Called by sqlite3 for various tracing operations, as per
sqlite3_trace_v2(). Note that this interface elides the 2nd
/**
Callback for use with sqlite3_update_hook().
*/
-public interface update_hook_callback extends sqlite3_callback_proxy {
+public interface UpdateHookCallback extends SQLite3CallbackProxy {
/**
Must function as described for the C-level sqlite3_update_hook()
callback. Must not throw.
the symbol name xDestroy() for this purpose in the C API
documentation.
*/
-public interface xDestroy_callback {
+public interface XDestroyCallback {
/**
Must perform any cleanup required by this object. Must not
throw.
sqlite3_aggregate_context(), with a slightly different interface
to account for cross-language differences. It serves the same
purposes in a slightly different way: it provides a key which is
- stable across invocations of "matching sets" of a UDF's callbacks,
- such that all calls into those callbacks can determine which "set"
- of those calls they belong to.
+ stable across invocations of a UDF's callbacks, such that all
+ calls into those callbacks can determine which "set" of those
+ calls they belong to.
+
+ <p>Note that use of this method is not a requirement for proper use
+ of this class. sqlite3_aggregate_context() can also be used.
<p>If the argument is true and the aggregate context has not yet
- been set up, it will be initialized fetched on demand, else it
+ been set up, it will be initialized and fetched on demand, else it
won't. The intent is that xStep(), xValue(), and xInverse()
methods pass true and xFinal() methods pass false.
key for mapping callback invocations to whatever client-defined
state is needed by the UDF.
- <p>There is one case where this will return 0 in the context of an
- aggregate or window function: if the result set has no rows,
- the UDF's xFinal() will be called without any other x...() members
- having been called. In that one case, no aggregate context key will
- have been generated. xFinal() implementations need to be prepared to
- accept that condition as legal.
+ <p>There is one case where this will return null in the context
+ of an aggregate or window function: if the result set has no
+ rows, the UDF's xFinal() will be called without any other x...()
+ members having been called. In that one case, no aggregate
+ context key will have been generated. xFinal() implementations
+ need to be prepared to accept that condition as legal.
*/
public synchronized Long getAggregateContext(boolean initIfNeeded){
if( aggregateContext==null ){
}
t.addTestScript(a);
}
- final auto_extension_callback ax = new auto_extension_callback() {
+ final AutoExtensionCallback ax = new AutoExtensionCallback() {
private final SQLTester tester = t;
@Override public int call(sqlite3 db){
final String init = tester.getDbInitSql();
-C More\sJava\sAPI\srenaming\sfor\sconsistency.
-D 2023-08-25T13:23:45.671
+C Hopefully\sthe\slast\smajor\sAPI\srename\sin\sthe\sJNI\sbits:\srename\sall\slower_camel_case\sclasses\swhich\sdo\snot\shave\sdirect\scounterparts\sin\sthe\sC\sAPI\sto\sUpperCamelCase,\sas\sthat's\smore\sidiomatic.\sJava\stypes\swhich\sreflect\sC-style\stypes\sare\sunaffected.
+D 2023-08-25T14:17:36.142
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F ext/icu/README.txt 7ab7ced8ae78e3a645b57e78570ff589d4c672b71370f5aa9e1cd7024f400fc9
F ext/icu/icu.c c074519b46baa484bb5396c7e01e051034da8884bad1a1cb7f09bbe6be3f0282
F ext/icu/sqliteicu.h fa373836ed5a1ee7478bdf8a1650689294e41d0c89c1daab26e9ae78a32075a8
-F ext/jni/GNUmakefile 6f2290fa521da420c4a5c2eed1692b7a5fc2d53dfa74b8786517d1adb6078bfe
+F ext/jni/GNUmakefile e352de2c988d2bd0b2c356133b61710be19f7a97502442dcf8a5d5680d1e5fdb
F ext/jni/README.md 1332b1fa27918bd5d9ca2d0d4f3ac3a6ab86b9e3699dc5bfe32904a027f3d2a9
F ext/jni/jar-dist.make 030aaa4ae71dd86e4ec5e7c1e6cd86f9dfa47c4592c070d2e35157e42498e1fa
-F ext/jni/src/c/sqlite3-jni.c 69cb5df6d5ed65ca3870982b0d5d59c99c6580538a8929c3d4a0cbe837eea660
-F ext/jni/src/c/sqlite3-jni.h 288a37d1921fd5f1772f82ecb766a64bf20df7da685479ca84d3b95d9bcacd66
+F ext/jni/src/c/sqlite3-jni.c 29c10d96f81361b0d121e389320a1dd57958fd758e3790817542d2eb20c42bed
+F ext/jni/src/c/sqlite3-jni.h 2f6184b6295fdb0e6b41e1ae8dfbd5da9fb4da9290684da769812062158bc70c
+F ext/jni/src/org/sqlite/jni/AuthorizerCallback.java c374bb76409cce7a0bdba94877706b59ac6127fa5d9e6af3e8058c99ce99c030 w ext/jni/src/org/sqlite/jni/authorizer_callback.java
+F ext/jni/src/org/sqlite/jni/AutoExtensionCallback.java 4290d8b0937b07d466b50e6ca4136cec037f3ce658277af0d0c2d371e5f4b459 w ext/jni/src/org/sqlite/jni/auto_extension_callback.java
+F ext/jni/src/org/sqlite/jni/BusyHandlerCallback.java 99248b76e9b124f60a25329309ac6a03c197b3e1a493e8f8ae2e577651ea58e5 w ext/jni/src/org/sqlite/jni/busy_handler_callback.java
+F ext/jni/src/org/sqlite/jni/Collation.java b961e3abd8a50614852531b9bc313a1f2039a100acd653b3bd4173c4c55bd5eb w ext/jni/src/org/sqlite/jni/collation_callback.java
+F ext/jni/src/org/sqlite/jni/CollationNeededCallback.java b2adbe0cb41b67bcb638885e00950abe0265e885326a96451f6ab114fb11ef59 w ext/jni/src/org/sqlite/jni/collation_needed_callback.java
+F ext/jni/src/org/sqlite/jni/CommitHookCallback.java c2b4deec20acf9c72ab487ba1a408c54cb5cc12c45baa46490b555b80bd3579f w ext/jni/src/org/sqlite/jni/commit_hook_callback.java
+F ext/jni/src/org/sqlite/jni/ConfigSqllogCallback.java e3656909eab7ed0f7e457c5b82df160ca22dd5e954c0a306ec1fca61b0d266b4 w ext/jni/src/org/sqlite/jni/config_sqllog_callback.java
F ext/jni/src/org/sqlite/jni/Fts5.java 3ebfbd5b95fdb9d7bc40306f2e682abd12e247d9224e92510b8dd103b4f96fe8
F ext/jni/src/org/sqlite/jni/Fts5Context.java 0a5a02047a6a1dd3e4a38b0e542a8dd2de365033ba30e6ae019a676305959890
F ext/jni/src/org/sqlite/jni/Fts5ExtensionApi.java d475009d654a16060101da6bdfd7f118d49ff61d910faf5a1d1fdb0a1def75f1
F ext/jni/src/org/sqlite/jni/Fts5PhraseIter.java 6642beda341c0b1b46af4e2d7f6f9ab03a7aede43277b2c92859176d6bce3be9
F ext/jni/src/org/sqlite/jni/Fts5Tokenizer.java 91489893596b6528c0df5cd7180bd5b55809c26e2b797fb321dfcdbc1298c060
F ext/jni/src/org/sqlite/jni/NativePointerHolder.java 564087036449a16df148dcf0a067408bd251170bf23286c655f46b5f973e8b2d
-F ext/jni/src/org/sqlite/jni/NotNull.java a4016df436f454e8d6786dd8421484edd6fc604043cf7fd8ec94cf922ba61604
+F ext/jni/src/org/sqlite/jni/NotNull.java 08fcfcee93cdf5dd3128a88f9a112c000c143f9e077fcb31e554822595c9d73e
F ext/jni/src/org/sqlite/jni/Nullable.java b2f8755970e9dd0e917a505638d036ccc699c8422f1a69fe9d98c0804beaea17
F ext/jni/src/org/sqlite/jni/OutputPointer.java 4ae06135decef35eb04498daa2868939d91a294e948747c580ef9ce31563a6b3
+F ext/jni/src/org/sqlite/jni/PreupdateHookCallback.java 8925c58797a90caeb4a7728a964227db3ba6f953cc89b8be38a5ae6fea063818 w ext/jni/src/org/sqlite/jni/preupdate_hook_callback.java
+F ext/jni/src/org/sqlite/jni/ProgressHandlerCallback.java 7c46660c6b07a765a3f053ae06a10d7ccb4966b49979143d605a3bfb4f14f806 w ext/jni/src/org/sqlite/jni/progress_handler_callback.java
F ext/jni/src/org/sqlite/jni/ResultCode.java ba701f20213a5f259e94cfbfdd36eb7ac7ce7797f2c6c7fca2004ff12ce20f86
-F ext/jni/src/org/sqlite/jni/SQLFunction.java 4d6291fa14fcca1a040609378f9f00a193145d79c3abbda98ba32c340904cbeb
-F ext/jni/src/org/sqlite/jni/SQLite3Jni.java 26d757281a6ba588f9146f15f89ab14c8dbe5367ac40bd23d6be6f8eef578f18
-F ext/jni/src/org/sqlite/jni/Tester1.java 449091bf0c225774733657df7fdbb5f357692aed0cb6e327ef94474c81a2d834
+F ext/jni/src/org/sqlite/jni/RollbackHookCallback.java be7f7a26d1102fb514d835e11198d51302af8053d97188bfb2e34c2133208568 w ext/jni/src/org/sqlite/jni/rollback_hook_callback.java
+F ext/jni/src/org/sqlite/jni/SQLFunction.java f6842d587c6366d4ebd565b533a288efc978d56ab2d4f52f2e74b64c8e6a33f3
+F ext/jni/src/org/sqlite/jni/SQLite3CallbackProxy.java 13c4ea6f35871261eba63fa4117715515e0beecbdebfb879ec5b1f340ed36904 w ext/jni/src/org/sqlite/jni/sqlite3_callback_proxy.java
+F ext/jni/src/org/sqlite/jni/SQLite3Jni.java 00aeec162b864cd62397f7e20941a3c911bf6856627f1b1a02cb12fd1e152449
+F ext/jni/src/org/sqlite/jni/Tester1.java 595c1b9467a081dde138e383f0ce5ac3519cb9b9b7c9b2e83d39bb192e9ee7eb
F ext/jni/src/org/sqlite/jni/TesterFts5.java 6f135c60e24c89e8eecb9fe61dde0f3bb2906de668ca6c9186bcf34bdaf94629
+F ext/jni/src/org/sqlite/jni/TraceV2Callback.java 25a45e800b0c57f506c237d111bcfd09da584e936fee395d4bd802100ebeff8c w ext/jni/src/org/sqlite/jni/trace_v2_callback.java
+F ext/jni/src/org/sqlite/jni/UpdateHookCallback.java f5eadfa44462c050658230884b41477274f34306accd85c8201a7afbc00d2429 w ext/jni/src/org/sqlite/jni/update_hook_callback.java
F ext/jni/src/org/sqlite/jni/ValueHolder.java f022873abaabf64f3dd71ab0d6037c6e71cece3b8819fa10bf26a5461dc973ee
-F ext/jni/src/org/sqlite/jni/authorizer_callback.java 1d2d7fd584f917afa507820644d95504bcc9c5d7363a7afeb58de3b256851bfe
-F ext/jni/src/org/sqlite/jni/auto_extension_callback.java c8754ffabe3b75bd8f209bf1451d6a180ec52e99b11c11b2e3642f1891eb2635
-F ext/jni/src/org/sqlite/jni/busy_handler_callback.java b43fc35e0f245ff532a4ab8bda6736f06858a45a67a21dbac5d6c237c5188d2c
-F ext/jni/src/org/sqlite/jni/collation_callback.java cc8ff046e01a3cda57d9072e84bb000aaf207db605e31928a63c8b87e8ea06bd
-F ext/jni/src/org/sqlite/jni/collation_needed_callback.java 0d5cbac245db9ff22b67c92c06f2e31ed557cd018f1c4670ae970e6f16f22cee
-F ext/jni/src/org/sqlite/jni/commit_hook_callback.java 88462783826026e61e522d9aae7a9b4cb0c30f7d56519e08a5de42213a0087bc
-F ext/jni/src/org/sqlite/jni/config_sqllog_callback.java d8b9b4e0f9a522fd40a88b4f9f87308fff1be255523ad6cff8493bf3bbca2ec8
+F ext/jni/src/org/sqlite/jni/XDestroyCallback.java a43c6fad4d550c40d7ad2545565dd794df68aae855a7a6fe2d5f57ccbfc0e7d6 w ext/jni/src/org/sqlite/jni/xDestroy_callback.java
F ext/jni/src/org/sqlite/jni/fts5_api.java 5198be71c162e3e0cb1f4962a7cdf0d7596e8af53f70c4af6db24aab8d53d9ba
F ext/jni/src/org/sqlite/jni/fts5_extension_function.java ac825035d7d83fc7fd960347abfa6803e1614334a21533302041823ad5fc894c
F ext/jni/src/org/sqlite/jni/fts5_tokenizer.java a9cce7f9c52803f0d8ee7fb8e40c94e88e980dc24a170e6344b9e5ab0a4411fa
F ext/jni/src/org/sqlite/jni/package-info.java 5652d1bcaaf3ccb06d26c174e6d0b60571a545a0a3354dd8303960677be05e14
-F ext/jni/src/org/sqlite/jni/preupdate_hook_callback.java 2bcc61a9320a7af6be36e5a814d133dd610d8ead79622efd84e7444aabe25f6c
-F ext/jni/src/org/sqlite/jni/progress_handler_callback.java eae32bd36639b12552becf82a0481bb4c09d22655920007b62e49130ce97a850
-F ext/jni/src/org/sqlite/jni/rollback_hook_callback.java 25663dbad4f9da50019d0c68fc815d31155a04eaeb293f27fdc6f9b20a424760
F ext/jni/src/org/sqlite/jni/sqlite3.java 62b1b81935ccf3393472d17cb883dc5ff39c388ec3bc1de547f098a0217158fc
-F ext/jni/src/org/sqlite/jni/sqlite3_callback_proxy.java 4b3369faab47d787594c0544000dbac751d69641cac866f82f9be0e13c4b2ce5
-F ext/jni/src/org/sqlite/jni/sqlite3_context.java dca23e54f368f8ea37c112c1d2f74dc9522d5da2fdf67d6fd6b2ec9603d8514c
+F ext/jni/src/org/sqlite/jni/sqlite3_context.java 66ca95ce904044263a4aff684abe262d56f73e6b06bca6cf650761d79d7779ad
F ext/jni/src/org/sqlite/jni/sqlite3_stmt.java 78e6d1b95ac600a9475e9db4623f69449322b0c93d1bd4e1616e76ed547ed9fc
F ext/jni/src/org/sqlite/jni/sqlite3_value.java 3d1d4903e267bc0bc81d57d21f5e85978eff389a1a6ed46726dbe75f85e6914a
-F ext/jni/src/org/sqlite/jni/tester/SQLTester.java e560303ada834363b615e5863050d1488bf5c83f0627b966fb1a0a6a4355029f
+F ext/jni/src/org/sqlite/jni/tester/SQLTester.java 439d28ac92570e4d16a5361423656f3eae6916c6d4777afde490f77dbb3ec1bc
F ext/jni/src/org/sqlite/jni/tester/test-script-interpreter.md f9f25126127045d051e918fe59004a1485311c50a13edbf18c79a6ff9160030e
-F ext/jni/src/org/sqlite/jni/trace_v2_callback.java ec89134d679a9f7aebd2187025b6c58ab86e733dfecd44365ea656ac2dfae36a
-F ext/jni/src/org/sqlite/jni/update_hook_callback.java 616dbc9f99bdfbde190af3d8a44a8ad418fdc5f8c63acb0a0d679bd063848da8
-F ext/jni/src/org/sqlite/jni/xDestroy_callback.java db2ffef90eccb445c886ef21a88250c455fa530ca135def49d5afa6c79f7f115 w ext/jni/src/org/sqlite/jni/sqlite3_xDestroy_callback.java
F ext/jni/src/tests/000-000-sanity.test cfe6dc1b950751d6096e3f5695becaadcdaa048bfe9567209d6eb676e693366d
F ext/jni/src/tests/000-001-ignored.test e17e874c6ab3c437f1293d88093cf06286083b65bf162317f91bbfd92f961b70
F ext/lsm1/Makefile a553b728bba6c11201b795188c5708915cc4290f02b7df6ba7e8c4c943fd5cd9
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 6b1c816f6aae9face07ed7ead969257cf915c21ff9cdad9a21b7cf0e7496e09e
-R e0e5881b251feaa8a0cfeca08d550ed6
+P 4e457778de189d8393e88f399dc521c8a5ad4ddd80a5fd69295bcb104fac5cbf
+R a2db0a9911f347758d8a038cfb28c892
U stephan
-Z c7e4ee2c8d85ebfdfb957345bd33818f
+Z 97666aa13ffdfb8b58994782592ca3c3
# Remove this line to create a well-formed Fossil manifest.
-4e457778de189d8393e88f399dc521c8a5ad4ddd80a5fd69295bcb104fac5cbf
\ No newline at end of file
+8ca528006533ac152e9b322e421cf5d339414c77332d9836a9ff429b793d0d2d
\ No newline at end of file