9 releases (3 major breaking)

new 3.1.0 Apr 29, 2024
3.0.0 Apr 28, 2024
2.0.0 Apr 26, 2024
1.3.0 Apr 20, 2024
0.1.2 Mar 7, 2024

#1783 in Rust patterns

Download history 312/week @ 2024-03-03 45/week @ 2024-03-10 3/week @ 2024-03-17 47/week @ 2024-03-31 3/week @ 2024-04-07 308/week @ 2024-04-14 171/week @ 2024-04-21

529 downloads per month
Used in 2 crates

Apache-2.0

16KB
334 lines

C Emit

C-Emit provides all its users with a polished builder API to write C Code.


lib.rs:

The C Code Generator for Rust.

C-Emit provides a polished Builder API for generating C Code.

Example

use c_emit::{Code, CArg};

let mut code = Code::new();

code.include("stdio.h");
code.call_func_with_args("printf", vec![CArg::String("Hello, world!")]);
assert_eq!(code.to_string(), r#"
#include<stdio.h>
int main() {
printf("Hello, world!");
return 0;
}
"#.trim_start().to_string());

No runtime deps