guerrillamail-client-c 0.1.0

C bindings for the guerrillamail-client Rust crate
Documentation

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

cargo build

Artifacts are written under target/debug/:

  • libguerrillamail_client_c.a
  • libguerrillamail_client_c.dylib on macOS
  • libguerrillamail_client_c.so on 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:

cbindgen --config cbindgen.toml --crate guerrillamail-client-c --output include/guerrillamail_client.h

Usage from C or C++

See examples/demo.c for a minimal consumer. The expected flow is:

  1. Create a builder or default client.
  2. Call blocking client functions.
  3. Free returned strings/lists/details explicitly.
  4. On failure, inspect gm_last_error_message().

To build the demo with CMake on macOS, Linux, or Windows:

cmake -S examples -B build/demo
cmake --build build/demo

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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/cool-feature)
  3. Commit your changes (git commit -m 'Add some cool feature')
  4. Push to the branch (git push origin feature/cool-feature)
  5. Open a Pull Request

Support

If this crate saves you time or helps your work, support is appreciated:

Ko-fi

License

This project is licensed under the MIT License; see the license for details.