Skip to main content

Module c_api

Module c_api 

Source
Expand description

C-compatible FFI bindings.

Thin wrappers around the public API. Opaque pointers. No Rust types exposed. All functions use panic::catch_unwind for safety and null-pointer checks.

Constants§

ACB_ERR_INVALID
Invalid argument.
ACB_ERR_IO
I/O error.
ACB_ERR_NOT_FOUND
Not found.
ACB_ERR_NULL_PTR
Null pointer.
ACB_ERR_OVERFLOW
Buffer overflow.
ACB_OK
Success.

Functions§

acb_graph_dimension
Get the embedding dimension.
acb_graph_edge_count
Get the number of edges in the graph.
acb_graph_free
Free a graph handle.
acb_graph_get_edges
Get outgoing edges from a unit. Returns edge count or error code.
acb_graph_get_unit_complexity
Get a unit’s complexity score. Returns -1.0 if not found.
acb_graph_get_unit_file
Get a unit’s file path. Writes to buffer. Returns path length or error code.
acb_graph_get_unit_language
Get a unit’s language. Returns language as u8, or -1 if not found.
acb_graph_get_unit_name
Get a unit’s name. Writes to buffer. Returns name length or error code.
acb_graph_get_unit_stability
Get a unit’s stability score. Returns -1.0 if not found.
acb_graph_get_unit_type
Get a unit’s type as a u8. Returns -1 if not found.
acb_graph_open
Load a code graph from an .acb file. Returns handle or NULL on failure.
acb_graph_unit_count
Get the number of code units in the graph.