xmtp_sys/lib.rs
1//! Raw FFI bindings to `libxmtp_ffi` — the XMTP messaging protocol static library.
2//!
3//! All types and functions are **auto-generated** by [`bindgen`](https://docs.rs/bindgen)
4//! from the C header `xmtp_ffi.h` produced by `cbindgen`. Do not edit manually.
5//!
6//! # Build
7//!
8//! The build script (`build.rs`) automatically:
9//! 1. Downloads the pre-built static library from GitHub Releases (or uses a local path).
10//! 2. Runs `bindgen` on the included `xmtp_ffi.h` header.
11//! 3. Configures the linker to link the static library + system dependencies.
12//!
13//! For local development, set `XMTP_FFI_DIR` to point at the `xmtp-ffi` crate root
14//! (e.g. `../xmtp-ffi`) — it must contain `include/xmtp_ffi.h` and a built static lib.
15
16// sys crate: unsafe FFI, non-idiomatic generated code
17#![allow(
18 unsafe_code,
19 missing_docs,
20 non_camel_case_types,
21 non_upper_case_globals,
22 non_snake_case,
23 clippy::missing_safety_doc,
24 clippy::upper_case_acronyms
25)]
26
27// When the `regenerate` feature is enabled, use freshly generated bindings.
28// Otherwise, use the pre-generated bindings committed in the repository.
29#[cfg(feature = "regenerate")]
30include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
31#[cfg(not(feature = "regenerate"))]
32include!("bindings.rs");