liblcrq-sys 1.0.2

Low-level bindings to the liblcrq C library
Documentation
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
// Copyright (c) 2025 Gavin Henry <ghenry@sentrypeer.org>

// Ignore Rust's style conventions for our C FFI bindings
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

// Use the include! macro to dump our generated bindings right into our crate's main entry point,
// src/lib.rs:
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

// Some basic tests to ensure that our bindings are working as expected with
// the liblcrq C API

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_lc_calls() {
        unsafe {
            // initialize the RaptorQ context
            // See test/0000-0003.c
            let lcrq_ctx = rq_init(345893, 1024);
            assert!(!lcrq_ctx.is_null());

            // free the RaptorQ context
            rq_free(lcrq_ctx);
        }
    }
}