Crates.io | drogue-ffi-compat |
lib.rs | drogue-ffi-compat |
version | 0.1.0 |
source | src |
created_at | 2020-09-17 15:44:48.572923 |
updated_at | 2020-09-17 15:44:48.572923 |
description | C compatibility shims for FFI integrations |
homepage | |
repository | |
max_upload_size | |
id | 289820 |
size | 17,534 |
drogue-ffi-compat
A small utility library encompassing C-compatibility bits for making FFI integrations easier on non-libc platforms, such as Cortex-M.
Support for C-style variadic functions is provided through a VaList
struct, which knows how to manipulate memory the same as C in order to peel off variable length argument lists.
It does not support direct implementation of variadic functions.
In order to use it with true variadic functions, a bonafide C shim is required in order to construct a va_list
, using normal va_start(...)
and va_end(...)
macros.
*printf(...)
This crate exports two printf
compatible functions:
snprintf()
implemented in bonafide Cvsnprintf()
implemented in Rust.Additionally, a minimal set of C-style printf formatting specifiers are marginally supported.
Width and precision modifiers are consumed, but not currently respected. The goal is to support these functions well enough for simple integrations.