1#![allow(
9 rustdoc::bare_urls,
10 rustdoc::invalid_html_tags,
11 rustdoc::invalid_rust_codeblocks
12)]
13#![allow(clippy::cast_slice_from_raw_parts)]
14
15mod functions;
16mod types;
17#[cfg(feature = "vfs")]
18mod vfs_modules;
19mod vtabs;
20pub use functions::{
21 AggCtx, AggFunc, FinalizeFunction, InitAggFunction, ScalarFunction, StepFunction,
22};
23use functions::{RegisterAggFn, RegisterScalarFn};
24#[cfg(feature = "vfs")]
25pub use limbo_macros::VfsDerive;
26pub use limbo_macros::{register_extension, scalar, AggregateDerive, VTabModuleDerive};
27use std::os::raw::c_void;
28pub use types::{ResultCode, StepResult, Value, ValueType};
29#[cfg(feature = "vfs")]
30pub use vfs_modules::{RegisterVfsFn, VfsExtension, VfsFile, VfsFileImpl, VfsImpl, VfsInterface};
31use vtabs::RegisterModuleFn;
32pub use vtabs::{
33 Conn, Connection, ConstraintInfo, ConstraintOp, ConstraintUsage, ExtIndexInfo, IndexInfo,
34 OrderByInfo, Statement, Stmt, VTabCreateResult, VTabCursor, VTabKind, VTabModule,
35 VTabModuleImpl, VTable,
36};
37
38pub type ExtResult<T> = std::result::Result<T, ResultCode>;
39
40pub type ExtensionEntryPoint = unsafe extern "C" fn(api: *const ExtensionApi) -> ResultCode;
41
42#[repr(C)]
43pub struct ExtensionApi {
44 pub ctx: *mut c_void,
45 pub register_scalar_function: RegisterScalarFn,
46 pub register_aggregate_function: RegisterAggFn,
47 pub register_vtab_module: RegisterModuleFn,
48 #[cfg(feature = "vfs")]
49 pub vfs_interface: VfsInterface,
50}
51
52unsafe impl Send for ExtensionApi {}
53unsafe impl Send for ExtensionApiRef {}
54
55#[repr(C)]
56pub struct ExtensionApiRef {
57 pub api: *const ExtensionApi,
58}