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