// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2025 Au-Zone Technologies. All Rights Reserved.

//! Low-level FFI bindings for the TensorFlow Lite C API.
//!
//! This crate provides raw, unsafe bindings generated by `bindgen` with
//! `--dynamic-loading`. Symbols are resolved at runtime via `libloading`.
//!
//! **Most users should depend on `edgefirst-tflite` instead**, which
//! provides a safe, ergonomic API on top of these bindings.
//!
//! # Library Discovery
//!
//! Use [`discovery::discover`] to automatically find and load the `TFLite`
//! shared library, or [`discovery::load`] to load from a specific path.
//!
//! # `VxDelegate` Extensions
//!
//! The [`vx_ffi`] module provides function pointer structs for the
//! `VxDelegate` DMA-BUF and `CameraAdaptor` APIs, loaded at runtime from
//! the delegate shared library.

// Suppress all clippy/rustc/rustdoc warnings for bindgen-generated code.
#[allow(
    clippy::all,
    clippy::pedantic,
    clippy::nursery,
    non_upper_case_globals,
    non_camel_case_types,
    non_snake_case,
    missing_debug_implementations,
    unreachable_pub,
    dead_code,
    rustdoc::bare_urls,
    rustdoc::broken_intra_doc_links
)]
mod ffi {
    include!("ffi.rs");
}

pub use ffi::*;

/// Sentinel value for an unset `TfLiteBufferHandle` (`kTfLiteNullBufferHandle = -1`).
#[allow(non_upper_case_globals)]
pub const kTfLiteNullBufferHandle: TfLiteBufferHandle = -1;

pub mod discovery;
pub mod vx_ffi;
