Skip to main content

sqlcipher_src/
lib.rs

1#![doc = include_str!("../README.md")]
2
3use std::path::Path;
4
5/// SQLCipher release the vendored amalgamation is generated from.
6pub const SQLCIPHER_VERSION: &str = "4.19.0";
7
8/// SQLite release that SQLCipher release is based on.
9pub const SQLITE_VERSION: &str = "3.53.4";
10
11/// libtomcrypt release providing the ciphers, hashes and random generator.
12pub const LIBTOMCRYPT_VERSION: &str = "1.18.2";
13
14/// SQLCipher amalgamation inside [`source_dir`], with the crypto provider left to the build.
15pub const SOURCE_FILE: &str = "sqlcipher.c";
16
17/// Public SQLCipher header inside [`source_dir`].
18pub const HEADER_FILE: &str = "sqlite3.h";
19
20/// libtomcrypt's header directory inside [`source_dir`], which SQLCipher's `<tomcrypt.h>` and every file in
21/// [`LIBTOMCRYPT_SOURCES`] need on the include path.
22pub const LIBTOMCRYPT_INCLUDE_DIR: &str = "libtomcrypt/headers";
23
24/// libtomcrypt files inside [`source_dir`], each compiled as its own translation unit.
25///
26/// Each needs `LTC_SOURCE` defined and the build's `LTC_*` configuration, as upstream builds them. The tables they
27/// `#include` are left out.
28pub const LIBTOMCRYPT_SOURCES: &[&str] = &include!("libtomcrypt_sources.rs");
29
30/// Directory holding the sources, at the path this crate was compiled from.
31#[must_use]
32pub fn source_dir() -> &'static Path {
33    Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/sqlcipher"))
34}