context UPDATE run-time plugin support (#2213)
* Adding context based extensions plugins support
This patch adds ability to load plugins directly from memory without
need to create shared library by using lyplg_add_plugin() API.
It also allows to associate plugin directly with context, so given
plugin will not affect all contexts, just given context
* Refactored based on PR comments
diff --git a/src/plugins_internal.h b/src/plugins_internal.h
index 59adacf..2ba54f1 100644
--- a/src/plugins_internal.h
+++ b/src/plugins_internal.h
@@ -63,6 +63,7 @@
/**
* @brief Find a type plugin.
*
+ * @param[in] ctx The optional context for which the plugin should be find. If NULL, only shared plugins will be searched
* @param[in] module Name of the module where the type is defined. Must not be NULL, in case of plugins for
* built-in types, the module is "".
* @param[in] revision Revision of the module for which the plugin is implemented. NULL is not a wildcard, it matches
@@ -70,17 +71,18 @@
* @param[in] name Name of the type which the plugin implements.
* @return Found type plugin, NULL if none found.
*/
-struct lyplg_type *lyplg_type_plugin_find(const char *module, const char *revision, const char *name);
+struct lyplg_type *lyplg_type_plugin_find(const struct ly_ctx *ctx, const char *module, const char *revision, const char *name);
/**
* @brief Find an extension plugin.
*
+ * @param[in] ctx The optional context for which the plugin should be find. If NULL, only shared plugins will be searched
* @param[in] module Name of the module where the extension is defined.
* @param[in] revision Revision of the module for which the plugin is implemented. NULL is not a wildcard, it matches
* only the plugins with NULL revision specified.
* @param[in] name Name of the extension which the plugin implements.
* @return Found extension record, NULL if none found.
*/
-struct lyplg_ext_record *lyplg_ext_record_find(const char *module, const char *revision, const char *name);
+struct lyplg_ext_record *lyplg_ext_record_find(const struct ly_ctx *ctx, const char *module, const char *revision, const char *name);
#endif /* LY_PLUGINS_INTERNAL_H_ */