Expand description
§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());
Structs§
- The Code Struct.
Enums§
- The C Argument.
- The variable initialization.
- The variable types.