Introduce a clearer API for looking up exports

This commit is contained in:
Pierre Pronchery 2016-06-14 23:59:44 +02:00
parent 195e391d28
commit 8031a2449e

View File

@ -24,6 +24,7 @@
/* Plugin */ /* Plugin */
typedef void Plugin; typedef void Plugin;
typedef void * PluginExport;
typedef struct _PluginHeader typedef struct _PluginHeader
{ {
@ -40,8 +41,10 @@ Plugin * plugin_new(String const * libdir, String const * package,
Plugin * plugin_new_self(void); Plugin * plugin_new_self(void);
void plugin_delete(Plugin * plugin); void plugin_delete(Plugin * plugin);
/* accessors */
PluginExport plugin_get_export(Plugin * plugin, String const * name);
/* useful */ /* useful */
void * plugin_lookup(Plugin * plugin, String const * symbol); PluginExport plugin_lookup(Plugin * plugin, String const * symbol);
#endif /* !LIBSYSTEM_SYSTEM_PLUGIN_H */ #endif /* !LIBSYSTEM_SYSTEM_PLUGIN_H */