libsqlite3-sys-0.26.0/.cargo_vcs_info.json0000644000000001540000000000100140100ustar { "git": { "sha1": "a1ef4b5b6d647d907810b7e15db34f460abd8ff7" }, "path_in_vcs": "libsqlite3-sys" }libsqlite3-sys-0.26.0/.gitignore000064400000000000000000000000321046102023000145630ustar 00000000000000/target/ /doc/ Cargo.lock libsqlite3-sys-0.26.0/Cargo.toml0000644000000034700000000000100120120ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "libsqlite3-sys" version = "0.26.0" authors = ["The rusqlite developers"] build = "build.rs" links = "sqlite3" description = "Native bindings to the libsqlite3 library" readme = "README.md" keywords = [ "sqlite", "sqlcipher", "ffi", ] categories = ["external-ffi-bindings"] license = "MIT" repository = "https://github.com/rusqlite/rusqlite" [dependencies.openssl-sys] version = "0.9" optional = true [build-dependencies.bindgen] version = "0.64" features = ["runtime"] optional = true default-features = false [build-dependencies.cc] version = "1.0" optional = true [build-dependencies.pkg-config] version = "0.3.19" optional = true [build-dependencies.vcpkg] version = "0.2" optional = true [features] buildtime_bindgen = [ "bindgen", "pkg-config", "vcpkg", ] bundled = [ "cc", "bundled_bindings", ] bundled-sqlcipher = ["bundled"] bundled-sqlcipher-vendored-openssl = [ "bundled-sqlcipher", "openssl-sys/vendored", ] bundled-windows = [ "cc", "bundled_bindings", ] bundled_bindings = [] default = ["min_sqlite_version_3_14_0"] in_gecko = [] min_sqlite_version_3_14_0 = [ "pkg-config", "vcpkg", ] preupdate_hook = ["buildtime_bindgen"] session = [ "preupdate_hook", "buildtime_bindgen", ] sqlcipher = [] unlock_notify = [] wasm32-wasi-vfs = [] winsqlite3 = [] with-asan = [] libsqlite3-sys-0.26.0/Cargo.toml.orig0000644000000031450000000000100127500ustar [package] name = "libsqlite3-sys" version = "0.26.0" authors = ["The rusqlite developers"] edition = "2018" repository = "https://github.com/rusqlite/rusqlite" description = "Native bindings to the libsqlite3 library" license = "MIT" links = "sqlite3" build = "build.rs" keywords = ["sqlite", "sqlcipher", "ffi"] categories = ["external-ffi-bindings"] [features] default = ["min_sqlite_version_3_14_0"] bundled = ["cc", "bundled_bindings"] bundled-windows = ["cc", "bundled_bindings"] bundled-sqlcipher = ["bundled"] bundled-sqlcipher-vendored-openssl = ["bundled-sqlcipher", "openssl-sys/vendored"] buildtime_bindgen = ["bindgen", "pkg-config", "vcpkg"] sqlcipher = [] min_sqlite_version_3_14_0 = ["pkg-config", "vcpkg"] # Bundle only the bindings file. Note that this does nothing if # `buildtime_bindgen` is enabled. bundled_bindings = [] # sqlite3_unlock_notify >= 3.6.12 unlock_notify = [] # 3.13.0 preupdate_hook = ["buildtime_bindgen"] # 3.13.0 session = ["preupdate_hook", "buildtime_bindgen"] in_gecko = [] with-asan = [] wasm32-wasi-vfs = [] # lowest version shipped with Windows 10.0.10586 was 3.8.8.3 # # Note that because `winsqlite3.dll` exports SQLite functions using a atypical # ABI on 32-bit systems, this is currently unsupported on these. This may change # in the future. winsqlite3 = [] [dependencies] openssl-sys = { version = "0.9", optional = true } [build-dependencies] bindgen = { version = "0.64", optional = true, default-features = false, features = ["runtime"] } pkg-config = { version = "0.3.19", optional = true } cc = { version = "1.0", optional = true } vcpkg = { version = "0.2", optional = true } libsqlite3-sys-0.26.0/Cargo.toml.orig000064400000000000000000000031451046102023000154720ustar 00000000000000[package] name = "libsqlite3-sys" version = "0.26.0" authors = ["The rusqlite developers"] edition = "2018" repository = "https://github.com/rusqlite/rusqlite" description = "Native bindings to the libsqlite3 library" license = "MIT" links = "sqlite3" build = "build.rs" keywords = ["sqlite", "sqlcipher", "ffi"] categories = ["external-ffi-bindings"] [features] default = ["min_sqlite_version_3_14_0"] bundled = ["cc", "bundled_bindings"] bundled-windows = ["cc", "bundled_bindings"] bundled-sqlcipher = ["bundled"] bundled-sqlcipher-vendored-openssl = ["bundled-sqlcipher", "openssl-sys/vendored"] buildtime_bindgen = ["bindgen", "pkg-config", "vcpkg"] sqlcipher = [] min_sqlite_version_3_14_0 = ["pkg-config", "vcpkg"] # Bundle only the bindings file. Note that this does nothing if # `buildtime_bindgen` is enabled. bundled_bindings = [] # sqlite3_unlock_notify >= 3.6.12 unlock_notify = [] # 3.13.0 preupdate_hook = ["buildtime_bindgen"] # 3.13.0 session = ["preupdate_hook", "buildtime_bindgen"] in_gecko = [] with-asan = [] wasm32-wasi-vfs = [] # lowest version shipped with Windows 10.0.10586 was 3.8.8.3 # # Note that because `winsqlite3.dll` exports SQLite functions using a atypical # ABI on 32-bit systems, this is currently unsupported on these. This may change # in the future. winsqlite3 = [] [dependencies] openssl-sys = { version = "0.9", optional = true } [build-dependencies] bindgen = { version = "0.64", optional = true, default-features = false, features = ["runtime"] } pkg-config = { version = "0.3.19", optional = true } cc = { version = "1.0", optional = true } vcpkg = { version = "0.2", optional = true } libsqlite3-sys-0.26.0/LICENSE000064400000000000000000000020601046102023000136030ustar 00000000000000Copyright (c) 2014-2021 The rusqlite developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. libsqlite3-sys-0.26.0/README.md000064400000000000000000000354331046102023000140670ustar 00000000000000# Rusqlite [![Latest Version](https://img.shields.io/crates/v/rusqlite.svg)](https://crates.io/crates/rusqlite) [![Documentation](https://docs.rs/rusqlite/badge.svg)](https://docs.rs/rusqlite) [![Build Status (GitHub)](https://github.com/rusqlite/rusqlite/workflows/CI/badge.svg)](https://github.com/rusqlite/rusqlite/actions) [![Build Status (AppVeyor)](https://ci.appveyor.com/api/projects/status/github/rusqlite/rusqlite?branch=master&svg=true)](https://ci.appveyor.com/project/rusqlite/rusqlite) [![Code Coverage](https://codecov.io/gh/rusqlite/rusqlite/branch/master/graph/badge.svg)](https://codecov.io/gh/rusqlite/rusqlite) [![Dependency Status](https://deps.rs/repo/github/rusqlite/rusqlite/status.svg)](https://deps.rs/repo/github/rusqlite/rusqlite) [![Discord Chat](https://img.shields.io/discord/927966344266256434.svg?logo=discord)](https://discord.gg/nFYfGPB8g4) Rusqlite is an ergonomic wrapper for using SQLite from Rust. Historically, the API was based on the one from [`rust-postgres`](https://github.com/sfackler/rust-postgres). However, the two have diverged in many ways, and no compatibility between the two is intended. ## Usage In your Cargo.toml: ```toml [dependencies] # `bundled` causes us to automatically compile and link in an up to date # version of SQLite for you. This avoids many common build issues, and # avoids depending on the version of SQLite on the users system (or your # system), which may be old or missing. It's the right choice for most # programs that control their own SQLite databases. # # That said, it's not ideal for all scenarios and in particular, generic # libraries built around `rusqlite` should probably not enable it, which # is why it is not a default feature -- it could become hard to disable. rusqlite = { version = "0.29.0", features = ["bundled"] } ``` Simple example usage: ```rust use rusqlite::{Connection, Result}; #[derive(Debug)] struct Person { id: i32, name: String, data: Option>, } fn main() -> Result<()> { let conn = Connection::open_in_memory()?; conn.execute( "CREATE TABLE person ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, data BLOB )", (), // empty list of parameters. )?; let me = Person { id: 0, name: "Steven".to_string(), data: None, }; conn.execute( "INSERT INTO person (name, data) VALUES (?1, ?2)", (&me.name, &me.data), )?; let mut stmt = conn.prepare("SELECT id, name, data FROM person")?; let person_iter = stmt.query_map([], |row| { Ok(Person { id: row.get(0)?, name: row.get(1)?, data: row.get(2)?, }) })?; for person in person_iter { println!("Found person {:?}", person.unwrap()); } Ok(()) } ``` ### Supported SQLite Versions The base `rusqlite` package supports SQLite version 3.14.0 or newer. If you need support for older versions, please file an issue. Some cargo features require a newer SQLite version; see details below. ### Optional Features Rusqlite provides several features that are behind [Cargo features](https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section). They are: * [`load_extension`](https://docs.rs/rusqlite/~0/rusqlite/struct.LoadExtensionGuard.html) allows loading dynamic library-based SQLite extensions. * [`backup`](https://docs.rs/rusqlite/~0/rusqlite/backup/index.html) allows use of SQLite's online backup API. Note: This feature requires SQLite 3.6.11 or later. * [`functions`](https://docs.rs/rusqlite/~0/rusqlite/functions/index.html) allows you to load Rust closures into SQLite connections for use in queries. Note: This feature requires SQLite 3.7.3 or later. * `window` for [window function](https://www.sqlite.org/windowfunctions.html) support (`fun(...) OVER ...`). (Implies `functions`.) * [`trace`](https://docs.rs/rusqlite/~0/rusqlite/trace/index.html) allows hooks into SQLite's tracing and profiling APIs. Note: This feature requires SQLite 3.6.23 or later. * [`blob`](https://docs.rs/rusqlite/~0/rusqlite/blob/index.html) gives `std::io::{Read, Write, Seek}` access to SQL BLOBs. Note: This feature requires SQLite 3.7.4 or later. * [`limits`](https://docs.rs/rusqlite/~0/rusqlite/struct.Connection.html#method.limit) allows you to set and retrieve SQLite's per connection limits. * `chrono` implements [`FromSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.FromSql.html) and [`ToSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.ToSql.html) for various types from the [`chrono` crate](https://crates.io/crates/chrono). * `serde_json` implements [`FromSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.FromSql.html) and [`ToSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.ToSql.html) for the `Value` type from the [`serde_json` crate](https://crates.io/crates/serde_json). * `time` implements [`FromSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.FromSql.html) and [`ToSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.ToSql.html) for the `time::OffsetDateTime` type from the [`time` crate](https://crates.io/crates/time). * `url` implements [`FromSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.FromSql.html) and [`ToSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.ToSql.html) for the `Url` type from the [`url` crate](https://crates.io/crates/url). * `bundled` uses a bundled version of SQLite. This is a good option for cases where linking to SQLite is complicated, such as Windows. * `sqlcipher` looks for the SQLCipher library to link against instead of SQLite. This feature overrides `bundled`. * `bundled-sqlcipher` uses a bundled version of SQLCipher. This searches for and links against a system-installed crypto library to provide the crypto implementation. * `bundled-sqlcipher-vendored-openssl` allows using bundled-sqlcipher with a vendored version of OpenSSL (via the `openssl-sys` crate) as the crypto provider. - As the name implies this depends on the `bundled-sqlcipher` feature, and automatically turns it on. - If turned on, this uses the [`openssl-sys`](https://crates.io/crates/openssl-sys) crate, with the `vendored` feature enabled in order to build and bundle the OpenSSL crypto library. * `hooks` for [Commit, Rollback](http://sqlite.org/c3ref/commit_hook.html) and [Data Change](http://sqlite.org/c3ref/update_hook.html) notification callbacks. * `unlock_notify` for [Unlock](https://sqlite.org/unlock_notify.html) notification. * `vtab` for [virtual table](https://sqlite.org/vtab.html) support (allows you to write virtual table implementations in Rust). Currently, only read-only virtual tables are supported. * `series` exposes [`generate_series(...)`](https://www.sqlite.org/series.html) Table-Valued Function. (Implies `vtab`.) * [`csvtab`](https://sqlite.org/csv.html), CSV virtual table written in Rust. (Implies `vtab`.) * [`array`](https://sqlite.org/carray.html), The `rarray()` Table-Valued Function. (Implies `vtab`.) * `i128_blob` allows storing values of type `i128` type in SQLite databases. Internally, the data is stored as a 16 byte big-endian blob, with the most significant bit flipped, which allows ordering and comparison between different blobs storing i128s to work as expected. * `uuid` allows storing and retrieving `Uuid` values from the [`uuid`](https://docs.rs/uuid/) crate using blobs. * [`session`](https://sqlite.org/sessionintro.html), Session module extension. Requires `buildtime_bindgen` feature. (Implies `hooks`.) * `extra_check` fail when a query passed to execute is readonly or has a column count > 0. * `column_decltype` provides `columns()` method for Statements and Rows; omit if linking to a version of SQLite/SQLCipher compiled with `-DSQLITE_OMIT_DECLTYPE`. * `collation` exposes [`sqlite3_create_collation_v2`](https://sqlite.org/c3ref/create_collation.html). * `winsqlite3` allows linking against the SQLite present in newer versions of Windows ## Notes on building rusqlite and libsqlite3-sys `libsqlite3-sys` is a separate crate from `rusqlite` that provides the Rust declarations for SQLite's C API. By default, `libsqlite3-sys` attempts to find a SQLite library that already exists on your system using pkg-config, or a [Vcpkg](https://github.com/Microsoft/vcpkg) installation for MSVC ABI builds. You can adjust this behavior in a number of ways: * If you use the `bundled`, `bundled-sqlcipher`, or `bundled-sqlcipher-vendored-openssl` features, `libsqlite3-sys` will use the [cc](https://crates.io/crates/cc) crate to compile SQLite or SQLCipher from source and link against that. This source is embedded in the `libsqlite3-sys` crate and is currently SQLite 3.41.2 (as of `rusqlite` 0.29.0 / `libsqlite3-sys` 0.26.0). This is probably the simplest solution to any build problems. You can enable this by adding the following in your `Cargo.toml` file: ```toml [dependencies.rusqlite] version = "0.29.0" features = ["bundled"] ``` * When using any of the `bundled` features, the build script will honor `SQLITE_MAX_VARIABLE_NUMBER` and `SQLITE_MAX_EXPR_DEPTH` variables. It will also honor a `LIBSQLITE3_FLAGS` variable, which can have a format like `"-USQLITE_ALPHA -DSQLITE_BETA SQLITE_GAMMA ..."`. That would disable the `SQLITE_ALPHA` flag, and set the `SQLITE_BETA` and `SQLITE_GAMMA` flags. (The initial `-D` can be omitted, as on the last one.) * When using `bundled-sqlcipher` (and not also using `bundled-sqlcipher-vendored-openssl`), `libsqlite3-sys` will need to link against crypto libraries on the system. If the build script can find a `libcrypto` from OpenSSL or LibreSSL (it will consult `OPENSSL_LIB_DIR`/`OPENSSL_INCLUDE_DIR` and `OPENSSL_DIR` environment variables), it will use that. If building on and for Macs, and none of those variables are set, it will use the system's SecurityFramework instead. * When linking against a SQLite (or SQLCipher) library already on the system (so *not* using any of the `bundled` features), you can set the `SQLITE3_LIB_DIR` (or `SQLCIPHER_LIB_DIR`) environment variable to point to a directory containing the library. You can also set the `SQLITE3_INCLUDE_DIR` (or `SQLCIPHER_INCLUDE_DIR`) variable to point to the directory containing `sqlite3.h`. * Installing the sqlite3 development packages will usually be all that is required, but the build helpers for [pkg-config](https://github.com/alexcrichton/pkg-config-rs) and [vcpkg](https://github.com/mcgoo/vcpkg-rs) have some additional configuration options. The default when using vcpkg is to dynamically link, which must be enabled by setting `VCPKGRS_DYNAMIC=1` environment variable before build. `vcpkg install sqlite3:x64-windows` will install the required library. * When linking against a SQLite (or SQLCipher) library already on the system, you can set the `SQLITE3_STATIC` (or `SQLCIPHER_STATIC`) environment variable to 1 to request that the library be statically instead of dynamically linked. ### Binding generation We use [bindgen](https://crates.io/crates/bindgen) to generate the Rust declarations from SQLite's C header file. `bindgen` [recommends](https://github.com/servo/rust-bindgen#library-usage-with-buildrs) running this as part of the build process of libraries that used this. We tried this briefly (`rusqlite` 0.10.0, specifically), but it had some annoyances: * The build time for `libsqlite3-sys` (and therefore `rusqlite`) increased dramatically. * Running `bindgen` requires a relatively-recent version of Clang, which many systems do not have installed by default. * Running `bindgen` also requires the SQLite header file to be present. As of `rusqlite` 0.10.1, we avoid running `bindgen` at build-time by shipping pregenerated bindings for several versions of SQLite. When compiling `rusqlite`, we use your selected Cargo features to pick the bindings for the minimum SQLite version that supports your chosen features. If you are using `libsqlite3-sys` directly, you can use the same features to choose which pregenerated bindings are chosen: * `min_sqlite_version_3_14_0` - SQLite 3.14.0 bindings (this is the default) If you use any of the `bundled` features, you will get pregenerated bindings for the bundled version of SQLite/SQLCipher. If you need other specific pregenerated binding versions, please file an issue. If you want to run `bindgen` at buildtime to produce your own bindings, use the `buildtime_bindgen` Cargo feature. If you enable the `modern_sqlite` feature, we'll use the bindings we would have included with the bundled build. You generally should have `buildtime_bindgen` enabled if you turn this on, as otherwise you'll need to keep the version of SQLite you link with in sync with what rusqlite would have bundled, (usually the most recent release of SQLite). Failing to do this will cause a runtime error. ## Contributing Rusqlite has many features, and many of them impact the build configuration in incompatible ways. This is unfortunate, and makes testing changes hard. To help here: you generally should ensure that you run tests/lint for `--features bundled`, and `--features "bundled-full session buildtime_bindgen"`. If running bindgen is problematic for you, `--features bundled-full` enables bundled and all features which don't require binding generation, and can be used instead. ### Checklist - Run `cargo fmt` to ensure your Rust code is correctly formatted. - Ensure `cargo clippy --workspace --features bundled` passes without warnings. - Ensure `cargo clippy --workspace --features "bundled-full session buildtime_bindgen"` passes without warnings. - Ensure `cargo test --workspace --features bundled` reports no failures. - Ensure `cargo test --workspace --features "bundled-full session buildtime_bindgen"` reports no failures. ## Author Rusqlite is the product of hard work by a number of people. A list is available here: https://github.com/rusqlite/rusqlite/graphs/contributors ## Community Feel free to join the [Rusqlite Discord Server](https://discord.gg/nFYfGPB8g4) to discuss or get help with `rusqlite` or `libsqlite3-sys`. ## License Rusqlite and libsqlite3-sys are available under the MIT license. See the LICENSE file for more info. ### Licenses of Bundled Software Depending on the set of enabled cargo `features`, rusqlite and libsqlite3-sys will also bundle other libraries, which have their own licensing terms: - If `--features=bundled-sqlcipher` is enabled, the vendored source of [SQLcipher](https://github.com/sqlcipher/sqlcipher) will be compiled and statically linked in. SQLcipher is distributed under a BSD-style license, as described [here](libsqlite3-sys/sqlcipher/LICENSE). - If `--features=bundled` is enabled, the vendored source of SQLite will be compiled and linked in. SQLite is in the public domain, as described [here](https://www.sqlite.org/copyright.html). Both of these are quite permissive, have no bearing on the license of the code in `rusqlite` or `libsqlite3-sys` themselves, and can be entirely ignored if you do not use the feature in question. libsqlite3-sys-0.26.0/Upgrade.md000064400000000000000000000034751046102023000145220ustar 00000000000000# Checks * new [error code(s)](https://sqlite.org/rescode.html) => Update [libsqlite3-sys/src/error.rs](https://github.com/rusqlite/rusqlite/blob/006c8b77e7d235a3072237f006ebabd66b937911/libsqlite3-sys/src/error.rs#L127) And [code_to_str](https://github.com/rusqlite/rusqlite/blob/006c8b77e7d235a3072237f006ebabd66b937911/libsqlite3-sys/src/error.rs#L195) * new [SQLITE_OPEN_*](https://www.sqlite.org/c3ref/c_open_autoproxy.html) => Update [struct OpenFlags](https://github.com/rusqlite/rusqlite/blob/19d08871799500d64336f413dc329cc964149f10/src/lib.rs#L999) * new [SQLITE_LIMIT_*](https://sqlite.org/c3ref/c_limit_attached.html) => Update [enum Limit](https://github.com/rusqlite/rusqlite/blob/66ace52c4a24a811b405ffd9e9010163352a6186/libsqlite3-sys/src/lib.rs#L27) * new [SQLITE_DBCONFIG_*](https://sqlite.org/c3ref/c_dbconfig_defensive.html) => Update [enum DbConfig](https://github.com/rusqlite/rusqlite/blob/7056e656ac92330a3d78f5ac456dea1e56f6bfee/src/config.rs#L15) * new [Authorizer Action Codes](https://sqlite.org/c3ref/c_alter_table.html) => Update [enum AuthAction](https://github.com/rusqlite/rusqlite/blob/2ddbebad9763ab8054e55ef509672b7537ba7cf5/src/hooks.rs#L63) * new [SQLITE_STMTSTATUS_*](https://www.sqlite.org/c3ref/c_stmtstatus_counter.html) => Update [enum StatementStatus](https://github.com/rusqlite/rusqlite/blob/ce90b519bb9946bf1cbab77479bb92d0fbc467c0/src/statement.rs#L937) * new [SQLITE_INDEX_CONSTRAINT_*](https://sqlite.org/c3ref/c_index_constraint_eq.html) => Update [enum IndexConstraintOp](https://github.com/rusqlite/rusqlite/blob/5d42ba7c29a35dbb8eeb047e84ae0739cb152754/src/vtab/mod.rs#L267) * new [function flag(s)](https://sqlite.org/c3ref/c_deterministic.html) => Update [struct FunctionFlags](https://github.com/rusqlite/rusqlite/blob/0312937d6a75b45d7e603fa8c6b083bc7774270b/src/functions.rs#L317)libsqlite3-sys-0.26.0/bindgen-bindings/bindgen_3.14.0.rs000064400000000000000000003102241046102023000205620ustar 00000000000000/* automatically generated by rust-bindgen 0.60.1 */ pub const SQLITE_VERSION: &[u8; 7usize] = b"3.14.0\0"; pub const SQLITE_VERSION_NUMBER: i32 = 3014000; pub const SQLITE_SOURCE_ID: &[u8; 61usize] = b"2016-08-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de\0"; pub const SQLITE_OK: i32 = 0; pub const SQLITE_ERROR: i32 = 1; pub const SQLITE_INTERNAL: i32 = 2; pub const SQLITE_PERM: i32 = 3; pub const SQLITE_ABORT: i32 = 4; pub const SQLITE_BUSY: i32 = 5; pub const SQLITE_LOCKED: i32 = 6; pub const SQLITE_NOMEM: i32 = 7; pub const SQLITE_READONLY: i32 = 8; pub const SQLITE_INTERRUPT: i32 = 9; pub const SQLITE_IOERR: i32 = 10; pub const SQLITE_CORRUPT: i32 = 11; pub const SQLITE_NOTFOUND: i32 = 12; pub const SQLITE_FULL: i32 = 13; pub const SQLITE_CANTOPEN: i32 = 14; pub const SQLITE_PROTOCOL: i32 = 15; pub const SQLITE_EMPTY: i32 = 16; pub const SQLITE_SCHEMA: i32 = 17; pub const SQLITE_TOOBIG: i32 = 18; pub const SQLITE_CONSTRAINT: i32 = 19; pub const SQLITE_MISMATCH: i32 = 20; pub const SQLITE_MISUSE: i32 = 21; pub const SQLITE_NOLFS: i32 = 22; pub const SQLITE_AUTH: i32 = 23; pub const SQLITE_FORMAT: i32 = 24; pub const SQLITE_RANGE: i32 = 25; pub const SQLITE_NOTADB: i32 = 26; pub const SQLITE_NOTICE: i32 = 27; pub const SQLITE_WARNING: i32 = 28; pub const SQLITE_ROW: i32 = 100; pub const SQLITE_DONE: i32 = 101; pub const SQLITE_IOERR_READ: i32 = 266; pub const SQLITE_IOERR_SHORT_READ: i32 = 522; pub const SQLITE_IOERR_WRITE: i32 = 778; pub const SQLITE_IOERR_FSYNC: i32 = 1034; pub const SQLITE_IOERR_DIR_FSYNC: i32 = 1290; pub const SQLITE_IOERR_TRUNCATE: i32 = 1546; pub const SQLITE_IOERR_FSTAT: i32 = 1802; pub const SQLITE_IOERR_UNLOCK: i32 = 2058; pub const SQLITE_IOERR_RDLOCK: i32 = 2314; pub const SQLITE_IOERR_DELETE: i32 = 2570; pub const SQLITE_IOERR_BLOCKED: i32 = 2826; pub const SQLITE_IOERR_NOMEM: i32 = 3082; pub const SQLITE_IOERR_ACCESS: i32 = 3338; pub const SQLITE_IOERR_CHECKRESERVEDLOCK: i32 = 3594; pub const SQLITE_IOERR_LOCK: i32 = 3850; pub const SQLITE_IOERR_CLOSE: i32 = 4106; pub const SQLITE_IOERR_DIR_CLOSE: i32 = 4362; pub const SQLITE_IOERR_SHMOPEN: i32 = 4618; pub const SQLITE_IOERR_SHMSIZE: i32 = 4874; pub const SQLITE_IOERR_SHMLOCK: i32 = 5130; pub const SQLITE_IOERR_SHMMAP: i32 = 5386; pub const SQLITE_IOERR_SEEK: i32 = 5642; pub const SQLITE_IOERR_DELETE_NOENT: i32 = 5898; pub const SQLITE_IOERR_MMAP: i32 = 6154; pub const SQLITE_IOERR_GETTEMPPATH: i32 = 6410; pub const SQLITE_IOERR_CONVPATH: i32 = 6666; pub const SQLITE_IOERR_VNODE: i32 = 6922; pub const SQLITE_IOERR_AUTH: i32 = 7178; pub const SQLITE_LOCKED_SHAREDCACHE: i32 = 262; pub const SQLITE_BUSY_RECOVERY: i32 = 261; pub const SQLITE_BUSY_SNAPSHOT: i32 = 517; pub const SQLITE_CANTOPEN_NOTEMPDIR: i32 = 270; pub const SQLITE_CANTOPEN_ISDIR: i32 = 526; pub const SQLITE_CANTOPEN_FULLPATH: i32 = 782; pub const SQLITE_CANTOPEN_CONVPATH: i32 = 1038; pub const SQLITE_CORRUPT_VTAB: i32 = 267; pub const SQLITE_READONLY_RECOVERY: i32 = 264; pub const SQLITE_READONLY_CANTLOCK: i32 = 520; pub const SQLITE_READONLY_ROLLBACK: i32 = 776; pub const SQLITE_READONLY_DBMOVED: i32 = 1032; pub const SQLITE_ABORT_ROLLBACK: i32 = 516; pub const SQLITE_CONSTRAINT_CHECK: i32 = 275; pub const SQLITE_CONSTRAINT_COMMITHOOK: i32 = 531; pub const SQLITE_CONSTRAINT_FOREIGNKEY: i32 = 787; pub const SQLITE_CONSTRAINT_FUNCTION: i32 = 1043; pub const SQLITE_CONSTRAINT_NOTNULL: i32 = 1299; pub const SQLITE_CONSTRAINT_PRIMARYKEY: i32 = 1555; pub const SQLITE_CONSTRAINT_TRIGGER: i32 = 1811; pub const SQLITE_CONSTRAINT_UNIQUE: i32 = 2067; pub const SQLITE_CONSTRAINT_VTAB: i32 = 2323; pub const SQLITE_CONSTRAINT_ROWID: i32 = 2579; pub const SQLITE_NOTICE_RECOVER_WAL: i32 = 283; pub const SQLITE_NOTICE_RECOVER_ROLLBACK: i32 = 539; pub const SQLITE_WARNING_AUTOINDEX: i32 = 284; pub const SQLITE_AUTH_USER: i32 = 279; pub const SQLITE_OK_LOAD_PERMANENTLY: i32 = 256; pub const SQLITE_OPEN_READONLY: i32 = 1; pub const SQLITE_OPEN_READWRITE: i32 = 2; pub const SQLITE_OPEN_CREATE: i32 = 4; pub const SQLITE_OPEN_DELETEONCLOSE: i32 = 8; pub const SQLITE_OPEN_EXCLUSIVE: i32 = 16; pub const SQLITE_OPEN_AUTOPROXY: i32 = 32; pub const SQLITE_OPEN_URI: i32 = 64; pub const SQLITE_OPEN_MEMORY: i32 = 128; pub const SQLITE_OPEN_MAIN_DB: i32 = 256; pub const SQLITE_OPEN_TEMP_DB: i32 = 512; pub const SQLITE_OPEN_TRANSIENT_DB: i32 = 1024; pub const SQLITE_OPEN_MAIN_JOURNAL: i32 = 2048; pub const SQLITE_OPEN_TEMP_JOURNAL: i32 = 4096; pub const SQLITE_OPEN_SUBJOURNAL: i32 = 8192; pub const SQLITE_OPEN_MASTER_JOURNAL: i32 = 16384; pub const SQLITE_OPEN_NOMUTEX: i32 = 32768; pub const SQLITE_OPEN_FULLMUTEX: i32 = 65536; pub const SQLITE_OPEN_SHAREDCACHE: i32 = 131072; pub const SQLITE_OPEN_PRIVATECACHE: i32 = 262144; pub const SQLITE_OPEN_WAL: i32 = 524288; pub const SQLITE_IOCAP_ATOMIC: i32 = 1; pub const SQLITE_IOCAP_ATOMIC512: i32 = 2; pub const SQLITE_IOCAP_ATOMIC1K: i32 = 4; pub const SQLITE_IOCAP_ATOMIC2K: i32 = 8; pub const SQLITE_IOCAP_ATOMIC4K: i32 = 16; pub const SQLITE_IOCAP_ATOMIC8K: i32 = 32; pub const SQLITE_IOCAP_ATOMIC16K: i32 = 64; pub const SQLITE_IOCAP_ATOMIC32K: i32 = 128; pub const SQLITE_IOCAP_ATOMIC64K: i32 = 256; pub const SQLITE_IOCAP_SAFE_APPEND: i32 = 512; pub const SQLITE_IOCAP_SEQUENTIAL: i32 = 1024; pub const SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN: i32 = 2048; pub const SQLITE_IOCAP_POWERSAFE_OVERWRITE: i32 = 4096; pub const SQLITE_IOCAP_IMMUTABLE: i32 = 8192; pub const SQLITE_LOCK_NONE: i32 = 0; pub const SQLITE_LOCK_SHARED: i32 = 1; pub const SQLITE_LOCK_RESERVED: i32 = 2; pub const SQLITE_LOCK_PENDING: i32 = 3; pub const SQLITE_LOCK_EXCLUSIVE: i32 = 4; pub const SQLITE_SYNC_NORMAL: i32 = 2; pub const SQLITE_SYNC_FULL: i32 = 3; pub const SQLITE_SYNC_DATAONLY: i32 = 16; pub const SQLITE_FCNTL_LOCKSTATE: i32 = 1; pub const SQLITE_FCNTL_GET_LOCKPROXYFILE: i32 = 2; pub const SQLITE_FCNTL_SET_LOCKPROXYFILE: i32 = 3; pub const SQLITE_FCNTL_LAST_ERRNO: i32 = 4; pub const SQLITE_FCNTL_SIZE_HINT: i32 = 5; pub const SQLITE_FCNTL_CHUNK_SIZE: i32 = 6; pub const SQLITE_FCNTL_FILE_POINTER: i32 = 7; pub const SQLITE_FCNTL_SYNC_OMITTED: i32 = 8; pub const SQLITE_FCNTL_WIN32_AV_RETRY: i32 = 9; pub const SQLITE_FCNTL_PERSIST_WAL: i32 = 10; pub const SQLITE_FCNTL_OVERWRITE: i32 = 11; pub const SQLITE_FCNTL_VFSNAME: i32 = 12; pub const SQLITE_FCNTL_POWERSAFE_OVERWRITE: i32 = 13; pub const SQLITE_FCNTL_PRAGMA: i32 = 14; pub const SQLITE_FCNTL_BUSYHANDLER: i32 = 15; pub const SQLITE_FCNTL_TEMPFILENAME: i32 = 16; pub const SQLITE_FCNTL_MMAP_SIZE: i32 = 18; pub const SQLITE_FCNTL_TRACE: i32 = 19; pub const SQLITE_FCNTL_HAS_MOVED: i32 = 20; pub const SQLITE_FCNTL_SYNC: i32 = 21; pub const SQLITE_FCNTL_COMMIT_PHASETWO: i32 = 22; pub const SQLITE_FCNTL_WIN32_SET_HANDLE: i32 = 23; pub const SQLITE_FCNTL_WAL_BLOCK: i32 = 24; pub const SQLITE_FCNTL_ZIPVFS: i32 = 25; pub const SQLITE_FCNTL_RBU: i32 = 26; pub const SQLITE_FCNTL_VFS_POINTER: i32 = 27; pub const SQLITE_FCNTL_JOURNAL_POINTER: i32 = 28; pub const SQLITE_GET_LOCKPROXYFILE: i32 = 2; pub const SQLITE_SET_LOCKPROXYFILE: i32 = 3; pub const SQLITE_LAST_ERRNO: i32 = 4; pub const SQLITE_ACCESS_EXISTS: i32 = 0; pub const SQLITE_ACCESS_READWRITE: i32 = 1; pub const SQLITE_ACCESS_READ: i32 = 2; pub const SQLITE_SHM_UNLOCK: i32 = 1; pub const SQLITE_SHM_LOCK: i32 = 2; pub const SQLITE_SHM_SHARED: i32 = 4; pub const SQLITE_SHM_EXCLUSIVE: i32 = 8; pub const SQLITE_SHM_NLOCK: i32 = 8; pub const SQLITE_CONFIG_SINGLETHREAD: i32 = 1; pub const SQLITE_CONFIG_MULTITHREAD: i32 = 2; pub const SQLITE_CONFIG_SERIALIZED: i32 = 3; pub const SQLITE_CONFIG_MALLOC: i32 = 4; pub const SQLITE_CONFIG_GETMALLOC: i32 = 5; pub const SQLITE_CONFIG_SCRATCH: i32 = 6; pub const SQLITE_CONFIG_PAGECACHE: i32 = 7; pub const SQLITE_CONFIG_HEAP: i32 = 8; pub const SQLITE_CONFIG_MEMSTATUS: i32 = 9; pub const SQLITE_CONFIG_MUTEX: i32 = 10; pub const SQLITE_CONFIG_GETMUTEX: i32 = 11; pub const SQLITE_CONFIG_LOOKASIDE: i32 = 13; pub const SQLITE_CONFIG_PCACHE: i32 = 14; pub const SQLITE_CONFIG_GETPCACHE: i32 = 15; pub const SQLITE_CONFIG_LOG: i32 = 16; pub const SQLITE_CONFIG_URI: i32 = 17; pub const SQLITE_CONFIG_PCACHE2: i32 = 18; pub const SQLITE_CONFIG_GETPCACHE2: i32 = 19; pub const SQLITE_CONFIG_COVERING_INDEX_SCAN: i32 = 20; pub const SQLITE_CONFIG_SQLLOG: i32 = 21; pub const SQLITE_CONFIG_MMAP_SIZE: i32 = 22; pub const SQLITE_CONFIG_WIN32_HEAPSIZE: i32 = 23; pub const SQLITE_CONFIG_PCACHE_HDRSZ: i32 = 24; pub const SQLITE_CONFIG_PMASZ: i32 = 25; pub const SQLITE_CONFIG_STMTJRNL_SPILL: i32 = 26; pub const SQLITE_DBCONFIG_LOOKASIDE: i32 = 1001; pub const SQLITE_DBCONFIG_ENABLE_FKEY: i32 = 1002; pub const SQLITE_DBCONFIG_ENABLE_TRIGGER: i32 = 1003; pub const SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER: i32 = 1004; pub const SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION: i32 = 1005; pub const SQLITE_DENY: i32 = 1; pub const SQLITE_IGNORE: i32 = 2; pub const SQLITE_CREATE_INDEX: i32 = 1; pub const SQLITE_CREATE_TABLE: i32 = 2; pub const SQLITE_CREATE_TEMP_INDEX: i32 = 3; pub const SQLITE_CREATE_TEMP_TABLE: i32 = 4; pub const SQLITE_CREATE_TEMP_TRIGGER: i32 = 5; pub const SQLITE_CREATE_TEMP_VIEW: i32 = 6; pub const SQLITE_CREATE_TRIGGER: i32 = 7; pub const SQLITE_CREATE_VIEW: i32 = 8; pub const SQLITE_DELETE: i32 = 9; pub const SQLITE_DROP_INDEX: i32 = 10; pub const SQLITE_DROP_TABLE: i32 = 11; pub const SQLITE_DROP_TEMP_INDEX: i32 = 12; pub const SQLITE_DROP_TEMP_TABLE: i32 = 13; pub const SQLITE_DROP_TEMP_TRIGGER: i32 = 14; pub const SQLITE_DROP_TEMP_VIEW: i32 = 15; pub const SQLITE_DROP_TRIGGER: i32 = 16; pub const SQLITE_DROP_VIEW: i32 = 17; pub const SQLITE_INSERT: i32 = 18; pub const SQLITE_PRAGMA: i32 = 19; pub const SQLITE_READ: i32 = 20; pub const SQLITE_SELECT: i32 = 21; pub const SQLITE_TRANSACTION: i32 = 22; pub const SQLITE_UPDATE: i32 = 23; pub const SQLITE_ATTACH: i32 = 24; pub const SQLITE_DETACH: i32 = 25; pub const SQLITE_ALTER_TABLE: i32 = 26; pub const SQLITE_REINDEX: i32 = 27; pub const SQLITE_ANALYZE: i32 = 28; pub const SQLITE_CREATE_VTABLE: i32 = 29; pub const SQLITE_DROP_VTABLE: i32 = 30; pub const SQLITE_FUNCTION: i32 = 31; pub const SQLITE_SAVEPOINT: i32 = 32; pub const SQLITE_COPY: i32 = 0; pub const SQLITE_RECURSIVE: i32 = 33; pub const SQLITE_TRACE_STMT: i32 = 1; pub const SQLITE_TRACE_PROFILE: i32 = 2; pub const SQLITE_TRACE_ROW: i32 = 4; pub const SQLITE_TRACE_CLOSE: i32 = 8; pub const SQLITE_LIMIT_LENGTH: i32 = 0; pub const SQLITE_LIMIT_SQL_LENGTH: i32 = 1; pub const SQLITE_LIMIT_COLUMN: i32 = 2; pub const SQLITE_LIMIT_EXPR_DEPTH: i32 = 3; pub const SQLITE_LIMIT_COMPOUND_SELECT: i32 = 4; pub const SQLITE_LIMIT_VDBE_OP: i32 = 5; pub const SQLITE_LIMIT_FUNCTION_ARG: i32 = 6; pub const SQLITE_LIMIT_ATTACHED: i32 = 7; pub const SQLITE_LIMIT_LIKE_PATTERN_LENGTH: i32 = 8; pub const SQLITE_LIMIT_VARIABLE_NUMBER: i32 = 9; pub const SQLITE_LIMIT_TRIGGER_DEPTH: i32 = 10; pub const SQLITE_LIMIT_WORKER_THREADS: i32 = 11; pub const SQLITE_INTEGER: i32 = 1; pub const SQLITE_FLOAT: i32 = 2; pub const SQLITE_BLOB: i32 = 4; pub const SQLITE_NULL: i32 = 5; pub const SQLITE_TEXT: i32 = 3; pub const SQLITE3_TEXT: i32 = 3; pub const SQLITE_UTF8: i32 = 1; pub const SQLITE_UTF16LE: i32 = 2; pub const SQLITE_UTF16BE: i32 = 3; pub const SQLITE_UTF16: i32 = 4; pub const SQLITE_ANY: i32 = 5; pub const SQLITE_UTF16_ALIGNED: i32 = 8; pub const SQLITE_DETERMINISTIC: i32 = 2048; pub const SQLITE_INDEX_SCAN_UNIQUE: i32 = 1; pub const SQLITE_INDEX_CONSTRAINT_EQ: i32 = 2; pub const SQLITE_INDEX_CONSTRAINT_GT: i32 = 4; pub const SQLITE_INDEX_CONSTRAINT_LE: i32 = 8; pub const SQLITE_INDEX_CONSTRAINT_LT: i32 = 16; pub const SQLITE_INDEX_CONSTRAINT_GE: i32 = 32; pub const SQLITE_INDEX_CONSTRAINT_MATCH: i32 = 64; pub const SQLITE_INDEX_CONSTRAINT_LIKE: i32 = 65; pub const SQLITE_INDEX_CONSTRAINT_GLOB: i32 = 66; pub const SQLITE_INDEX_CONSTRAINT_REGEXP: i32 = 67; pub const SQLITE_MUTEX_FAST: i32 = 0; pub const SQLITE_MUTEX_RECURSIVE: i32 = 1; pub const SQLITE_MUTEX_STATIC_MASTER: i32 = 2; pub const SQLITE_MUTEX_STATIC_MEM: i32 = 3; pub const SQLITE_MUTEX_STATIC_MEM2: i32 = 4; pub const SQLITE_MUTEX_STATIC_OPEN: i32 = 4; pub const SQLITE_MUTEX_STATIC_PRNG: i32 = 5; pub const SQLITE_MUTEX_STATIC_LRU: i32 = 6; pub const SQLITE_MUTEX_STATIC_LRU2: i32 = 7; pub const SQLITE_MUTEX_STATIC_PMEM: i32 = 7; pub const SQLITE_MUTEX_STATIC_APP1: i32 = 8; pub const SQLITE_MUTEX_STATIC_APP2: i32 = 9; pub const SQLITE_MUTEX_STATIC_APP3: i32 = 10; pub const SQLITE_MUTEX_STATIC_VFS1: i32 = 11; pub const SQLITE_MUTEX_STATIC_VFS2: i32 = 12; pub const SQLITE_MUTEX_STATIC_VFS3: i32 = 13; pub const SQLITE_TESTCTRL_FIRST: i32 = 5; pub const SQLITE_TESTCTRL_PRNG_SAVE: i32 = 5; pub const SQLITE_TESTCTRL_PRNG_RESTORE: i32 = 6; pub const SQLITE_TESTCTRL_PRNG_RESET: i32 = 7; pub const SQLITE_TESTCTRL_BITVEC_TEST: i32 = 8; pub const SQLITE_TESTCTRL_FAULT_INSTALL: i32 = 9; pub const SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS: i32 = 10; pub const SQLITE_TESTCTRL_PENDING_BYTE: i32 = 11; pub const SQLITE_TESTCTRL_ASSERT: i32 = 12; pub const SQLITE_TESTCTRL_ALWAYS: i32 = 13; pub const SQLITE_TESTCTRL_RESERVE: i32 = 14; pub const SQLITE_TESTCTRL_OPTIMIZATIONS: i32 = 15; pub const SQLITE_TESTCTRL_ISKEYWORD: i32 = 16; pub const SQLITE_TESTCTRL_SCRATCHMALLOC: i32 = 17; pub const SQLITE_TESTCTRL_LOCALTIME_FAULT: i32 = 18; pub const SQLITE_TESTCTRL_EXPLAIN_STMT: i32 = 19; pub const SQLITE_TESTCTRL_NEVER_CORRUPT: i32 = 20; pub const SQLITE_TESTCTRL_VDBE_COVERAGE: i32 = 21; pub const SQLITE_TESTCTRL_BYTEORDER: i32 = 22; pub const SQLITE_TESTCTRL_ISINIT: i32 = 23; pub const SQLITE_TESTCTRL_SORTER_MMAP: i32 = 24; pub const SQLITE_TESTCTRL_IMPOSTER: i32 = 25; pub const SQLITE_TESTCTRL_LAST: i32 = 25; pub const SQLITE_STATUS_MEMORY_USED: i32 = 0; pub const SQLITE_STATUS_PAGECACHE_USED: i32 = 1; pub const SQLITE_STATUS_PAGECACHE_OVERFLOW: i32 = 2; pub const SQLITE_STATUS_SCRATCH_USED: i32 = 3; pub const SQLITE_STATUS_SCRATCH_OVERFLOW: i32 = 4; pub const SQLITE_STATUS_MALLOC_SIZE: i32 = 5; pub const SQLITE_STATUS_PARSER_STACK: i32 = 6; pub const SQLITE_STATUS_PAGECACHE_SIZE: i32 = 7; pub const SQLITE_STATUS_SCRATCH_SIZE: i32 = 8; pub const SQLITE_STATUS_MALLOC_COUNT: i32 = 9; pub const SQLITE_DBSTATUS_LOOKASIDE_USED: i32 = 0; pub const SQLITE_DBSTATUS_CACHE_USED: i32 = 1; pub const SQLITE_DBSTATUS_SCHEMA_USED: i32 = 2; pub const SQLITE_DBSTATUS_STMT_USED: i32 = 3; pub const SQLITE_DBSTATUS_LOOKASIDE_HIT: i32 = 4; pub const SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE: i32 = 5; pub const SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL: i32 = 6; pub const SQLITE_DBSTATUS_CACHE_HIT: i32 = 7; pub const SQLITE_DBSTATUS_CACHE_MISS: i32 = 8; pub const SQLITE_DBSTATUS_CACHE_WRITE: i32 = 9; pub const SQLITE_DBSTATUS_DEFERRED_FKS: i32 = 10; pub const SQLITE_DBSTATUS_CACHE_USED_SHARED: i32 = 11; pub const SQLITE_DBSTATUS_MAX: i32 = 11; pub const SQLITE_STMTSTATUS_FULLSCAN_STEP: i32 = 1; pub const SQLITE_STMTSTATUS_SORT: i32 = 2; pub const SQLITE_STMTSTATUS_AUTOINDEX: i32 = 3; pub const SQLITE_STMTSTATUS_VM_STEP: i32 = 4; pub const SQLITE_CHECKPOINT_PASSIVE: i32 = 0; pub const SQLITE_CHECKPOINT_FULL: i32 = 1; pub const SQLITE_CHECKPOINT_RESTART: i32 = 2; pub const SQLITE_CHECKPOINT_TRUNCATE: i32 = 3; pub const SQLITE_VTAB_CONSTRAINT_SUPPORT: i32 = 1; pub const SQLITE_ROLLBACK: i32 = 1; pub const SQLITE_FAIL: i32 = 3; pub const SQLITE_REPLACE: i32 = 5; pub const SQLITE_SCANSTAT_NLOOP: i32 = 0; pub const SQLITE_SCANSTAT_NVISIT: i32 = 1; pub const SQLITE_SCANSTAT_EST: i32 = 2; pub const SQLITE_SCANSTAT_NAME: i32 = 3; pub const SQLITE_SCANSTAT_EXPLAIN: i32 = 4; pub const SQLITE_SCANSTAT_SELECTID: i32 = 5; pub const NOT_WITHIN: i32 = 0; pub const PARTLY_WITHIN: i32 = 1; pub const FULLY_WITHIN: i32 = 2; pub const __SQLITESESSION_H_: i32 = 1; pub const SQLITE_CHANGESET_DATA: i32 = 1; pub const SQLITE_CHANGESET_NOTFOUND: i32 = 2; pub const SQLITE_CHANGESET_CONFLICT: i32 = 3; pub const SQLITE_CHANGESET_CONSTRAINT: i32 = 4; pub const SQLITE_CHANGESET_FOREIGN_KEY: i32 = 5; pub const SQLITE_CHANGESET_OMIT: i32 = 0; pub const SQLITE_CHANGESET_REPLACE: i32 = 1; pub const SQLITE_CHANGESET_ABORT: i32 = 2; pub const FTS5_TOKENIZE_QUERY: i32 = 1; pub const FTS5_TOKENIZE_PREFIX: i32 = 2; pub const FTS5_TOKENIZE_DOCUMENT: i32 = 4; pub const FTS5_TOKENIZE_AUX: i32 = 8; pub const FTS5_TOKEN_COLOCATED: i32 = 1; extern "C" { pub static mut sqlite3_version: [::std::os::raw::c_char; 0usize]; } extern "C" { pub fn sqlite3_libversion() -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_sourceid() -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_libversion_number() -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_compileoption_used( zOptName: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_compileoption_get(N: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_threadsafe() -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3 { _unused: [u8; 0], } pub type sqlite_int64 = ::std::os::raw::c_longlong; pub type sqlite_uint64 = ::std::os::raw::c_ulonglong; pub type sqlite3_int64 = sqlite_int64; pub type sqlite3_uint64 = sqlite_uint64; extern "C" { pub fn sqlite3_close(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_close_v2(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } pub type sqlite3_callback = ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, arg3: *mut *mut ::std::os::raw::c_char, arg4: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >; extern "C" { pub fn sqlite3_exec( arg1: *mut sqlite3, sql: *const ::std::os::raw::c_char, callback: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, arg3: *mut *mut ::std::os::raw::c_char, arg4: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, arg2: *mut ::std::os::raw::c_void, errmsg: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_file { pub pMethods: *const sqlite3_io_methods, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_io_methods { pub iVersion: ::std::os::raw::c_int, pub xClose: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_file) -> ::std::os::raw::c_int, >, pub xRead: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, arg2: *mut ::std::os::raw::c_void, iAmt: ::std::os::raw::c_int, iOfst: sqlite3_int64, ) -> ::std::os::raw::c_int, >, pub xWrite: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, arg2: *const ::std::os::raw::c_void, iAmt: ::std::os::raw::c_int, iOfst: sqlite3_int64, ) -> ::std::os::raw::c_int, >, pub xTruncate: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_file, size: sqlite3_int64) -> ::std::os::raw::c_int, >, pub xSync: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xFileSize: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, pSize: *mut sqlite3_int64, ) -> ::std::os::raw::c_int, >, pub xLock: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, arg2: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xUnlock: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, arg2: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xCheckReservedLock: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, pResOut: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xFileControl: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, op: ::std::os::raw::c_int, pArg: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, pub xSectorSize: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_file) -> ::std::os::raw::c_int, >, pub xDeviceCharacteristics: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_file) -> ::std::os::raw::c_int, >, pub xShmMap: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, iPg: ::std::os::raw::c_int, pgsz: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int, arg3: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, pub xShmLock: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, offset: ::std::os::raw::c_int, n: ::std::os::raw::c_int, flags: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xShmBarrier: ::std::option::Option, pub xShmUnmap: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, deleteFlag: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xFetch: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, iOfst: sqlite3_int64, iAmt: ::std::os::raw::c_int, pp: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, pub xUnfetch: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_file, iOfst: sqlite3_int64, p: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_mutex { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_api_routines { _unused: [u8; 0], } pub type sqlite3_syscall_ptr = ::std::option::Option; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_vfs { pub iVersion: ::std::os::raw::c_int, pub szOsFile: ::std::os::raw::c_int, pub mxPathname: ::std::os::raw::c_int, pub pNext: *mut sqlite3_vfs, pub zName: *const ::std::os::raw::c_char, pub pAppData: *mut ::std::os::raw::c_void, pub xOpen: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, zName: *const ::std::os::raw::c_char, arg2: *mut sqlite3_file, flags: ::std::os::raw::c_int, pOutFlags: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xDelete: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, zName: *const ::std::os::raw::c_char, syncDir: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xAccess: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, zName: *const ::std::os::raw::c_char, flags: ::std::os::raw::c_int, pResOut: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xFullPathname: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, zName: *const ::std::os::raw::c_char, nOut: ::std::os::raw::c_int, zOut: *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, pub xDlOpen: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, zFilename: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void, >, pub xDlError: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, nByte: ::std::os::raw::c_int, zErrMsg: *mut ::std::os::raw::c_char, ), >, pub xDlSym: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, arg2: *mut ::std::os::raw::c_void, zSymbol: *const ::std::os::raw::c_char, ) -> ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, arg2: *mut ::std::os::raw::c_void, zSymbol: *const ::std::os::raw::c_char, ), >, >, pub xDlClose: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_vfs, arg2: *mut ::std::os::raw::c_void), >, pub xRandomness: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, nByte: ::std::os::raw::c_int, zOut: *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, pub xSleep: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, microseconds: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xCurrentTime: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_vfs, arg2: *mut f64) -> ::std::os::raw::c_int, >, pub xGetLastError: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, arg2: ::std::os::raw::c_int, arg3: *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, pub xCurrentTimeInt64: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, arg2: *mut sqlite3_int64, ) -> ::std::os::raw::c_int, >, pub xSetSystemCall: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, zName: *const ::std::os::raw::c_char, arg2: sqlite3_syscall_ptr, ) -> ::std::os::raw::c_int, >, pub xGetSystemCall: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, zName: *const ::std::os::raw::c_char, ) -> sqlite3_syscall_ptr, >, pub xNextSystemCall: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vfs, zName: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char, >, } extern "C" { pub fn sqlite3_initialize() -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_shutdown() -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_os_init() -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_os_end() -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_config(arg1: ::std::os::raw::c_int, ...) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_db_config( arg1: *mut sqlite3, op: ::std::os::raw::c_int, ... ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_mem_methods { pub xMalloc: ::std::option::Option< unsafe extern "C" fn(arg1: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void, >, pub xFree: ::std::option::Option, pub xRealloc: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_void, >, pub xSize: ::std::option::Option< unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, >, pub xRoundup: ::std::option::Option< unsafe extern "C" fn(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int, >, pub xInit: ::std::option::Option< unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, >, pub xShutdown: ::std::option::Option, pub pAppData: *mut ::std::os::raw::c_void, } extern "C" { pub fn sqlite3_extended_result_codes( arg1: *mut sqlite3, onoff: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_last_insert_rowid(arg1: *mut sqlite3) -> sqlite3_int64; } extern "C" { pub fn sqlite3_changes(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_total_changes(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_interrupt(arg1: *mut sqlite3); } extern "C" { pub fn sqlite3_complete(sql: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_complete16(sql: *const ::std::os::raw::c_void) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_busy_handler( arg1: *mut sqlite3, arg2: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, arg3: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_busy_timeout( arg1: *mut sqlite3, ms: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_get_table( db: *mut sqlite3, zSql: *const ::std::os::raw::c_char, pazResult: *mut *mut *mut ::std::os::raw::c_char, pnRow: *mut ::std::os::raw::c_int, pnColumn: *mut ::std::os::raw::c_int, pzErrmsg: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_free_table(result: *mut *mut ::std::os::raw::c_char); } extern "C" { pub fn sqlite3_mprintf(arg1: *const ::std::os::raw::c_char, ...) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_snprintf( arg1: ::std::os::raw::c_int, arg2: *mut ::std::os::raw::c_char, arg3: *const ::std::os::raw::c_char, ... ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_malloc(arg1: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_malloc64(arg1: sqlite3_uint64) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_realloc( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_realloc64( arg1: *mut ::std::os::raw::c_void, arg2: sqlite3_uint64, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_free(arg1: *mut ::std::os::raw::c_void); } extern "C" { pub fn sqlite3_msize(arg1: *mut ::std::os::raw::c_void) -> sqlite3_uint64; } extern "C" { pub fn sqlite3_memory_used() -> sqlite3_int64; } extern "C" { pub fn sqlite3_memory_highwater(resetFlag: ::std::os::raw::c_int) -> sqlite3_int64; } extern "C" { pub fn sqlite3_randomness(N: ::std::os::raw::c_int, P: *mut ::std::os::raw::c_void); } extern "C" { pub fn sqlite3_set_authorizer( arg1: *mut sqlite3, xAuth: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_char, arg4: *const ::std::os::raw::c_char, arg5: *const ::std::os::raw::c_char, arg6: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, pUserData: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_trace( arg1: *mut sqlite3, xTrace: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: *const ::std::os::raw::c_char, ), >, arg2: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_profile( arg1: *mut sqlite3, xProfile: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: *const ::std::os::raw::c_char, arg3: sqlite3_uint64, ), >, arg2: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_trace_v2( arg1: *mut sqlite3, uMask: ::std::os::raw::c_uint, xCallback: ::std::option::Option< unsafe extern "C" fn( arg1: ::std::os::raw::c_uint, arg2: *mut ::std::os::raw::c_void, arg3: *mut ::std::os::raw::c_void, arg4: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, pCtx: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_progress_handler( arg1: *mut sqlite3, arg2: ::std::os::raw::c_int, arg3: ::std::option::Option< unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, >, arg4: *mut ::std::os::raw::c_void, ); } extern "C" { pub fn sqlite3_open( filename: *const ::std::os::raw::c_char, ppDb: *mut *mut sqlite3, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_open16( filename: *const ::std::os::raw::c_void, ppDb: *mut *mut sqlite3, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_open_v2( filename: *const ::std::os::raw::c_char, ppDb: *mut *mut sqlite3, flags: ::std::os::raw::c_int, zVfs: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_uri_parameter( zFilename: *const ::std::os::raw::c_char, zParam: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_uri_boolean( zFile: *const ::std::os::raw::c_char, zParam: *const ::std::os::raw::c_char, bDefault: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_uri_int64( arg1: *const ::std::os::raw::c_char, arg2: *const ::std::os::raw::c_char, arg3: sqlite3_int64, ) -> sqlite3_int64; } extern "C" { pub fn sqlite3_errcode(db: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_extended_errcode(db: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_errmsg(arg1: *mut sqlite3) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_errmsg16(arg1: *mut sqlite3) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_errstr(arg1: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_stmt { _unused: [u8; 0], } extern "C" { pub fn sqlite3_limit( arg1: *mut sqlite3, id: ::std::os::raw::c_int, newVal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_prepare( db: *mut sqlite3, zSql: *const ::std::os::raw::c_char, nByte: ::std::os::raw::c_int, ppStmt: *mut *mut sqlite3_stmt, pzTail: *mut *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_prepare_v2( db: *mut sqlite3, zSql: *const ::std::os::raw::c_char, nByte: ::std::os::raw::c_int, ppStmt: *mut *mut sqlite3_stmt, pzTail: *mut *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_prepare16( db: *mut sqlite3, zSql: *const ::std::os::raw::c_void, nByte: ::std::os::raw::c_int, ppStmt: *mut *mut sqlite3_stmt, pzTail: *mut *const ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_prepare16_v2( db: *mut sqlite3, zSql: *const ::std::os::raw::c_void, nByte: ::std::os::raw::c_int, ppStmt: *mut *mut sqlite3_stmt, pzTail: *mut *const ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_sql(pStmt: *mut sqlite3_stmt) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_expanded_sql(pStmt: *mut sqlite3_stmt) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_stmt_readonly(pStmt: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_stmt_busy(arg1: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Mem { _unused: [u8; 0], } pub type sqlite3_value = Mem; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_context { _unused: [u8; 0], } extern "C" { pub fn sqlite3_bind_blob( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_void, n: ::std::os::raw::c_int, arg4: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_blob64( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_void, arg4: sqlite3_uint64, arg5: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_double( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: f64, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_int( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_int64( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: sqlite3_int64, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_null( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_text( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_char, arg4: ::std::os::raw::c_int, arg5: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_text16( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_void, arg4: ::std::os::raw::c_int, arg5: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_text64( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_char, arg4: sqlite3_uint64, arg5: ::std::option::Option, encoding: ::std::os::raw::c_uchar, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_value( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: *const sqlite3_value, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_zeroblob( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, n: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_zeroblob64( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, arg3: sqlite3_uint64, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_parameter_count(arg1: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_bind_parameter_name( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_bind_parameter_index( arg1: *mut sqlite3_stmt, zName: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_clear_bindings(arg1: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_column_count(pStmt: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_column_name( arg1: *mut sqlite3_stmt, N: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_column_name16( arg1: *mut sqlite3_stmt, N: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_column_database_name( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_column_database_name16( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_column_table_name( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_column_table_name16( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_column_origin_name( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_column_origin_name16( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_column_decltype( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_column_decltype16( arg1: *mut sqlite3_stmt, arg2: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_step(arg1: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_data_count(pStmt: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_column_blob( arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_column_bytes( arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_column_bytes16( arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_column_double(arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int) -> f64; } extern "C" { pub fn sqlite3_column_int( arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_column_int64( arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int, ) -> sqlite3_int64; } extern "C" { pub fn sqlite3_column_text( arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_uchar; } extern "C" { pub fn sqlite3_column_text16( arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int, ) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_column_type( arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_column_value( arg1: *mut sqlite3_stmt, iCol: ::std::os::raw::c_int, ) -> *mut sqlite3_value; } extern "C" { pub fn sqlite3_finalize(pStmt: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_reset(pStmt: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_create_function( db: *mut sqlite3, zFunctionName: *const ::std::os::raw::c_char, nArg: ::std::os::raw::c_int, eTextRep: ::std::os::raw::c_int, pApp: *mut ::std::os::raw::c_void, xFunc: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, ), >, xStep: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, ), >, xFinal: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_create_function16( db: *mut sqlite3, zFunctionName: *const ::std::os::raw::c_void, nArg: ::std::os::raw::c_int, eTextRep: ::std::os::raw::c_int, pApp: *mut ::std::os::raw::c_void, xFunc: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, ), >, xStep: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, ), >, xFinal: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_create_function_v2( db: *mut sqlite3, zFunctionName: *const ::std::os::raw::c_char, nArg: ::std::os::raw::c_int, eTextRep: ::std::os::raw::c_int, pApp: *mut ::std::os::raw::c_void, xFunc: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, ), >, xStep: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, ), >, xFinal: ::std::option::Option, xDestroy: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_aggregate_count(arg1: *mut sqlite3_context) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_expired(arg1: *mut sqlite3_stmt) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_transfer_bindings( arg1: *mut sqlite3_stmt, arg2: *mut sqlite3_stmt, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_global_recover() -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_thread_cleanup(); } extern "C" { pub fn sqlite3_memory_alarm( arg1: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: sqlite3_int64, arg3: ::std::os::raw::c_int, ), >, arg2: *mut ::std::os::raw::c_void, arg3: sqlite3_int64, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_value_blob(arg1: *mut sqlite3_value) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_value_bytes(arg1: *mut sqlite3_value) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_value_bytes16(arg1: *mut sqlite3_value) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_value_double(arg1: *mut sqlite3_value) -> f64; } extern "C" { pub fn sqlite3_value_int(arg1: *mut sqlite3_value) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_value_int64(arg1: *mut sqlite3_value) -> sqlite3_int64; } extern "C" { pub fn sqlite3_value_text(arg1: *mut sqlite3_value) -> *const ::std::os::raw::c_uchar; } extern "C" { pub fn sqlite3_value_text16(arg1: *mut sqlite3_value) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_value_text16le(arg1: *mut sqlite3_value) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_value_text16be(arg1: *mut sqlite3_value) -> *const ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_value_type(arg1: *mut sqlite3_value) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_value_numeric_type(arg1: *mut sqlite3_value) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_value_subtype(arg1: *mut sqlite3_value) -> ::std::os::raw::c_uint; } extern "C" { pub fn sqlite3_value_dup(arg1: *const sqlite3_value) -> *mut sqlite3_value; } extern "C" { pub fn sqlite3_value_free(arg1: *mut sqlite3_value); } extern "C" { pub fn sqlite3_aggregate_context( arg1: *mut sqlite3_context, nBytes: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_user_data(arg1: *mut sqlite3_context) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_context_db_handle(arg1: *mut sqlite3_context) -> *mut sqlite3; } extern "C" { pub fn sqlite3_get_auxdata( arg1: *mut sqlite3_context, N: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_set_auxdata( arg1: *mut sqlite3_context, N: ::std::os::raw::c_int, arg2: *mut ::std::os::raw::c_void, arg3: ::std::option::Option, ); } pub type sqlite3_destructor_type = ::std::option::Option; extern "C" { pub fn sqlite3_result_blob( arg1: *mut sqlite3_context, arg2: *const ::std::os::raw::c_void, arg3: ::std::os::raw::c_int, arg4: ::std::option::Option, ); } extern "C" { pub fn sqlite3_result_blob64( arg1: *mut sqlite3_context, arg2: *const ::std::os::raw::c_void, arg3: sqlite3_uint64, arg4: ::std::option::Option, ); } extern "C" { pub fn sqlite3_result_double(arg1: *mut sqlite3_context, arg2: f64); } extern "C" { pub fn sqlite3_result_error( arg1: *mut sqlite3_context, arg2: *const ::std::os::raw::c_char, arg3: ::std::os::raw::c_int, ); } extern "C" { pub fn sqlite3_result_error16( arg1: *mut sqlite3_context, arg2: *const ::std::os::raw::c_void, arg3: ::std::os::raw::c_int, ); } extern "C" { pub fn sqlite3_result_error_toobig(arg1: *mut sqlite3_context); } extern "C" { pub fn sqlite3_result_error_nomem(arg1: *mut sqlite3_context); } extern "C" { pub fn sqlite3_result_error_code(arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_int); } extern "C" { pub fn sqlite3_result_int(arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_int); } extern "C" { pub fn sqlite3_result_int64(arg1: *mut sqlite3_context, arg2: sqlite3_int64); } extern "C" { pub fn sqlite3_result_null(arg1: *mut sqlite3_context); } extern "C" { pub fn sqlite3_result_text( arg1: *mut sqlite3_context, arg2: *const ::std::os::raw::c_char, arg3: ::std::os::raw::c_int, arg4: ::std::option::Option, ); } extern "C" { pub fn sqlite3_result_text64( arg1: *mut sqlite3_context, arg2: *const ::std::os::raw::c_char, arg3: sqlite3_uint64, arg4: ::std::option::Option, encoding: ::std::os::raw::c_uchar, ); } extern "C" { pub fn sqlite3_result_text16( arg1: *mut sqlite3_context, arg2: *const ::std::os::raw::c_void, arg3: ::std::os::raw::c_int, arg4: ::std::option::Option, ); } extern "C" { pub fn sqlite3_result_text16le( arg1: *mut sqlite3_context, arg2: *const ::std::os::raw::c_void, arg3: ::std::os::raw::c_int, arg4: ::std::option::Option, ); } extern "C" { pub fn sqlite3_result_text16be( arg1: *mut sqlite3_context, arg2: *const ::std::os::raw::c_void, arg3: ::std::os::raw::c_int, arg4: ::std::option::Option, ); } extern "C" { pub fn sqlite3_result_value(arg1: *mut sqlite3_context, arg2: *mut sqlite3_value); } extern "C" { pub fn sqlite3_result_zeroblob(arg1: *mut sqlite3_context, n: ::std::os::raw::c_int); } extern "C" { pub fn sqlite3_result_zeroblob64( arg1: *mut sqlite3_context, n: sqlite3_uint64, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_result_subtype(arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_uint); } extern "C" { pub fn sqlite3_create_collation( arg1: *mut sqlite3, zName: *const ::std::os::raw::c_char, eTextRep: ::std::os::raw::c_int, pArg: *mut ::std::os::raw::c_void, xCompare: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_void, arg4: ::std::os::raw::c_int, arg5: *const ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_create_collation_v2( arg1: *mut sqlite3, zName: *const ::std::os::raw::c_char, eTextRep: ::std::os::raw::c_int, pArg: *mut ::std::os::raw::c_void, xCompare: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_void, arg4: ::std::os::raw::c_int, arg5: *const ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, xDestroy: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_create_collation16( arg1: *mut sqlite3, zName: *const ::std::os::raw::c_void, eTextRep: ::std::os::raw::c_int, pArg: *mut ::std::os::raw::c_void, xCompare: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_void, arg4: ::std::os::raw::c_int, arg5: *const ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_collation_needed( arg1: *mut sqlite3, arg2: *mut ::std::os::raw::c_void, arg3: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: *mut sqlite3, eTextRep: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_char, ), >, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_collation_needed16( arg1: *mut sqlite3, arg2: *mut ::std::os::raw::c_void, arg3: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: *mut sqlite3, eTextRep: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_void, ), >, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_sleep(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { pub static mut sqlite3_temp_directory: *mut ::std::os::raw::c_char; } extern "C" { pub static mut sqlite3_data_directory: *mut ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_get_autocommit(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_db_handle(arg1: *mut sqlite3_stmt) -> *mut sqlite3; } extern "C" { pub fn sqlite3_db_filename( db: *mut sqlite3, zDbName: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sqlite3_db_readonly( db: *mut sqlite3, zDbName: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_next_stmt(pDb: *mut sqlite3, pStmt: *mut sqlite3_stmt) -> *mut sqlite3_stmt; } extern "C" { pub fn sqlite3_commit_hook( arg1: *mut sqlite3, arg2: ::std::option::Option< unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, >, arg3: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_rollback_hook( arg1: *mut sqlite3, arg2: ::std::option::Option, arg3: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_update_hook( arg1: *mut sqlite3, arg2: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_char, arg4: *const ::std::os::raw::c_char, arg5: sqlite3_int64, ), >, arg3: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_enable_shared_cache(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_release_memory(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_db_release_memory(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_soft_heap_limit64(N: sqlite3_int64) -> sqlite3_int64; } extern "C" { pub fn sqlite3_soft_heap_limit(N: ::std::os::raw::c_int); } extern "C" { pub fn sqlite3_table_column_metadata( db: *mut sqlite3, zDbName: *const ::std::os::raw::c_char, zTableName: *const ::std::os::raw::c_char, zColumnName: *const ::std::os::raw::c_char, pzDataType: *mut *const ::std::os::raw::c_char, pzCollSeq: *mut *const ::std::os::raw::c_char, pNotNull: *mut ::std::os::raw::c_int, pPrimaryKey: *mut ::std::os::raw::c_int, pAutoinc: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_load_extension( db: *mut sqlite3, zFile: *const ::std::os::raw::c_char, zProc: *const ::std::os::raw::c_char, pzErrMsg: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_enable_load_extension( db: *mut sqlite3, onoff: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_auto_extension( xEntryPoint: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_cancel_auto_extension( xEntryPoint: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_reset_auto_extension(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_module { pub iVersion: ::std::os::raw::c_int, pub xCreate: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3, pAux: *mut ::std::os::raw::c_void, argc: ::std::os::raw::c_int, argv: *const *const ::std::os::raw::c_char, ppVTab: *mut *mut sqlite3_vtab, arg2: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, pub xConnect: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3, pAux: *mut ::std::os::raw::c_void, argc: ::std::os::raw::c_int, argv: *const *const ::std::os::raw::c_char, ppVTab: *mut *mut sqlite3_vtab, arg2: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, pub xBestIndex: ::std::option::Option< unsafe extern "C" fn( pVTab: *mut sqlite3_vtab, arg1: *mut sqlite3_index_info, ) -> ::std::os::raw::c_int, >, pub xDisconnect: ::std::option::Option< unsafe extern "C" fn(pVTab: *mut sqlite3_vtab) -> ::std::os::raw::c_int, >, pub xDestroy: ::std::option::Option< unsafe extern "C" fn(pVTab: *mut sqlite3_vtab) -> ::std::os::raw::c_int, >, pub xOpen: ::std::option::Option< unsafe extern "C" fn( pVTab: *mut sqlite3_vtab, ppCursor: *mut *mut sqlite3_vtab_cursor, ) -> ::std::os::raw::c_int, >, pub xClose: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_vtab_cursor) -> ::std::os::raw::c_int, >, pub xFilter: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vtab_cursor, idxNum: ::std::os::raw::c_int, idxStr: *const ::std::os::raw::c_char, argc: ::std::os::raw::c_int, argv: *mut *mut sqlite3_value, ) -> ::std::os::raw::c_int, >, pub xNext: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_vtab_cursor) -> ::std::os::raw::c_int, >, pub xEof: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_vtab_cursor) -> ::std::os::raw::c_int, >, pub xColumn: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vtab_cursor, arg2: *mut sqlite3_context, arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xRowid: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vtab_cursor, pRowid: *mut sqlite3_int64, ) -> ::std::os::raw::c_int, >, pub xUpdate: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_vtab, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, arg4: *mut sqlite3_int64, ) -> ::std::os::raw::c_int, >, pub xBegin: ::std::option::Option< unsafe extern "C" fn(pVTab: *mut sqlite3_vtab) -> ::std::os::raw::c_int, >, pub xSync: ::std::option::Option< unsafe extern "C" fn(pVTab: *mut sqlite3_vtab) -> ::std::os::raw::c_int, >, pub xCommit: ::std::option::Option< unsafe extern "C" fn(pVTab: *mut sqlite3_vtab) -> ::std::os::raw::c_int, >, pub xRollback: ::std::option::Option< unsafe extern "C" fn(pVTab: *mut sqlite3_vtab) -> ::std::os::raw::c_int, >, pub xFindFunction: ::std::option::Option< unsafe extern "C" fn( pVtab: *mut sqlite3_vtab, nArg: ::std::os::raw::c_int, zName: *const ::std::os::raw::c_char, pxFunc: *mut ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_context, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, ), >, ppArg: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, pub xRename: ::std::option::Option< unsafe extern "C" fn( pVtab: *mut sqlite3_vtab, zNew: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, pub xSavepoint: ::std::option::Option< unsafe extern "C" fn( pVTab: *mut sqlite3_vtab, arg1: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xRelease: ::std::option::Option< unsafe extern "C" fn( pVTab: *mut sqlite3_vtab, arg1: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xRollbackTo: ::std::option::Option< unsafe extern "C" fn( pVTab: *mut sqlite3_vtab, arg1: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_index_info { pub nConstraint: ::std::os::raw::c_int, pub aConstraint: *mut sqlite3_index_constraint, pub nOrderBy: ::std::os::raw::c_int, pub aOrderBy: *mut sqlite3_index_orderby, pub aConstraintUsage: *mut sqlite3_index_constraint_usage, pub idxNum: ::std::os::raw::c_int, pub idxStr: *mut ::std::os::raw::c_char, pub needToFreeIdxStr: ::std::os::raw::c_int, pub orderByConsumed: ::std::os::raw::c_int, pub estimatedCost: f64, pub estimatedRows: sqlite3_int64, pub idxFlags: ::std::os::raw::c_int, pub colUsed: sqlite3_uint64, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_index_constraint { pub iColumn: ::std::os::raw::c_int, pub op: ::std::os::raw::c_uchar, pub usable: ::std::os::raw::c_uchar, pub iTermOffset: ::std::os::raw::c_int, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_index_orderby { pub iColumn: ::std::os::raw::c_int, pub desc: ::std::os::raw::c_uchar, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_index_constraint_usage { pub argvIndex: ::std::os::raw::c_int, pub omit: ::std::os::raw::c_uchar, } extern "C" { pub fn sqlite3_create_module( db: *mut sqlite3, zName: *const ::std::os::raw::c_char, p: *const sqlite3_module, pClientData: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_create_module_v2( db: *mut sqlite3, zName: *const ::std::os::raw::c_char, p: *const sqlite3_module, pClientData: *mut ::std::os::raw::c_void, xDestroy: ::std::option::Option, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_vtab { pub pModule: *const sqlite3_module, pub nRef: ::std::os::raw::c_int, pub zErrMsg: *mut ::std::os::raw::c_char, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_vtab_cursor { pub pVtab: *mut sqlite3_vtab, } extern "C" { pub fn sqlite3_declare_vtab( arg1: *mut sqlite3, zSQL: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_overload_function( arg1: *mut sqlite3, zFuncName: *const ::std::os::raw::c_char, nArg: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_blob { _unused: [u8; 0], } extern "C" { pub fn sqlite3_blob_open( arg1: *mut sqlite3, zDb: *const ::std::os::raw::c_char, zTable: *const ::std::os::raw::c_char, zColumn: *const ::std::os::raw::c_char, iRow: sqlite3_int64, flags: ::std::os::raw::c_int, ppBlob: *mut *mut sqlite3_blob, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_blob_reopen( arg1: *mut sqlite3_blob, arg2: sqlite3_int64, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_blob_close(arg1: *mut sqlite3_blob) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_blob_bytes(arg1: *mut sqlite3_blob) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_blob_read( arg1: *mut sqlite3_blob, Z: *mut ::std::os::raw::c_void, N: ::std::os::raw::c_int, iOffset: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_blob_write( arg1: *mut sqlite3_blob, z: *const ::std::os::raw::c_void, n: ::std::os::raw::c_int, iOffset: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_vfs_find(zVfsName: *const ::std::os::raw::c_char) -> *mut sqlite3_vfs; } extern "C" { pub fn sqlite3_vfs_register( arg1: *mut sqlite3_vfs, makeDflt: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_vfs_unregister(arg1: *mut sqlite3_vfs) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_mutex_alloc(arg1: ::std::os::raw::c_int) -> *mut sqlite3_mutex; } extern "C" { pub fn sqlite3_mutex_free(arg1: *mut sqlite3_mutex); } extern "C" { pub fn sqlite3_mutex_enter(arg1: *mut sqlite3_mutex); } extern "C" { pub fn sqlite3_mutex_try(arg1: *mut sqlite3_mutex) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_mutex_leave(arg1: *mut sqlite3_mutex); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_mutex_methods { pub xMutexInit: ::std::option::Option ::std::os::raw::c_int>, pub xMutexEnd: ::std::option::Option ::std::os::raw::c_int>, pub xMutexAlloc: ::std::option::Option< unsafe extern "C" fn(arg1: ::std::os::raw::c_int) -> *mut sqlite3_mutex, >, pub xMutexFree: ::std::option::Option, pub xMutexEnter: ::std::option::Option, pub xMutexTry: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_mutex) -> ::std::os::raw::c_int, >, pub xMutexLeave: ::std::option::Option, pub xMutexHeld: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_mutex) -> ::std::os::raw::c_int, >, pub xMutexNotheld: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_mutex) -> ::std::os::raw::c_int, >, } extern "C" { pub fn sqlite3_mutex_held(arg1: *mut sqlite3_mutex) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_mutex_notheld(arg1: *mut sqlite3_mutex) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_db_mutex(arg1: *mut sqlite3) -> *mut sqlite3_mutex; } extern "C" { pub fn sqlite3_file_control( arg1: *mut sqlite3, zDbName: *const ::std::os::raw::c_char, op: ::std::os::raw::c_int, arg2: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_test_control(op: ::std::os::raw::c_int, ...) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_status( op: ::std::os::raw::c_int, pCurrent: *mut ::std::os::raw::c_int, pHighwater: *mut ::std::os::raw::c_int, resetFlag: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_status64( op: ::std::os::raw::c_int, pCurrent: *mut sqlite3_int64, pHighwater: *mut sqlite3_int64, resetFlag: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_db_status( arg1: *mut sqlite3, op: ::std::os::raw::c_int, pCur: *mut ::std::os::raw::c_int, pHiwtr: *mut ::std::os::raw::c_int, resetFlg: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_stmt_status( arg1: *mut sqlite3_stmt, op: ::std::os::raw::c_int, resetFlg: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_pcache { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_pcache_page { pub pBuf: *mut ::std::os::raw::c_void, pub pExtra: *mut ::std::os::raw::c_void, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_pcache_methods2 { pub iVersion: ::std::os::raw::c_int, pub pArg: *mut ::std::os::raw::c_void, pub xInit: ::std::option::Option< unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, >, pub xShutdown: ::std::option::Option, pub xCreate: ::std::option::Option< unsafe extern "C" fn( szPage: ::std::os::raw::c_int, szExtra: ::std::os::raw::c_int, bPurgeable: ::std::os::raw::c_int, ) -> *mut sqlite3_pcache, >, pub xCachesize: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_pcache, nCachesize: ::std::os::raw::c_int), >, pub xPagecount: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_pcache) -> ::std::os::raw::c_int, >, pub xFetch: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_pcache, key: ::std::os::raw::c_uint, createFlag: ::std::os::raw::c_int, ) -> *mut sqlite3_pcache_page, >, pub xUnpin: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_pcache, arg2: *mut sqlite3_pcache_page, discard: ::std::os::raw::c_int, ), >, pub xRekey: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_pcache, arg2: *mut sqlite3_pcache_page, oldKey: ::std::os::raw::c_uint, newKey: ::std::os::raw::c_uint, ), >, pub xTruncate: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_pcache, iLimit: ::std::os::raw::c_uint), >, pub xDestroy: ::std::option::Option, pub xShrink: ::std::option::Option, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_pcache_methods { pub pArg: *mut ::std::os::raw::c_void, pub xInit: ::std::option::Option< unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, >, pub xShutdown: ::std::option::Option, pub xCreate: ::std::option::Option< unsafe extern "C" fn( szPage: ::std::os::raw::c_int, bPurgeable: ::std::os::raw::c_int, ) -> *mut sqlite3_pcache, >, pub xCachesize: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_pcache, nCachesize: ::std::os::raw::c_int), >, pub xPagecount: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_pcache) -> ::std::os::raw::c_int, >, pub xFetch: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_pcache, key: ::std::os::raw::c_uint, createFlag: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_void, >, pub xUnpin: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_pcache, arg2: *mut ::std::os::raw::c_void, discard: ::std::os::raw::c_int, ), >, pub xRekey: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_pcache, arg2: *mut ::std::os::raw::c_void, oldKey: ::std::os::raw::c_uint, newKey: ::std::os::raw::c_uint, ), >, pub xTruncate: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_pcache, iLimit: ::std::os::raw::c_uint), >, pub xDestroy: ::std::option::Option, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_backup { _unused: [u8; 0], } extern "C" { pub fn sqlite3_backup_init( pDest: *mut sqlite3, zDestName: *const ::std::os::raw::c_char, pSource: *mut sqlite3, zSourceName: *const ::std::os::raw::c_char, ) -> *mut sqlite3_backup; } extern "C" { pub fn sqlite3_backup_step( p: *mut sqlite3_backup, nPage: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_backup_finish(p: *mut sqlite3_backup) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_backup_remaining(p: *mut sqlite3_backup) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_backup_pagecount(p: *mut sqlite3_backup) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_unlock_notify( pBlocked: *mut sqlite3, xNotify: ::std::option::Option< unsafe extern "C" fn( apArg: *mut *mut ::std::os::raw::c_void, nArg: ::std::os::raw::c_int, ), >, pNotifyArg: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_stricmp( arg1: *const ::std::os::raw::c_char, arg2: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_strnicmp( arg1: *const ::std::os::raw::c_char, arg2: *const ::std::os::raw::c_char, arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_strglob( zGlob: *const ::std::os::raw::c_char, zStr: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_strlike( zGlob: *const ::std::os::raw::c_char, zStr: *const ::std::os::raw::c_char, cEsc: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_log( iErrCode: ::std::os::raw::c_int, zFormat: *const ::std::os::raw::c_char, ... ); } extern "C" { pub fn sqlite3_wal_hook( arg1: *mut sqlite3, arg2: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: *mut sqlite3, arg3: *const ::std::os::raw::c_char, arg4: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, arg3: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_wal_autocheckpoint( db: *mut sqlite3, N: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_wal_checkpoint( db: *mut sqlite3, zDb: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_wal_checkpoint_v2( db: *mut sqlite3, zDb: *const ::std::os::raw::c_char, eMode: ::std::os::raw::c_int, pnLog: *mut ::std::os::raw::c_int, pnCkpt: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_vtab_config( arg1: *mut sqlite3, op: ::std::os::raw::c_int, ... ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_vtab_on_conflict(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_stmt_scanstatus( pStmt: *mut sqlite3_stmt, idx: ::std::os::raw::c_int, iScanStatusOp: ::std::os::raw::c_int, pOut: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_stmt_scanstatus_reset(arg1: *mut sqlite3_stmt); } extern "C" { pub fn sqlite3_db_cacheflush(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_preupdate_hook( db: *mut sqlite3, xPreUpdate: ::std::option::Option< unsafe extern "C" fn( pCtx: *mut ::std::os::raw::c_void, db: *mut sqlite3, op: ::std::os::raw::c_int, zDb: *const ::std::os::raw::c_char, zName: *const ::std::os::raw::c_char, iKey1: sqlite3_int64, iKey2: sqlite3_int64, ), >, arg1: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn sqlite3_preupdate_old( arg1: *mut sqlite3, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_preupdate_count(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_preupdate_depth(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_preupdate_new( arg1: *mut sqlite3, arg2: ::std::os::raw::c_int, arg3: *mut *mut sqlite3_value, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_system_errno(arg1: *mut sqlite3) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_snapshot { _unused: [u8; 0], } extern "C" { pub fn sqlite3_snapshot_get( db: *mut sqlite3, zSchema: *const ::std::os::raw::c_char, ppSnapshot: *mut *mut sqlite3_snapshot, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_snapshot_open( db: *mut sqlite3, zSchema: *const ::std::os::raw::c_char, pSnapshot: *mut sqlite3_snapshot, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3_snapshot_free(arg1: *mut sqlite3_snapshot); } extern "C" { pub fn sqlite3_snapshot_cmp( p1: *mut sqlite3_snapshot, p2: *mut sqlite3_snapshot, ) -> ::std::os::raw::c_int; } pub type sqlite3_rtree_dbl = f64; extern "C" { pub fn sqlite3_rtree_geometry_callback( db: *mut sqlite3, zGeom: *const ::std::os::raw::c_char, xGeom: ::std::option::Option< unsafe extern "C" fn( arg1: *mut sqlite3_rtree_geometry, arg2: ::std::os::raw::c_int, arg3: *mut sqlite3_rtree_dbl, arg4: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pContext: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_rtree_geometry { pub pContext: *mut ::std::os::raw::c_void, pub nParam: ::std::os::raw::c_int, pub aParam: *mut sqlite3_rtree_dbl, pub pUser: *mut ::std::os::raw::c_void, pub xDelUser: ::std::option::Option, } extern "C" { pub fn sqlite3_rtree_query_callback( db: *mut sqlite3, zQueryFunc: *const ::std::os::raw::c_char, xQueryFunc: ::std::option::Option< unsafe extern "C" fn(arg1: *mut sqlite3_rtree_query_info) -> ::std::os::raw::c_int, >, pContext: *mut ::std::os::raw::c_void, xDestructor: ::std::option::Option, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_rtree_query_info { pub pContext: *mut ::std::os::raw::c_void, pub nParam: ::std::os::raw::c_int, pub aParam: *mut sqlite3_rtree_dbl, pub pUser: *mut ::std::os::raw::c_void, pub xDelUser: ::std::option::Option, pub aCoord: *mut sqlite3_rtree_dbl, pub anQueue: *mut ::std::os::raw::c_uint, pub nCoord: ::std::os::raw::c_int, pub iLevel: ::std::os::raw::c_int, pub mxLevel: ::std::os::raw::c_int, pub iRowid: sqlite3_int64, pub rParentScore: sqlite3_rtree_dbl, pub eParentWithin: ::std::os::raw::c_int, pub eWithin: ::std::os::raw::c_int, pub rScore: sqlite3_rtree_dbl, pub apSqlParam: *mut *mut sqlite3_value, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_session { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_changeset_iter { _unused: [u8; 0], } extern "C" { pub fn sqlite3session_create( db: *mut sqlite3, zDb: *const ::std::os::raw::c_char, ppSession: *mut *mut sqlite3_session, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3session_delete(pSession: *mut sqlite3_session); } extern "C" { pub fn sqlite3session_enable( pSession: *mut sqlite3_session, bEnable: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3session_indirect( pSession: *mut sqlite3_session, bIndirect: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3session_attach( pSession: *mut sqlite3_session, zTab: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3session_table_filter( pSession: *mut sqlite3_session, xFilter: ::std::option::Option< unsafe extern "C" fn( pCtx: *mut ::std::os::raw::c_void, zTab: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, pCtx: *mut ::std::os::raw::c_void, ); } extern "C" { pub fn sqlite3session_changeset( pSession: *mut sqlite3_session, pnChangeset: *mut ::std::os::raw::c_int, ppChangeset: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3session_diff( pSession: *mut sqlite3_session, zFromDb: *const ::std::os::raw::c_char, zTbl: *const ::std::os::raw::c_char, pzErrMsg: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3session_patchset( pSession: *mut sqlite3_session, pnPatchset: *mut ::std::os::raw::c_int, ppPatchset: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3session_isempty(pSession: *mut sqlite3_session) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_start( pp: *mut *mut sqlite3_changeset_iter, nChangeset: ::std::os::raw::c_int, pChangeset: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_next(pIter: *mut sqlite3_changeset_iter) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_op( pIter: *mut sqlite3_changeset_iter, pzTab: *mut *const ::std::os::raw::c_char, pnCol: *mut ::std::os::raw::c_int, pOp: *mut ::std::os::raw::c_int, pbIndirect: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_pk( pIter: *mut sqlite3_changeset_iter, pabPK: *mut *mut ::std::os::raw::c_uchar, pnCol: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_old( pIter: *mut sqlite3_changeset_iter, iVal: ::std::os::raw::c_int, ppValue: *mut *mut sqlite3_value, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_new( pIter: *mut sqlite3_changeset_iter, iVal: ::std::os::raw::c_int, ppValue: *mut *mut sqlite3_value, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_conflict( pIter: *mut sqlite3_changeset_iter, iVal: ::std::os::raw::c_int, ppValue: *mut *mut sqlite3_value, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_fk_conflicts( pIter: *mut sqlite3_changeset_iter, pnOut: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_finalize(pIter: *mut sqlite3_changeset_iter) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_invert( nIn: ::std::os::raw::c_int, pIn: *const ::std::os::raw::c_void, pnOut: *mut ::std::os::raw::c_int, ppOut: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_concat( nA: ::std::os::raw::c_int, pA: *mut ::std::os::raw::c_void, nB: ::std::os::raw::c_int, pB: *mut ::std::os::raw::c_void, pnOut: *mut ::std::os::raw::c_int, ppOut: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sqlite3_changegroup { _unused: [u8; 0], } extern "C" { pub fn sqlite3changegroup_new(pp: *mut *mut sqlite3_changegroup) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changegroup_add( arg1: *mut sqlite3_changegroup, nData: ::std::os::raw::c_int, pData: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changegroup_output( arg1: *mut sqlite3_changegroup, pnData: *mut ::std::os::raw::c_int, ppData: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changegroup_delete(arg1: *mut sqlite3_changegroup); } extern "C" { pub fn sqlite3changeset_apply( db: *mut sqlite3, nChangeset: ::std::os::raw::c_int, pChangeset: *mut ::std::os::raw::c_void, xFilter: ::std::option::Option< unsafe extern "C" fn( pCtx: *mut ::std::os::raw::c_void, zTab: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, xConflict: ::std::option::Option< unsafe extern "C" fn( pCtx: *mut ::std::os::raw::c_void, eConflict: ::std::os::raw::c_int, p: *mut sqlite3_changeset_iter, ) -> ::std::os::raw::c_int, >, pCtx: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_apply_strm( db: *mut sqlite3, xInput: ::std::option::Option< unsafe extern "C" fn( pIn: *mut ::std::os::raw::c_void, pData: *mut ::std::os::raw::c_void, pnData: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pIn: *mut ::std::os::raw::c_void, xFilter: ::std::option::Option< unsafe extern "C" fn( pCtx: *mut ::std::os::raw::c_void, zTab: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, xConflict: ::std::option::Option< unsafe extern "C" fn( pCtx: *mut ::std::os::raw::c_void, eConflict: ::std::os::raw::c_int, p: *mut sqlite3_changeset_iter, ) -> ::std::os::raw::c_int, >, pCtx: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_concat_strm( xInputA: ::std::option::Option< unsafe extern "C" fn( pIn: *mut ::std::os::raw::c_void, pData: *mut ::std::os::raw::c_void, pnData: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pInA: *mut ::std::os::raw::c_void, xInputB: ::std::option::Option< unsafe extern "C" fn( pIn: *mut ::std::os::raw::c_void, pData: *mut ::std::os::raw::c_void, pnData: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pInB: *mut ::std::os::raw::c_void, xOutput: ::std::option::Option< unsafe extern "C" fn( pOut: *mut ::std::os::raw::c_void, pData: *const ::std::os::raw::c_void, nData: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pOut: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_invert_strm( xInput: ::std::option::Option< unsafe extern "C" fn( pIn: *mut ::std::os::raw::c_void, pData: *mut ::std::os::raw::c_void, pnData: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pIn: *mut ::std::os::raw::c_void, xOutput: ::std::option::Option< unsafe extern "C" fn( pOut: *mut ::std::os::raw::c_void, pData: *const ::std::os::raw::c_void, nData: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pOut: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changeset_start_strm( pp: *mut *mut sqlite3_changeset_iter, xInput: ::std::option::Option< unsafe extern "C" fn( pIn: *mut ::std::os::raw::c_void, pData: *mut ::std::os::raw::c_void, pnData: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pIn: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3session_changeset_strm( pSession: *mut sqlite3_session, xOutput: ::std::option::Option< unsafe extern "C" fn( pOut: *mut ::std::os::raw::c_void, pData: *const ::std::os::raw::c_void, nData: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pOut: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3session_patchset_strm( pSession: *mut sqlite3_session, xOutput: ::std::option::Option< unsafe extern "C" fn( pOut: *mut ::std::os::raw::c_void, pData: *const ::std::os::raw::c_void, nData: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pOut: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changegroup_add_strm( arg1: *mut sqlite3_changegroup, xInput: ::std::option::Option< unsafe extern "C" fn( pIn: *mut ::std::os::raw::c_void, pData: *mut ::std::os::raw::c_void, pnData: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pIn: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sqlite3changegroup_output_strm( arg1: *mut sqlite3_changegroup, xOutput: ::std::option::Option< unsafe extern "C" fn( pOut: *mut ::std::os::raw::c_void, pData: *const ::std::os::raw::c_void, nData: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pOut: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Fts5Context { _unused: [u8; 0], } pub type fts5_extension_function = ::std::option::Option< unsafe extern "C" fn( pApi: *const Fts5ExtensionApi, pFts: *mut Fts5Context, pCtx: *mut sqlite3_context, nVal: ::std::os::raw::c_int, apVal: *mut *mut sqlite3_value, ), >; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Fts5PhraseIter { pub a: *const ::std::os::raw::c_uchar, pub b: *const ::std::os::raw::c_uchar, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Fts5ExtensionApi { pub iVersion: ::std::os::raw::c_int, pub xUserData: ::std::option::Option< unsafe extern "C" fn(arg1: *mut Fts5Context) -> *mut ::std::os::raw::c_void, >, pub xColumnCount: ::std::option::Option< unsafe extern "C" fn(arg1: *mut Fts5Context) -> ::std::os::raw::c_int, >, pub xRowCount: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, pnRow: *mut sqlite3_int64, ) -> ::std::os::raw::c_int, >, pub xColumnTotalSize: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, iCol: ::std::os::raw::c_int, pnToken: *mut sqlite3_int64, ) -> ::std::os::raw::c_int, >, pub xTokenize: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, pText: *const ::std::os::raw::c_char, nText: ::std::os::raw::c_int, pCtx: *mut ::std::os::raw::c_void, xToken: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_int, arg3: *const ::std::os::raw::c_char, arg4: ::std::os::raw::c_int, arg5: ::std::os::raw::c_int, arg6: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, ) -> ::std::os::raw::c_int, >, pub xPhraseCount: ::std::option::Option< unsafe extern "C" fn(arg1: *mut Fts5Context) -> ::std::os::raw::c_int, >, pub xPhraseSize: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, iPhrase: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xInstCount: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, pnInst: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xInst: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, iIdx: ::std::os::raw::c_int, piPhrase: *mut ::std::os::raw::c_int, piCol: *mut ::std::os::raw::c_int, piOff: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xRowid: ::std::option::Option sqlite3_int64>, pub xColumnText: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, iCol: ::std::os::raw::c_int, pz: *mut *const ::std::os::raw::c_char, pn: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xColumnSize: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, iCol: ::std::os::raw::c_int, pnToken: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xQueryPhrase: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, iPhrase: ::std::os::raw::c_int, pUserData: *mut ::std::os::raw::c_void, arg2: ::std::option::Option< unsafe extern "C" fn( arg1: *const Fts5ExtensionApi, arg2: *mut Fts5Context, arg3: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, ) -> ::std::os::raw::c_int, >, pub xSetAuxdata: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, pAux: *mut ::std::os::raw::c_void, xDelete: ::std::option::Option, ) -> ::std::os::raw::c_int, >, pub xGetAuxdata: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, bClear: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_void, >, pub xPhraseFirst: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, iPhrase: ::std::os::raw::c_int, arg2: *mut Fts5PhraseIter, arg3: *mut ::std::os::raw::c_int, arg4: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xPhraseNext: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, arg2: *mut Fts5PhraseIter, piCol: *mut ::std::os::raw::c_int, piOff: *mut ::std::os::raw::c_int, ), >, pub xPhraseFirstColumn: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, iPhrase: ::std::os::raw::c_int, arg2: *mut Fts5PhraseIter, arg3: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub xPhraseNextColumn: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Context, arg2: *mut Fts5PhraseIter, piCol: *mut ::std::os::raw::c_int, ), >, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct Fts5Tokenizer { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct fts5_tokenizer { pub xCreate: ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, azArg: *mut *const ::std::os::raw::c_char, nArg: ::std::os::raw::c_int, ppOut: *mut *mut Fts5Tokenizer, ) -> ::std::os::raw::c_int, >, pub xDelete: ::std::option::Option, pub xTokenize: ::std::option::Option< unsafe extern "C" fn( arg1: *mut Fts5Tokenizer, pCtx: *mut ::std::os::raw::c_void, flags: ::std::os::raw::c_int, pText: *const ::std::os::raw::c_char, nText: ::std::os::raw::c_int, xToken: ::std::option::Option< unsafe extern "C" fn( pCtx: *mut ::std::os::raw::c_void, tflags: ::std::os::raw::c_int, pToken: *const ::std::os::raw::c_char, nToken: ::std::os::raw::c_int, iStart: ::std::os::raw::c_int, iEnd: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, ) -> ::std::os::raw::c_int, >, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct fts5_api { pub iVersion: ::std::os::raw::c_int, pub xCreateTokenizer: ::std::option::Option< unsafe extern "C" fn( pApi: *mut fts5_api, zName: *const ::std::os::raw::c_char, pContext: *mut ::std::os::raw::c_void, pTokenizer: *mut fts5_tokenizer, xDestroy: ::std::option::Option, ) -> ::std::os::raw::c_int, >, pub xFindTokenizer: ::std::option::Option< unsafe extern "C" fn( pApi: *mut fts5_api, zName: *const ::std::os::raw::c_char, ppContext: *mut *mut ::std::os::raw::c_void, pTokenizer: *mut fts5_tokenizer, ) -> ::std::os::raw::c_int, >, pub xCreateFunction: ::std::option::Option< unsafe extern "C" fn( pApi: *mut fts5_api, zName: *const ::std::os::raw::c_char, pContext: *mut ::std::os::raw::c_void, xFunction: fts5_extension_function, xDestroy: ::std::option::Option, ) -> ::std::os::raw::c_int, >, } libsqlite3-sys-0.26.0/build.rs000064400000000000000000000611611046102023000142520ustar 00000000000000use std::env; use std::path::Path; /// Tells whether we're building for Windows. This is more suitable than a plain /// `cfg!(windows)`, since the latter does not properly handle cross-compilation /// /// Note that there is no way to know at compile-time which system we'll be /// targetting, and this test must be made at run-time (of the build script) See /// https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts fn win_target() -> bool { env::var("CARGO_CFG_WINDOWS").is_ok() } /// Tells whether we're building for Android. /// See [`win_target`] #[cfg(any(feature = "bundled", feature = "bundled-windows"))] fn android_target() -> bool { env::var("CARGO_CFG_TARGET_OS").map_or(false, |v| v == "android") } /// Tells whether a given compiler will be used `compiler_name` is compared to /// the content of `CARGO_CFG_TARGET_ENV` (and is always lowercase) /// /// See [`win_target`] fn is_compiler(compiler_name: &str) -> bool { env::var("CARGO_CFG_TARGET_ENV").map_or(false, |v| v == compiler_name) } fn main() { let out_dir = env::var("OUT_DIR").unwrap(); let out_path = Path::new(&out_dir).join("bindgen.rs"); if cfg!(feature = "in_gecko") { // When inside mozilla-central, we are included into the build with // sqlite3.o directly, so we don't want to provide any linker arguments. std::fs::copy("sqlite3/bindgen_bundled_version.rs", out_path) .expect("Could not copy bindings to output directory"); return; } if cfg!(all( feature = "sqlcipher", not(feature = "bundled-sqlcipher") )) { if cfg!(feature = "bundled") || (win_target() && cfg!(feature = "bundled-windows")) { println!( "cargo:warning=For backwards compatibility, feature 'sqlcipher' overrides features 'bundled' and 'bundled-windows'. If you want a bundled build of SQLCipher (available for the moment only on Unix), use feature 'bundled-sqlcipher' or 'bundled-sqlcipher-vendored-openssl' to also bundle OpenSSL crypto." ); } build_linked::main(&out_dir, &out_path); } else if cfg!(feature = "bundled") || (win_target() && cfg!(feature = "bundled-windows")) || cfg!(feature = "bundled-sqlcipher") { #[cfg(any( feature = "bundled", feature = "bundled-windows", feature = "bundled-sqlcipher" ))] build_bundled::main(&out_dir, &out_path); #[cfg(not(any( feature = "bundled", feature = "bundled-windows", feature = "bundled-sqlcipher" )))] panic!("The runtime test should not run this branch, which has not compiled any logic.") } else { build_linked::main(&out_dir, &out_path); } } #[cfg(any( feature = "bundled", feature = "bundled-windows", feature = "bundled-sqlcipher" ))] mod build_bundled { use std::env; use std::ffi::OsString; use std::path::{Path, PathBuf}; use super::{is_compiler, win_target}; pub fn main(out_dir: &str, out_path: &Path) { let lib_name = super::lib_name(); // This is just a sanity check, the top level `main` should ensure this. assert!(!(cfg!(feature = "bundled-windows") && !cfg!(feature = "bundled") && !win_target()), "This module should not be used: we're not on Windows and the bundled feature has not been enabled"); #[cfg(feature = "buildtime_bindgen")] { use super::{bindings, HeaderLocation}; let header = HeaderLocation::FromPath(format!("{}/sqlite3.h", lib_name)); bindings::write_to_out_dir(header, out_path); } #[cfg(not(feature = "buildtime_bindgen"))] { use std::fs; fs::copy(format!("{lib_name}/bindgen_bundled_version.rs"), out_path) .expect("Could not copy bindings to output directory"); } // println!("cargo:rerun-if-changed=sqlite3/sqlite3.c"); // println!("cargo:rerun-if-changed=sqlcipher/sqlite3.c"); println!("cargo:rerun-if-changed={lib_name}/sqlite3.c"); println!("cargo:rerun-if-changed=sqlite3/wasm32-wasi-vfs.c"); let mut cfg = cc::Build::new(); cfg.file(format!("{lib_name}/sqlite3.c")) .flag("-DSQLITE_CORE") .flag("-DSQLITE_DEFAULT_FOREIGN_KEYS=1") .flag("-DSQLITE_ENABLE_API_ARMOR") .flag("-DSQLITE_ENABLE_COLUMN_METADATA") .flag("-DSQLITE_ENABLE_DBSTAT_VTAB") .flag("-DSQLITE_ENABLE_FTS3") .flag("-DSQLITE_ENABLE_FTS3_PARENTHESIS") .flag("-DSQLITE_ENABLE_FTS5") .flag("-DSQLITE_ENABLE_JSON1") .flag("-DSQLITE_ENABLE_LOAD_EXTENSION=1") .flag("-DSQLITE_ENABLE_MEMORY_MANAGEMENT") .flag("-DSQLITE_ENABLE_RTREE") .flag("-DSQLITE_ENABLE_STAT2") .flag("-DSQLITE_ENABLE_STAT4") .flag("-DSQLITE_SOUNDEX") .flag("-DSQLITE_THREADSAFE=1") .flag("-DSQLITE_USE_URI") .flag("-DHAVE_USLEEP=1") .flag("-D_POSIX_THREAD_SAFE_FUNCTIONS") // cross compile with MinGW .warnings(false); if cfg!(feature = "bundled-sqlcipher") { cfg.flag("-DSQLITE_HAS_CODEC").flag("-DSQLITE_TEMP_STORE=2"); let target = env::var("TARGET").unwrap(); let host = env::var("HOST").unwrap(); let is_windows = host.contains("windows") && target.contains("windows"); let is_apple = host.contains("apple") && target.contains("apple"); let lib_dir = env("OPENSSL_LIB_DIR").map(PathBuf::from); let inc_dir = env("OPENSSL_INCLUDE_DIR").map(PathBuf::from); let mut use_openssl = false; let (lib_dir, inc_dir) = match (lib_dir, inc_dir) { (Some(lib_dir), Some(inc_dir)) => { use_openssl = true; (lib_dir, inc_dir) } (lib_dir, inc_dir) => match find_openssl_dir(&host, &target) { None => { if is_windows && !cfg!(feature = "bundled-sqlcipher-vendored-openssl") { panic!("Missing environment variable OPENSSL_DIR or OPENSSL_DIR is not set") } else { (PathBuf::new(), PathBuf::new()) } } Some(openssl_dir) => { let lib_dir = lib_dir.unwrap_or_else(|| openssl_dir.join("lib")); let inc_dir = inc_dir.unwrap_or_else(|| openssl_dir.join("include")); assert!( Path::new(&lib_dir).exists(), "OpenSSL library directory does not exist: {}", lib_dir.to_string_lossy() ); if !Path::new(&inc_dir).exists() { panic!( "OpenSSL include directory does not exist: {}", inc_dir.to_string_lossy() ); } use_openssl = true; (lib_dir, inc_dir) } }, }; if cfg!(feature = "bundled-sqlcipher-vendored-openssl") { cfg.include(env::var("DEP_OPENSSL_INCLUDE").unwrap()); // cargo will resolve downstream to the static lib in // openssl-sys } else if use_openssl { cfg.include(inc_dir.to_string_lossy().as_ref()); let lib_name = if is_windows { "libcrypto" } else { "crypto" }; println!("cargo:rustc-link-lib=dylib={}", lib_name); println!("cargo:rustc-link-search={}", lib_dir.to_string_lossy()); } else if is_apple { cfg.flag("-DSQLCIPHER_CRYPTO_CC"); println!("cargo:rustc-link-lib=framework=Security"); println!("cargo:rustc-link-lib=framework=CoreFoundation"); } else { // branch not taken on Windows, just `crypto` is fine. println!("cargo:rustc-link-lib=dylib=crypto"); } } // on android sqlite can't figure out where to put the temp files. // the bundled sqlite on android also uses `SQLITE_TEMP_STORE=3`. // https://android.googlesource.com/platform/external/sqlite/+/2c8c9ae3b7e6f340a19a0001c2a889a211c9d8b2/dist/Android.mk if super::android_target() { cfg.flag("-DSQLITE_TEMP_STORE=3"); } if cfg!(feature = "with-asan") { cfg.flag("-fsanitize=address"); } // If explicitly requested: enable static linking against the Microsoft Visual // C++ Runtime to avoid dependencies on vcruntime140.dll and similar libraries. if cfg!(target_feature = "crt-static") && is_compiler("msvc") { cfg.static_crt(true); } // Older versions of visual studio don't support c99 (including isnan), which // causes a build failure when the linker fails to find the `isnan` // function. `sqlite` provides its own implementation, using the fact // that x != x when x is NaN. // // There may be other platforms that don't support `isnan`, they should be // tested for here. if is_compiler("msvc") { use cc::windows_registry::{find_vs_version, VsVers}; let vs_has_nan = match find_vs_version() { Ok(ver) => ver != VsVers::Vs12, Err(_msg) => false, }; if vs_has_nan { cfg.flag("-DHAVE_ISNAN"); } } else { cfg.flag("-DHAVE_ISNAN"); } if !win_target() { cfg.flag("-DHAVE_LOCALTIME_R"); } // Target wasm32-wasi can't compile the default VFS if is_compiler("wasm32-wasi") { cfg.flag("-DSQLITE_OS_OTHER") // https://github.com/rust-lang/rust/issues/74393 .flag("-DLONGDOUBLE_TYPE=double"); if cfg!(feature = "wasm32-wasi-vfs") { cfg.file("sqlite3/wasm32-wasi-vfs.c"); } } if cfg!(feature = "unlock_notify") { cfg.flag("-DSQLITE_ENABLE_UNLOCK_NOTIFY"); } if cfg!(feature = "preupdate_hook") { cfg.flag("-DSQLITE_ENABLE_PREUPDATE_HOOK"); } if cfg!(feature = "session") { cfg.flag("-DSQLITE_ENABLE_SESSION"); } if let Ok(limit) = env::var("SQLITE_MAX_VARIABLE_NUMBER") { cfg.flag(&format!("-DSQLITE_MAX_VARIABLE_NUMBER={limit}")); } println!("cargo:rerun-if-env-changed=SQLITE_MAX_VARIABLE_NUMBER"); if let Ok(limit) = env::var("SQLITE_MAX_EXPR_DEPTH") { cfg.flag(&format!("-DSQLITE_MAX_EXPR_DEPTH={limit}")); } println!("cargo:rerun-if-env-changed=SQLITE_MAX_EXPR_DEPTH"); if let Ok(extras) = env::var("LIBSQLITE3_FLAGS") { for extra in extras.split_whitespace() { if extra.starts_with("-D") || extra.starts_with("-U") { cfg.flag(extra); } else if extra.starts_with("SQLITE_") { cfg.flag(&format!("-D{extra}")); } else { panic!("Don't understand {} in LIBSQLITE3_FLAGS", extra); } } } println!("cargo:rerun-if-env-changed=LIBSQLITE3_FLAGS"); cfg.compile(lib_name); println!("cargo:lib_dir={out_dir}"); } fn env(name: &str) -> Option { let prefix = env::var("TARGET").unwrap().to_uppercase().replace('-', "_"); let prefixed = format!("{prefix}_{name}"); let var = env::var_os(prefixed); match var { None => env::var_os(name), _ => var, } } fn find_openssl_dir(_host: &str, _target: &str) -> Option { let openssl_dir = env("OPENSSL_DIR"); openssl_dir.map(PathBuf::from) } } fn env_prefix() -> &'static str { if cfg!(any(feature = "sqlcipher", feature = "bundled-sqlcipher")) { "SQLCIPHER" } else { "SQLITE3" } } fn lib_name() -> &'static str { if cfg!(any(feature = "sqlcipher", feature = "bundled-sqlcipher")) { "sqlcipher" } else if cfg!(all(windows, feature = "winsqlite3")) { "winsqlite3" } else { "sqlite3" } } pub enum HeaderLocation { FromEnvironment, Wrapper, FromPath(String), } impl From for String { fn from(header: HeaderLocation) -> String { match header { HeaderLocation::FromEnvironment => { let prefix = env_prefix(); let mut header = env::var(format!("{prefix}_INCLUDE_DIR")).unwrap_or_else(|_| { panic!( "{}_INCLUDE_DIR must be set if {}_LIB_DIR is set", prefix, prefix ) }); header.push_str("/sqlite3.h"); header } HeaderLocation::Wrapper => "wrapper.h".into(), HeaderLocation::FromPath(path) => path, } } } mod build_linked { #[cfg(feature = "vcpkg")] extern crate vcpkg; use super::{bindings, env_prefix, is_compiler, lib_name, win_target, HeaderLocation}; use std::env; use std::path::Path; pub fn main(_out_dir: &str, out_path: &Path) { let header = find_sqlite(); if (cfg!(any( feature = "bundled_bindings", feature = "bundled", feature = "bundled-sqlcipher" )) || (win_target() && cfg!(feature = "bundled-windows"))) && !cfg!(feature = "buildtime_bindgen") { // Generally means the `bundled_bindings` feature is enabled. // Most users are better off with turning // on buildtime_bindgen instead, but this is still supported as we // have runtime version checks and there are good reasons to not // want to run bindgen. std::fs::copy( format!("{}/bindgen_bundled_version.rs", lib_name()), out_path, ) .expect("Could not copy bindings to output directory"); } else { bindings::write_to_out_dir(header, out_path); } } fn find_link_mode() -> &'static str { // If the user specifies SQLITE3_STATIC (or SQLCIPHER_STATIC), do static // linking, unless it's explicitly set to 0. match &env::var(format!("{}_STATIC", env_prefix())) { Ok(v) if v != "0" => "static", _ => "dylib", } } // Prints the necessary cargo link commands and returns the path to the header. fn find_sqlite() -> HeaderLocation { let link_lib = lib_name(); println!("cargo:rerun-if-env-changed={}_INCLUDE_DIR", env_prefix()); println!("cargo:rerun-if-env-changed={}_LIB_DIR", env_prefix()); println!("cargo:rerun-if-env-changed={}_STATIC", env_prefix()); if cfg!(feature = "vcpkg") && is_compiler("msvc") { println!("cargo:rerun-if-env-changed=VCPKGRS_DYNAMIC"); } // dependents can access `DEP_SQLITE3_LINK_TARGET` (`sqlite3` being the // `links=` value in our Cargo.toml) to get this value. This might be // useful if you need to ensure whatever crypto library sqlcipher relies // on is available, for example. println!("cargo:link-target={link_lib}"); if win_target() && cfg!(feature = "winsqlite3") { println!("cargo:rustc-link-lib=dylib={link_lib}"); return HeaderLocation::Wrapper; } // Allow users to specify where to find SQLite. if let Ok(dir) = env::var(format!("{}_LIB_DIR", env_prefix())) { // Try to use pkg-config to determine link commands let pkgconfig_path = Path::new(&dir).join("pkgconfig"); env::set_var("PKG_CONFIG_PATH", pkgconfig_path); if pkg_config::Config::new().probe(link_lib).is_err() { // Otherwise just emit the bare minimum link commands. println!("cargo:rustc-link-lib={}={link_lib}", find_link_mode()); println!("cargo:rustc-link-search={dir}"); } return HeaderLocation::FromEnvironment; } if let Some(header) = try_vcpkg() { return header; } // See if pkg-config can do everything for us. if let Ok(mut lib) = pkg_config::Config::new() .print_system_libs(false) .probe(link_lib) { if let Some(mut header) = lib.include_paths.pop() { header.push("sqlite3.h"); HeaderLocation::FromPath(header.to_string_lossy().into()) } else { HeaderLocation::Wrapper } } else { // No env var set and pkg-config couldn't help; just output the link-lib // request and hope that the library exists on the system paths. We used to // output /usr/lib explicitly, but that can introduce other linking problems; // see https://github.com/rusqlite/rusqlite/issues/207. println!("cargo:rustc-link-lib={}={link_lib}", find_link_mode()); HeaderLocation::Wrapper } } fn try_vcpkg() -> Option { if cfg!(feature = "vcpkg") && is_compiler("msvc") { // See if vcpkg can find it. if let Ok(mut lib) = vcpkg::Config::new().probe(lib_name()) { if let Some(mut header) = lib.include_paths.pop() { header.push("sqlite3.h"); return Some(HeaderLocation::FromPath(header.to_string_lossy().into())); } } None } else { None } } } #[cfg(not(feature = "buildtime_bindgen"))] mod bindings { #![allow(dead_code)] use super::HeaderLocation; use std::fs; use std::path::Path; static PREBUILT_BINDGEN_PATHS: &[&str] = &["bindgen-bindings/bindgen_3.14.0.rs"]; pub fn write_to_out_dir(_header: HeaderLocation, out_path: &Path) { let in_path = PREBUILT_BINDGEN_PATHS[PREBUILT_BINDGEN_PATHS.len() - 1]; fs::copy(in_path, out_path).expect("Could not copy bindings to output directory"); } } #[cfg(feature = "buildtime_bindgen")] mod bindings { use super::HeaderLocation; use bindgen::callbacks::{IntKind, ParseCallbacks}; use std::fs::OpenOptions; use std::io::Write; use std::path::Path; use super::win_target; #[derive(Debug)] struct SqliteTypeChooser; impl ParseCallbacks for SqliteTypeChooser { fn int_macro(&self, _name: &str, value: i64) -> Option { if value >= i32::MIN as i64 && value <= i32::MAX as i64 { Some(IntKind::I32) } else { None } } fn item_name(&self, original_item_name: &str) -> Option { original_item_name .strip_prefix("sqlite3_index_info_") .map(|s| s.to_owned()) } } // Are we generating the bundled bindings? Used to avoid emitting things // that would be problematic in bundled builds. This env var is set by // `upgrade.sh`. fn generating_bundled_bindings() -> bool { // Hacky way to know if we're generating the bundled bindings println!("cargo:rerun-if-env-changed=LIBSQLITE3_SYS_BUNDLING"); match std::env::var("LIBSQLITE3_SYS_BUNDLING") { Ok(v) => v != "0", Err(_) => false, } } pub fn write_to_out_dir(header: HeaderLocation, out_path: &Path) { let header: String = header.into(); let mut output = Vec::new(); let mut bindings = bindgen::builder() .trust_clang_mangling(false) .header(header.clone()) .parse_callbacks(Box::new(SqliteTypeChooser)) .rustfmt_bindings(true); if cfg!(any(feature = "sqlcipher", feature = "bundled-sqlcipher")) { bindings = bindings.clang_arg("-DSQLITE_HAS_CODEC"); } if cfg!(feature = "unlock_notify") { bindings = bindings.clang_arg("-DSQLITE_ENABLE_UNLOCK_NOTIFY"); } if cfg!(feature = "preupdate_hook") { bindings = bindings.clang_arg("-DSQLITE_ENABLE_PREUPDATE_HOOK"); } if cfg!(feature = "session") { bindings = bindings.clang_arg("-DSQLITE_ENABLE_SESSION"); } if win_target() && cfg!(feature = "winsqlite3") { bindings = bindings .clang_arg("-DBINDGEN_USE_WINSQLITE3") .blocklist_item("NTDDI_.+") .blocklist_item("WINAPI_FAMILY.*") .blocklist_item("_WIN32_.+") .blocklist_item("_VCRT_COMPILER_PREPROCESSOR") .blocklist_item("_SAL_VERSION") .blocklist_item("__SAL_H_VERSION") .blocklist_item("_USE_DECLSPECS_FOR_SAL") .blocklist_item("_USE_ATTRIBUTES_FOR_SAL") .blocklist_item("_CRT_PACKING") .blocklist_item("_HAS_EXCEPTIONS") .blocklist_item("_STL_LANG") .blocklist_item("_HAS_CXX17") .blocklist_item("_HAS_CXX20") .blocklist_item("_HAS_NODISCARD") .blocklist_item("WDK_NTDDI_VERSION") .blocklist_item("OSVERSION_MASK") .blocklist_item("SPVERSION_MASK") .blocklist_item("SUBVERSION_MASK") .blocklist_item("WINVER") .blocklist_item("__security_cookie") .blocklist_type("size_t") .blocklist_type("__vcrt_bool") .blocklist_type("wchar_t") .blocklist_function("__security_init_cookie") .blocklist_function("__report_gsfailure") .blocklist_function("__va_start"); } // When cross compiling unless effort is taken to fix the issue, bindgen // will find the wrong headers. There's only one header included by the // amalgamated `sqlite.h`: `stdarg.h`. // // Thankfully, there's almost no case where rust code needs to use // functions taking `va_list` (It's nearly impossible to get a `va_list` // in Rust unless you get passed it by C code for some reason). // // Arguably, we should never be including these, but we include them for // the cases where they aren't totally broken... let target_arch = std::env::var("TARGET").unwrap(); let host_arch = std::env::var("HOST").unwrap(); let is_cross_compiling = target_arch != host_arch; // Note that when generating the bundled file, we're essentially always // cross compiling. if generating_bundled_bindings() || is_cross_compiling { // Get rid of va_list, as it's not bindings = bindings .blocklist_function("sqlite3_vmprintf") .blocklist_function("sqlite3_vsnprintf") .blocklist_function("sqlite3_str_vappendf") .blocklist_type("va_list") .blocklist_type("__builtin_va_list") .blocklist_type("__gnuc_va_list") .blocklist_type("__va_list_tag") .blocklist_item("__GNUC_VA_LIST"); } bindings .layout_tests(false) .generate() .unwrap_or_else(|_| panic!("could not run bindgen on header {}", header)) .write(Box::new(&mut output)) .expect("could not write output of bindgen"); let mut output = String::from_utf8(output).expect("bindgen output was not UTF-8?!"); // rusqlite's functions feature ors in the SQLITE_DETERMINISTIC flag when it // can. This flag was added in SQLite 3.8.3, but oring it in in prior // versions of SQLite is harmless. We don't want to not build just // because this flag is missing (e.g., if we're linking against // SQLite 3.7.x), so append the flag manually if it isn't present in bindgen's // output. if !output.contains("pub const SQLITE_DETERMINISTIC") { output.push_str("\npub const SQLITE_DETERMINISTIC: i32 = 2048;\n"); } let mut file = OpenOptions::new() .write(true) .truncate(true) .create(true) .open(out_path) .unwrap_or_else(|_| panic!("Could not write to {:?}", out_path)); file.write_all(output.as_bytes()) .unwrap_or_else(|_| panic!("Could not write to {:?}", out_path)); } } libsqlite3-sys-0.26.0/src/error.rs000064400000000000000000000335231046102023000150740ustar 00000000000000use std::error; use std::fmt; use std::os::raw::c_int; /// Error Codes #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[non_exhaustive] pub enum ErrorCode { /// Internal logic error in SQLite InternalMalfunction, /// Access permission denied PermissionDenied, /// Callback routine requested an abort OperationAborted, /// The database file is locked DatabaseBusy, /// A table in the database is locked DatabaseLocked, /// A malloc() failed OutOfMemory, /// Attempt to write a readonly database ReadOnly, /// Operation terminated by sqlite3_interrupt() OperationInterrupted, /// Some kind of disk I/O error occurred SystemIoFailure, /// The database disk image is malformed DatabaseCorrupt, /// Unknown opcode in sqlite3_file_control() NotFound, /// Insertion failed because database is full DiskFull, /// Unable to open the database file CannotOpen, /// Database lock protocol error FileLockingProtocolFailed, /// The database schema changed SchemaChanged, /// String or BLOB exceeds size limit TooBig, /// Abort due to constraint violation ConstraintViolation, /// Data type mismatch TypeMismatch, /// Library used incorrectly ApiMisuse, /// Uses OS features not supported on host NoLargeFileSupport, /// Authorization denied AuthorizationForStatementDenied, /// 2nd parameter to sqlite3_bind out of range ParameterOutOfRange, /// File opened that is not a database file NotADatabase, /// SQL error or missing database Unknown, } #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Error { pub code: ErrorCode, pub extended_code: c_int, } impl Error { #[must_use] pub fn new(result_code: c_int) -> Error { let code = match result_code & 0xff { super::SQLITE_INTERNAL => ErrorCode::InternalMalfunction, super::SQLITE_PERM => ErrorCode::PermissionDenied, super::SQLITE_ABORT => ErrorCode::OperationAborted, super::SQLITE_BUSY => ErrorCode::DatabaseBusy, super::SQLITE_LOCKED => ErrorCode::DatabaseLocked, super::SQLITE_NOMEM => ErrorCode::OutOfMemory, super::SQLITE_READONLY => ErrorCode::ReadOnly, super::SQLITE_INTERRUPT => ErrorCode::OperationInterrupted, super::SQLITE_IOERR => ErrorCode::SystemIoFailure, super::SQLITE_CORRUPT => ErrorCode::DatabaseCorrupt, super::SQLITE_NOTFOUND => ErrorCode::NotFound, super::SQLITE_FULL => ErrorCode::DiskFull, super::SQLITE_CANTOPEN => ErrorCode::CannotOpen, super::SQLITE_PROTOCOL => ErrorCode::FileLockingProtocolFailed, super::SQLITE_SCHEMA => ErrorCode::SchemaChanged, super::SQLITE_TOOBIG => ErrorCode::TooBig, super::SQLITE_CONSTRAINT => ErrorCode::ConstraintViolation, super::SQLITE_MISMATCH => ErrorCode::TypeMismatch, super::SQLITE_MISUSE => ErrorCode::ApiMisuse, super::SQLITE_NOLFS => ErrorCode::NoLargeFileSupport, super::SQLITE_AUTH => ErrorCode::AuthorizationForStatementDenied, super::SQLITE_RANGE => ErrorCode::ParameterOutOfRange, super::SQLITE_NOTADB => ErrorCode::NotADatabase, _ => ErrorCode::Unknown, }; Error { code, extended_code: result_code, } } } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, "Error code {}: {}", self.extended_code, code_to_str(self.extended_code) ) } } impl error::Error for Error { fn description(&self) -> &str { code_to_str(self.extended_code) } } // Result codes. // Note: These are not public because our bindgen bindings export whichever // constants are present in the current version of SQLite. We repeat them here // so we don't have to worry about which version of SQLite added which // constants, and we only use them to implement code_to_str below. // Extended result codes. const SQLITE_ERROR_MISSING_COLLSEQ: c_int = super::SQLITE_ERROR | (1 << 8); const SQLITE_ERROR_RETRY: c_int = super::SQLITE_ERROR | (2 << 8); const SQLITE_ERROR_SNAPSHOT: c_int = super::SQLITE_ERROR | (3 << 8); const SQLITE_IOERR_BEGIN_ATOMIC: c_int = super::SQLITE_IOERR | (29 << 8); const SQLITE_IOERR_COMMIT_ATOMIC: c_int = super::SQLITE_IOERR | (30 << 8); const SQLITE_IOERR_ROLLBACK_ATOMIC: c_int = super::SQLITE_IOERR | (31 << 8); const SQLITE_IOERR_DATA: c_int = super::SQLITE_IOERR | (32 << 8); const SQLITE_LOCKED_VTAB: c_int = super::SQLITE_LOCKED | (2 << 8); const SQLITE_BUSY_TIMEOUT: c_int = super::SQLITE_BUSY | (3 << 8); const SQLITE_CANTOPEN_SYMLINK: c_int = super::SQLITE_CANTOPEN | (6 << 8); const SQLITE_CORRUPT_SEQUENCE: c_int = super::SQLITE_CORRUPT | (2 << 8); const SQLITE_CORRUPT_INDEX: c_int = super::SQLITE_CORRUPT | (3 << 8); const SQLITE_READONLY_CANTINIT: c_int = super::SQLITE_READONLY | (5 << 8); const SQLITE_READONLY_DIRECTORY: c_int = super::SQLITE_READONLY | (6 << 8); const SQLITE_CONSTRAINT_PINNED: c_int = super::SQLITE_CONSTRAINT | (11 << 8); const SQLITE_CONSTRAINT_DATATYPE: c_int = super::SQLITE_CONSTRAINT | (12 << 8); #[must_use] pub fn code_to_str(code: c_int) -> &'static str { match code { super::SQLITE_OK => "Successful result", super::SQLITE_ERROR => "SQL error or missing database", super::SQLITE_INTERNAL => "Internal logic error in SQLite", super::SQLITE_PERM => "Access permission denied", super::SQLITE_ABORT => "Callback routine requested an abort", super::SQLITE_BUSY => "The database file is locked", super::SQLITE_LOCKED => "A table in the database is locked", super::SQLITE_NOMEM => "A malloc() failed", super::SQLITE_READONLY => "Attempt to write a readonly database", super::SQLITE_INTERRUPT => "Operation terminated by sqlite3_interrupt()", super::SQLITE_IOERR => "Some kind of disk I/O error occurred", super::SQLITE_CORRUPT => "The database disk image is malformed", super::SQLITE_NOTFOUND => "Unknown opcode in sqlite3_file_control()", super::SQLITE_FULL => "Insertion failed because database is full", super::SQLITE_CANTOPEN => "Unable to open the database file", super::SQLITE_PROTOCOL => "Database lock protocol error", super::SQLITE_EMPTY => "Database is empty", super::SQLITE_SCHEMA => "The database schema changed", super::SQLITE_TOOBIG => "String or BLOB exceeds size limit", super::SQLITE_CONSTRAINT=> "Abort due to constraint violation", super::SQLITE_MISMATCH => "Data type mismatch", super::SQLITE_MISUSE => "Library used incorrectly", super::SQLITE_NOLFS => "Uses OS features not supported on host", super::SQLITE_AUTH => "Authorization denied", super::SQLITE_FORMAT => "Auxiliary database format error", super::SQLITE_RANGE => "2nd parameter to sqlite3_bind out of range", super::SQLITE_NOTADB => "File opened that is not a database file", super::SQLITE_NOTICE => "Notifications from sqlite3_log()", super::SQLITE_WARNING => "Warnings from sqlite3_log()", super::SQLITE_ROW => "sqlite3_step() has another row ready", super::SQLITE_DONE => "sqlite3_step() has finished executing", SQLITE_ERROR_MISSING_COLLSEQ => "SQLITE_ERROR_MISSING_COLLSEQ", SQLITE_ERROR_RETRY => "SQLITE_ERROR_RETRY", SQLITE_ERROR_SNAPSHOT => "SQLITE_ERROR_SNAPSHOT", super::SQLITE_IOERR_READ => "Error reading from disk", super::SQLITE_IOERR_SHORT_READ => "Unable to obtain number of requested bytes (file truncated?)", super::SQLITE_IOERR_WRITE => "Error writing to disk", super::SQLITE_IOERR_FSYNC => "Error flushing data to persistent storage (fsync)", super::SQLITE_IOERR_DIR_FSYNC => "Error calling fsync on a directory", super::SQLITE_IOERR_TRUNCATE => "Error attempting to truncate file", super::SQLITE_IOERR_FSTAT => "Error invoking fstat to get file metadata", super::SQLITE_IOERR_UNLOCK => "I/O error within xUnlock of a VFS object", super::SQLITE_IOERR_RDLOCK => "I/O error within xLock of a VFS object (trying to obtain a read lock)", super::SQLITE_IOERR_DELETE => "I/O error within xDelete of a VFS object", super::SQLITE_IOERR_BLOCKED => "SQLITE_IOERR_BLOCKED", // no longer used super::SQLITE_IOERR_NOMEM => "Out of memory in I/O layer", super::SQLITE_IOERR_ACCESS => "I/O error within xAccess of a VFS object", super::SQLITE_IOERR_CHECKRESERVEDLOCK => "I/O error within then xCheckReservedLock method", super::SQLITE_IOERR_LOCK => "I/O error in the advisory file locking layer", super::SQLITE_IOERR_CLOSE => "I/O error within the xClose method", super::SQLITE_IOERR_DIR_CLOSE => "SQLITE_IOERR_DIR_CLOSE", // no longer used super::SQLITE_IOERR_SHMOPEN => "I/O error within the xShmMap method (trying to open a new shared-memory segment)", super::SQLITE_IOERR_SHMSIZE => "I/O error within the xShmMap method (trying to resize an existing shared-memory segment)", super::SQLITE_IOERR_SHMLOCK => "SQLITE_IOERR_SHMLOCK", // no longer used super::SQLITE_IOERR_SHMMAP => "I/O error within the xShmMap method (trying to map a shared-memory segment into process address space)", super::SQLITE_IOERR_SEEK => "I/O error within the xRead or xWrite (trying to seek within a file)", super::SQLITE_IOERR_DELETE_NOENT => "File being deleted does not exist", super::SQLITE_IOERR_MMAP => "I/O error while trying to map or unmap part of the database file into process address space", super::SQLITE_IOERR_GETTEMPPATH => "VFS is unable to determine a suitable directory for temporary files", super::SQLITE_IOERR_CONVPATH => "cygwin_conv_path() system call failed", super::SQLITE_IOERR_VNODE => "SQLITE_IOERR_VNODE", // not documented? super::SQLITE_IOERR_AUTH => "SQLITE_IOERR_AUTH", SQLITE_IOERR_BEGIN_ATOMIC => "SQLITE_IOERR_BEGIN_ATOMIC", SQLITE_IOERR_COMMIT_ATOMIC => "SQLITE_IOERR_COMMIT_ATOMIC", SQLITE_IOERR_ROLLBACK_ATOMIC => "SQLITE_IOERR_ROLLBACK_ATOMIC", SQLITE_IOERR_DATA => "SQLITE_IOERR_DATA", super::SQLITE_LOCKED_SHAREDCACHE => "Locking conflict due to another connection with a shared cache", SQLITE_LOCKED_VTAB => "SQLITE_LOCKED_VTAB", super::SQLITE_BUSY_RECOVERY => "Another process is recovering a WAL mode database file", super::SQLITE_BUSY_SNAPSHOT => "Cannot promote read transaction to write transaction because of writes by another connection", SQLITE_BUSY_TIMEOUT => "SQLITE_BUSY_TIMEOUT", super::SQLITE_CANTOPEN_NOTEMPDIR => "SQLITE_CANTOPEN_NOTEMPDIR", // no longer used super::SQLITE_CANTOPEN_ISDIR => "Attempted to open directory as file", super::SQLITE_CANTOPEN_FULLPATH => "Unable to convert filename into full pathname", super::SQLITE_CANTOPEN_CONVPATH => "cygwin_conv_path() system call failed", SQLITE_CANTOPEN_SYMLINK => "SQLITE_CANTOPEN_SYMLINK", super::SQLITE_CORRUPT_VTAB => "Content in the virtual table is corrupt", SQLITE_CORRUPT_SEQUENCE => "SQLITE_CORRUPT_SEQUENCE", SQLITE_CORRUPT_INDEX => "SQLITE_CORRUPT_INDEX", super::SQLITE_READONLY_RECOVERY => "WAL mode database file needs recovery (requires write access)", super::SQLITE_READONLY_CANTLOCK => "Shared-memory file associated with WAL mode database is read-only", super::SQLITE_READONLY_ROLLBACK => "Database has hot journal that must be rolled back (requires write access)", super::SQLITE_READONLY_DBMOVED => "Database cannot be modified because database file has moved", SQLITE_READONLY_CANTINIT => "SQLITE_READONLY_CANTINIT", SQLITE_READONLY_DIRECTORY => "SQLITE_READONLY_DIRECTORY", super::SQLITE_ABORT_ROLLBACK => "Transaction was rolled back", super::SQLITE_CONSTRAINT_CHECK => "A CHECK constraint failed", super::SQLITE_CONSTRAINT_COMMITHOOK => "Commit hook caused rollback", super::SQLITE_CONSTRAINT_FOREIGNKEY => "Foreign key constraint failed", super::SQLITE_CONSTRAINT_FUNCTION => "Error returned from extension function", super::SQLITE_CONSTRAINT_NOTNULL => "A NOT NULL constraint failed", super::SQLITE_CONSTRAINT_PRIMARYKEY => "A PRIMARY KEY constraint failed", super::SQLITE_CONSTRAINT_TRIGGER => "A RAISE function within a trigger fired", super::SQLITE_CONSTRAINT_UNIQUE => "A UNIQUE constraint failed", super::SQLITE_CONSTRAINT_VTAB => "An application-defined virtual table error occurred", super::SQLITE_CONSTRAINT_ROWID => "A non-unique rowid occurred", SQLITE_CONSTRAINT_PINNED => "SQLITE_CONSTRAINT_PINNED", SQLITE_CONSTRAINT_DATATYPE => "SQLITE_CONSTRAINT_DATATYPE", super::SQLITE_NOTICE_RECOVER_WAL => "A WAL mode database file was recovered", super::SQLITE_NOTICE_RECOVER_ROLLBACK => "Hot journal was rolled back", super::SQLITE_WARNING_AUTOINDEX => "Automatic indexing used - database might benefit from additional indexes", super::SQLITE_AUTH_USER => "SQLITE_AUTH_USER", // not documented? _ => "Unknown error code", } } libsqlite3-sys-0.26.0/src/lib.rs000064400000000000000000000017761046102023000145160ustar 00000000000000#![allow(non_snake_case, non_camel_case_types)] #![cfg_attr(test, allow(deref_nullptr))] // https://github.com/rust-lang/rust-bindgen/issues/2066 // force linking to openssl #[cfg(feature = "bundled-sqlcipher-vendored-openssl")] extern crate openssl_sys; #[cfg(all(windows, feature = "winsqlite3", target_pointer_width = "32"))] compile_error!("The `libsqlite3-sys/winsqlite3` feature is not supported on 32 bit targets."); pub use self::error::*; use std::default::Default; use std::mem; mod error; #[must_use] pub fn SQLITE_STATIC() -> sqlite3_destructor_type { None } #[must_use] pub fn SQLITE_TRANSIENT() -> sqlite3_destructor_type { Some(unsafe { mem::transmute(-1_isize) }) } #[allow(clippy::all)] mod bindings { include!(concat!(env!("OUT_DIR"), "/bindgen.rs")); } pub use bindings::*; impl Default for sqlite3_vtab { fn default() -> Self { unsafe { mem::zeroed() } } } impl Default for sqlite3_vtab_cursor { fn default() -> Self { unsafe { mem::zeroed() } } } libsqlite3-sys-0.26.0/upgrade_sqlcipher.sh000075500000000000000000000030031046102023000166340ustar 00000000000000#!/bin/sh -e SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) echo "$SCRIPT_DIR" cd "$SCRIPT_DIR" || { echo "fatal error" >&2; exit 1; } cargo clean mkdir -p "$SCRIPT_DIR/../target" "$SCRIPT_DIR/sqlcipher" export SQLCIPHER_LIB_DIR="$SCRIPT_DIR/sqlcipher" export SQLCIPHER_INCLUDE_DIR="$SQLCIPHER_LIB_DIR" SQLCIPHER_VERSION="4.5.3" # Download and generate sqlcipher amalgamation mkdir -p $SCRIPT_DIR/sqlcipher.src [ -e "v${SQLCIPHER_VERSION}.tar.gz" ] || curl -sfL -O "https://github.com/sqlcipher/sqlcipher/archive/v${SQLCIPHER_VERSION}.tar.gz" tar xzf "v${SQLCIPHER_VERSION}.tar.gz" --strip-components=1 -C "$SCRIPT_DIR/sqlcipher.src" cd "$SCRIPT_DIR/sqlcipher.src" ./configure --with-crypto-lib=none make sqlite3.c cp sqlite3.c sqlite3.h sqlite3ext.h "$SCRIPT_DIR/sqlcipher/" cd "$SCRIPT_DIR" rm -rf "v${SQLCIPHER_VERSION}.tar.gz" sqlcipher.src # Regenerate bindgen file for sqlcipher rm -f "$SQLCIPHER_LIB_DIR/bindgen_bundled_version.rs" # cargo update find "$SCRIPT_DIR/../target" -type f -name bindgen.rs -exec rm {} \; env LIBSQLITE3_SYS_BUNDLING=1 cargo build --features "sqlcipher buildtime_bindgen session" find "$SCRIPT_DIR/../target" -type f -name bindgen.rs -exec mv {} "$SQLCIPHER_LIB_DIR/bindgen_bundled_version.rs" \; # Sanity checks cd "$SCRIPT_DIR/.." || { echo "fatal error" >&2; exit 1; } cargo update cargo test --features "backup blob chrono functions limits load_extension serde_json trace vtab bundled-sqlcipher-vendored-openssl" printf ' \e[35;1mFinished\e[0m bundled-sqlcipher-vendored-openssl/sqlcipher tests\n' libsqlite3-sys-0.26.0/wrapper.h000064400000000000000000000001421046102023000144260ustar 00000000000000#ifdef BINDGEN_USE_WINSQLITE3 #include #else #include "sqlite3.h" #endif