C bindings for the Rust guerrillamail-client crate.
This repo builds a native library with a blocking C ABI. Internally it owns a Tokio runtime and uses the async Rust client underneath, so C and C++ callers can use a simple request/response API.
Build
Artifacts are written under target/debug/:
libguerrillamail_client_c.alibguerrillamail_client_c.dylibon macOSlibguerrillamail_client_c.soon Linux
The public header is include/guerrillamail_client.h.
Regenerate the Header
The checked-in header matches the current ABI. If cbindgen is installed locally, regenerate it
with:
Usage from C or C++
See examples/demo.c for a minimal consumer. The expected flow is:
- Create a builder or default client.
- Call blocking client functions.
- Free returned strings/lists/details explicitly.
- On failure, inspect
gm_last_error_message().
To build the demo with CMake on macOS, Linux, or Windows:
For a release Rust library build, configure with
-DGUERRILLAMAIL_CLIENT_C_PROFILE=Release.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/cool-feature) - Commit your changes (
git commit -m 'Add some cool feature') - Push to the branch (
git push origin feature/cool-feature) - Open a Pull Request
Support
If this crate saves you time or helps your work, support is appreciated:
License
This project is licensed under the MIT License; see the license for details.