Skip to content

Commit 738d676

Browse files
committed
bundle regexp to the libsql-ffi
1 parent 6e55668 commit 738d676

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

libsql-ffi/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ sqlean-extension-fuzzy = []
4040
sqlean-extension-math = []
4141
sqlean-extension-stats = []
4242
sqlean-extension-text = []
43+
sqlean-extension-regexp = []
4344
sqlean-extensions = [
4445
"sqlean-extension-uuid",
4546
"sqlean-extension-crypto",
4647
"sqlean-extension-fuzzy",
4748
"sqlean-extension-math",
4849
"sqlean-extension-stats",
4950
"sqlean-extension-text",
51+
"sqlean-extension-regexp",
5052
]
5153
libsql-disable-checkpoint-downgrade = []
5254
libsql-checkpoint-only-full= []

libsql-ffi/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ pub fn build_bundled(out_dir: &str, out_path: &Path) {
252252
sqlean_patterns.push("uuid/*.c");
253253
}
254254

255+
if cfg!(feature = "sqlean-extension-regexp") {
256+
enabled_extensions.push("regexp");
257+
sqlean_patterns.push("regexp/*.c");
258+
}
259+
255260
if sqlean_patterns.is_empty() {
256261
cfg.file(format!("{BUNDLED_DIR}/src/sqlite3.c"));
257262
} else {

libsql-ffi/bundled/bindings/bindgen.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ extern "C" {
2323
) -> ::std::os::raw::c_int;
2424
}
2525

26-
pub const __GNUC_VA_LIST: i32 = 1;
2726
pub const SQLITE_VERSION: &[u8; 7] = b"3.45.1\0";
2827
pub const SQLITE_VERSION_NUMBER: i32 = 3045001;
2928
pub const SQLITE_SOURCE_ID: &[u8; 85] =
@@ -502,8 +501,8 @@ pub const FTS5_TOKENIZE_DOCUMENT: i32 = 4;
502501
pub const FTS5_TOKENIZE_AUX: i32 = 8;
503502
pub const FTS5_TOKEN_COLOCATED: i32 = 1;
504503
pub const WAL_SAVEPOINT_NDATA: i32 = 4;
505-
pub type va_list = __builtin_va_list;
506-
pub type __gnuc_va_list = __builtin_va_list;
504+
pub type __gnuc_va_list = [u64; 4usize];
505+
pub type va_list = [u64; 4usize];
507506
extern "C" {
508507
pub static sqlite3_version: [::std::os::raw::c_char; 0usize];
509508
}
@@ -940,7 +939,7 @@ extern "C" {
940939
extern "C" {
941940
pub fn sqlite3_vmprintf(
942941
arg1: *const ::std::os::raw::c_char,
943-
arg2: *mut __va_list_tag,
942+
arg2: va_list,
944943
) -> *mut ::std::os::raw::c_char;
945944
}
946945
extern "C" {
@@ -956,7 +955,7 @@ extern "C" {
956955
arg1: ::std::os::raw::c_int,
957956
arg2: *mut ::std::os::raw::c_char,
958957
arg3: *const ::std::os::raw::c_char,
959-
arg4: *mut __va_list_tag,
958+
arg4: va_list,
960959
) -> *mut ::std::os::raw::c_char;
961960
}
962961
extern "C" {
@@ -2506,7 +2505,7 @@ extern "C" {
25062505
pub fn sqlite3_str_vappendf(
25072506
arg1: *mut sqlite3_str,
25082507
zFormat: *const ::std::os::raw::c_char,
2509-
arg2: *mut __va_list_tag,
2508+
arg2: va_list,
25102509
);
25112510
}
25122511
extern "C" {
@@ -3574,12 +3573,3 @@ extern "C" {
35743573
extern "C" {
35753574
pub static sqlite3_wal_manager: libsql_wal_manager;
35763575
}
3577-
pub type __builtin_va_list = [__va_list_tag; 1usize];
3578-
#[repr(C)]
3579-
#[derive(Debug, Copy, Clone)]
3580-
pub struct __va_list_tag {
3581-
pub gp_offset: ::std::os::raw::c_uint,
3582-
pub fp_offset: ::std::os::raw::c_uint,
3583-
pub overflow_arg_area: *mut ::std::os::raw::c_void,
3584-
pub reg_save_area: *mut ::std::os::raw::c_void,
3585-
}

libsql-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ sqlean-extension-fuzzy = ["libsql-ffi/sqlean-extension-fuzzy"]
3131
sqlean-extension-math = ["libsql-ffi/sqlean-extension-math"]
3232
sqlean-extension-stats = ["libsql-ffi/sqlean-extension-stats"]
3333
sqlean-extension-text = ["libsql-ffi/sqlean-extension-text"]
34+
sqlean-extension-regexp = ["libsql-ffi/sqlean-extension-regexp"]
3435
sqlean-extensions = ["libsql-ffi/sqlean-extensions"]

0 commit comments

Comments
 (0)