Expand description
FFI (Foreign Function Interface) bindings for C interoperability
This module provides a C-compatible API for IPFRS, allowing the library to be used from C, C++, and other languages that support C FFI.
§Safety
All functions are marked as unsafe extern "C" and handle panics to prevent
undefined behavior. Proper null checks are performed on all pointer arguments.
§Memory Management
- Opaque pointers are used to hide Rust types from C
- Callers must free resources using the provided
*_freefunctions - Strings passed from C must be valid UTF-8 null-terminated strings
- Strings returned to C must be freed using
ipfrs_string_free
Structs§
- Ipfrs
Block - Opaque handle to a block
- Ipfrs
Client - Opaque handle to IPFRS client
Enums§
- Ipfrs
Error Code - FFI error codes
Functions§
- ipfrs_
add ⚠ - Add data to IPFRS and return its CID
- ipfrs_
client_ ⚠free - Free an IPFRS client
- ipfrs_
client_ ⚠new - Initialize a new IPFRS client
- ipfrs_
data_ ⚠free - Free data returned by ipfrs_get
- ipfrs_
get ⚠ - Get data from IPFRS by CID
- ipfrs_
get_ last_ error - Get the last error message
- ipfrs_
has ⚠ - Check if a block exists by CID
- ipfrs_
string_ ⚠free - Free a string returned by IPFRS functions
- ipfrs_
version - Get library version string