#bindings #ffi #code-generation

cmacro

A library for parsing C macros and generating Rust code

9 releases

new 0.2.2 Mar 20, 2023
0.2.1 Mar 20, 2023
0.1.5 Mar 19, 2023
0.1.2 Dec 8, 2022

#92 in FFI

Download history 844/week @ 2022-12-07 3/week @ 2022-12-14 4/week @ 2022-12-21 3/week @ 2022-12-28 1/week @ 2023-01-04 6/week @ 2023-01-11 4/week @ 2023-01-18 4/week @ 2023-01-25 7/week @ 2023-02-01 21/week @ 2023-02-08 18/week @ 2023-02-15 477/week @ 2023-03-08 766/week @ 2023-03-15

1,246 downloads per month

MIT/Apache

180KB
5K SLoC

cmacro

Crates.io Documentation

This is a library for parsing C macros and converting them to Rust functions or macros.


lib.rs:

A library for parsing C macros.

This crate allows parsing C macros and converting them to Rust code.

Both function-like macros (e.g. #define FUNC(a, b, c) a + b * c) as well as variable-like macros (e.g. #define VAR 4 + 7 * 82) are supported.

See [FnMacro] and [VarMacro] on how to parse macros.

Dependencies

~1.5–2MB
~43K SLoC