Skip to main content

lyplg_add_type_plugin

Function lyplg_add_type_plugin 

Source
pub unsafe extern "C" fn lyplg_add_type_plugin(
    ctx: *mut ly_ctx,
    version: u32,
    recs: *const lyplg_type_record,
) -> Type
Expand description

@brief Manually load type plugins from memory

Note, that a plugin can be loaded only if there is at least one context. The loaded plugins are connected with the existence of a context. When all the contexts are destroyed, all the plugins are unloaded.

@param[in] ctx The context to which the plugin should be associated with. If NULL, the plugin is considered to be shared between all existing contexts. @param[in] version The version of plugin records. @param[in] recs An array of plugin records provided by the plugin implementation. The array must be terminated by a zeroed record.

@return LY_SUCCESS if the plugins with compatible version were successfully loaded. @return LY_EDENIED in case there is no context and the plugin cannot be loaded. @return LY_EINVAL when recs is NULL or the plugin contains invalid content for this libyang version.