1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Low-level Rust FFI bindings for the Choco Solver native C API.
//!
//! This crate exposes the generated bindings for `libchoco_capi`, the native library
//! produced for Choco Solver. It is the unsafe boundary used by the higher-level Rust
//! API in this repository. Most users should prefer the top-level crate instead of
//! depending on `choco-solver-sys` directly.
//!
//! # What This Crate Contains
//!
//! - Auto-generated `bindgen` output for `libchoco_capi.h`
//! - A generated dynamic symbol loader, exposed as [`libchoco_capi`]
//! - Re-exported raw FFI types, constants, and functions from the generated bindings
//!
//! # Building The Native Library
//!
//! This crate does not build `libchoco_capi` for you. To produce the native library,
//! see `BUILDING.md` in the repository root or the upstream `choco-solver-capi`
//! project.
//!
//! # Safety
//!
//! The API exposed by this crate is intentionally low-level and mostly unsafe:
//!
//! - Function signatures are raw FFI declarations generated from the C header
//! - Dynamically loaded symbols must only be called with valid pointers and values
//! - Lifetime and thread-safety guarantees are determined by the native library, not
//! by Rust types in this crate
//!
//! # Example
//!
//! ```no_run
//! use choco_solver_sys::{libchoco_capi, library_filename};
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let library_path = if cfg!(target_os = "windows") {
//! library_filename("libchoco_capi")
//! } else {
//! library_filename("choco_capi")
//! };
//!
//! let api = unsafe { libchoco_capi::new(&library_path)? };
//!
//! // Generated loaders store each symbol lookup result on the struct.
//! let create_isolate = api.graal_create_isolate.as_ref()?;
//! let _ = create_isolate;
//!
//! Ok(())
//! }
//! ```
pub use *;
/// Builds a platform-specific dynamic library filename.
///
/// This is re-exported from `libloading` as a convenience when loading
/// `libchoco_capi` dynamically.
pub use library_filename;