Skip to main content

c_support/
lib.rs

1//! Internal libc-style helpers for the C libraries linked into Xila.
2//!
3//! LVGL and LittleFS expect a C library (`malloc`, `memcpy`, `strlen`, ...).
4//! Their Rust glue (`graphics`' LVGL hooks and `little_fs`' stubs) forwards to
5//! the functions of this crate, which allocate through the system
6//! `memory` manager and implement the memory and string primitives.
7//!
8//! This crate is plain Rust: it exports no C symbols, ships no header and is
9//! not an application ABI. The public native ABI is `xila-abi-application`.
10
11#![no_std]
12
13extern crate alloc;
14
15mod memory;
16mod string;
17
18pub use memory::*;
19pub use string::*;
20
21#[cfg(test)]
22mod tests {
23    #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
24    testing_support::instantiate_global_allocator!();
25}