loro/crates/loro-ffi
2023-01-29 17:48:37 +08:00
..
examples feat: add go bindgen 2023-01-29 17:48:37 +08:00
src feat: add go bindgen 2023-01-29 17:48:37 +08:00
.gitignore feat: add go bindgen 2023-01-29 17:48:37 +08:00
build.rs feat: impl C ffi 2023-01-29 17:48:37 +08:00
Cargo.toml chore: rebase main 2023-01-29 17:48:37 +08:00
cbindgen.toml feat: impl C ffi 2023-01-29 17:48:37 +08:00
README.md feat: add go bindgen 2023-01-29 17:48:37 +08:00

loro-ffi

  • cargo build --release
  • move libloro.a and loro_ffi.h to directory examples/lib
  • run

C++

Read more: cbindgen

g++ loro.cpp -Bstatic -framework Security -L. -lloro -o loro

Go

Read more: cgo

go run main.go

Python

Java

Candidates:

Panama

install panama-jdk and jextract

jextract -I /Library/Developer/CommandLineTools/usr/include/c++/v1 -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -d loro_java -t org.loro -l loro -- lib/loro_ffi.h