checks/check-static-exts-cross: init, move checks to separate dir

This commit is contained in:
2026-05-31 17:52:55 +09:00
parent 872584dee2
commit 8c9155a455
7 changed files with 110 additions and 64 deletions
+38
View File
@@ -0,0 +1,38 @@
#include <sqlite3ext.h>
SQLITE_EXTENSION_INIT1
static void sub_func(
sqlite3_context *ctx,
int argc,
sqlite3_value **argv
) {
if (argc != 2) {
sqlite3_result_null(ctx);
return;
}
int a = sqlite3_value_int(argv[0]);
int b = sqlite3_value_int(argv[1]);
sqlite3_result_int(ctx, a - b);
}
int sqlite3_subext_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi
) {
SQLITE_EXTENSION_INIT2(pApi);
return sqlite3_create_function(
db,
"mysub",
2,
SQLITE_UTF8 | SQLITE_DETERMINISTIC,
0,
sub_func,
0,
0
);
}