Skip to main content

export_plugin

Macro export_plugin 

Source
macro_rules! export_plugin {
    ($body:expr) => { ... };
}
Expand description

Export a unified ABI plugin entrypoint under rpi_plugin_register.

The unified ABI has no version suffix in the symbol name; the version lives inside the PluginApi struct (first field abi_version).

The expression receives &PluginApi and returns the plugin-defined registration status code.

ⓘ
rpi_plugin_sdk::export_plugin!(|api| {
    if let Some(declare) = api.declare {
        declare(rpi_plugin_sdk::StbStringRef::from_str(
            r#"{"priority":60,"platforms":["linux"]}"#,
        ));
    }
    // ... register tools and handlers through `api` ...
    0
});