#list #error #flm #uniffi-rs

adguard-flm-ffi

Foreign function interface crate for filter list manager library

25 releases (8 stable)

new 1.7.3 Mar 25, 2025
1.3.2 Feb 6, 2025
1.1.16 Dec 11, 2024
1.1.1 Nov 18, 2024
0.8.17 Nov 7, 2024

#2 in #lists

Download history 229/week @ 2024-12-07 95/week @ 2024-12-14 62/week @ 2024-12-21 28/week @ 2024-12-28 40/week @ 2025-01-04 30/week @ 2025-01-11 9/week @ 2025-01-18 21/week @ 2025-01-25 150/week @ 2025-02-01 56/week @ 2025-02-08 19/week @ 2025-02-15 24/week @ 2025-02-22 130/week @ 2025-03-01 189/week @ 2025-03-08 153/week @ 2025-03-15 141/week @ 2025-03-22

615 downloads per month

Custom license

4.5MB
31K SLoC

C# 19K SLoC // 0.1% comments Rust 12K SLoC // 0.0% comments SQL 119 SLoC // 0.0% comments Visual Studio Solution 31 SLoC NuGet Config 16 SLoC PowerShell 4 SLoC

Contains (Windows DLL, 2MB) AdGuard.Utils.dll, (Windows DLL, 1MB) AdGuard.Utils.Base.dll

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
  2. C language interface using protocol buffers for serialisation (Preferred).

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:

platform/apple/Scripts/generate_proto.sh

This code will build a package compatible macOS, iOS, simulator.

platform/apple/Scripts/configure.sh
platform/apple/Scripts/build.sh

Windows

See readme for uniffi-based build on GitHub or here Protobuf-based project is here

We declare uniffi-based build as an obsolete. So it was moved to ./src/platforms/windows/uniffi and will be removed in 2.0 version. We also keep sample of protobuf-based adapter here. It will be removed in 2.0 version too.

FFI-specific symbols

Look at these symbols for better understanding FFI interface.

Protobuf interface

Native interface source C Header source

Functions

Top Level Functions source

Models

Source

Errors

OuterError - flattened enum from adguard_flm::FLMError.
Source

Dependencies

~36–50MB
~827K SLoC