# FFI for AdGuard FLM This crate is a set of bindings over filter-list-manager and build configurations for FFI bindings to interface with other programming languages. There are currently two *POSSIBLE* ways to work with this library: 1) Code generated by [uniffi-rs][uniffi-rs] 2) C language interface using [protocol buffers][protobuf] for serialisation (Preferred). [protobuf]: https://protobuf.dev [uniffi-rs]: https://github.com/mozilla/uniffi-rs ## How to build You may need regenerate protobuf files for rust and `flm_native_interface.h` header:\ `cargo run -p ffi-native-assets-generator`.\ It's better run this operation from the workspace root. ### Apple platforms If you need to generate protobuf *.swift files: ```shell platform/apple/Scripts/generate_proto.sh ``` This code will build a package compatible macOS, iOS, simulator. ```shell platform/apple/Scripts/configure.sh platform/apple/Scripts/build.sh ``` ### Windows See readme for uniffi-based build [on GitHub](https://github.com/AdguardTeam/FilterListManager/blob/master/platform/windows/README_WIN.md) or protobuf-based [here](./src/platforms/windows/README_WIN.md) ## FFI-specific symbols Look at these symbols for better understanding FFI interface. ### Protobuf interface [Native interface source](./src/native_interface/mod.rs) [C Header source](./src/platforms/flm_native_interface.h) ### Functions [Top Level Functions source](./src/top_level.rs) ### Models [Source](./src/models/mod.rs) ### Errors `OuterError` - flattened enum from `adguard_flm::FLMError`.\ [Source](./src/outer_error.rs)