added the dependency to the project to circumvent crates.io and updated all projects
This commit is contained in:
parent
c591b2c272
commit
50819abc50
31 changed files with 1422 additions and 14 deletions
11
arduboy-rust/src/library/c.rs
Normal file
11
arduboy-rust/src/library/c.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
//! Clib functions you can use on the Arduboy
|
||||
use core::ffi::{c_char, c_size_t};
|
||||
|
||||
extern "C" {
|
||||
#[link_name = "strlen"]
|
||||
fn c_strlen(cstr: *const c_char) -> c_size_t;
|
||||
}
|
||||
/// A C function to get the length of a string
|
||||
pub fn strlen(cstr: *const i8) -> usize {
|
||||
unsafe { c_strlen(cstr) }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue