2021-09-04 03:36:35 +00:00
|
|
|
# libCwtch-rs
|
|
|
|
|
2023-05-08 20:41:41 +00:00
|
|
|
Rust bindings for [libCwtch autobindings](https://git.openprivacy.ca/cwtch.im/autobindings/)
|
2021-09-08 07:32:56 +00:00
|
|
|
|
|
|
|
Example echobot in examples/echobot.rs (`cargo run --example echobot` -- assumes tor is on $PATH)
|
2021-09-04 03:36:35 +00:00
|
|
|
|
|
|
|
## Building
|
|
|
|
|
|
|
|
### Updating libCwtch and bingings.rs with Bindgen
|
|
|
|
|
|
|
|
libCwtch.so version is specified in build.rs. If updating, also download the corresponding libCwtch.h and delete
|
|
|
|
the 'preamble from import "C"' section as it imports headers required for the C lib to compile
|
2023-06-26 07:03:04 +00:00
|
|
|
but that we don't want to create rust bindings for (like importing stdlib.h). `cargo build` automatically calls
|
|
|
|
`bindgen` for us and will regenerate `src/cwtchlib_go/bindings.rs` if libCwtch.h has changed.
|
2021-09-04 03:36:35 +00:00
|
|
|
|
2022-04-27 20:03:10 +00:00
|
|
|
While developing you can use the `LCG_DIR` environment variable to specify the directory containing a local `libCwtch.so`
|
|
|
|
library to override the default one.
|
|
|
|
|
2023-06-26 07:03:04 +00:00
|
|
|
This is useful in cases where you are adding or updating APIs prior to a release.
|