Manually refactor Rust code translated from a C library, CJSON with an automated tool, c2rust.
cargo build --release
move the library in target/release
gcc test.c -o test librust_cjson.a -pthread -ldl
./test
Rewrite a tiny C library, Buffer using Rust and compatible with Rust interface. The Rust code has the same semantics as the original C library, but it cannot be called in C code.
cargo build --release
cargo run
Rewrite a tiny C library, Buffer using Rust and compatible with C interface. The Rust code has the same semantics as the original C library, and it can be called in C code.
cargo build --release
move the library in target/release
gcc test.c -o test librust_buffer.a -pthread -ldl
./test