Provide a C wrapper for native app calling based on RUST implementation.
.
|--src
|--def.h //extern raw rust function to C.
|--lib.h //C API define
|--lib.c //impl of C API
|--lib.rs //wrapper of RUST, make it easy to call from C
|--test.c //test code
|--readme.md
|--Cargo.toml
|--test //execute binary
in project root dir:
cargo build
in project root dir, use gcc:
on Linux
gcc -g -o test ./src/lib.c ./src/test.c ./target/debug/libschnorrkel_c.so -L. -Wl,-rpath=.^C
on OSX
gcc -g -o test ./src/lib.c ./src/test.c ./target/debug/libschnorrkel_c.dylib -L.
./test