7
PLUGIN_NAME = 'plugin';
8
SYMBOL_NAME = 'get_plugin_info';
12
func : function : pgchar;
17
if not g_module_supported then
19
g_error ('No GModule support on this platform.'#13#10);
22
filename := g_module_build_path ('.',PLUGIN_NAME);
23
g_print ('Trying to locate module; using %s as filename'#13#10,
26
module := g_module_open (filename, G_MODULE_BIND_MASK);
30
g_error ('Couldn''t find Module %s!'#13#10, [PLUGIN_NAME]);
34
if not g_module_symbol (module, SYMBOL_NAME, @func) then
36
g_error ('No symbol %s in %s found!'#13#10, [SYMBOL_NAME, PLUGIN_NAME]);
37
g_module_close (module);
43
g_print ('Plugin defined itself as "%s"'#13#10, [id]);
45
g_module_close (module);