Lines Matching defs:plugin
61 * The pi_init() routine is also called to give the plugin a chance
68 sa_plugin_t *plugin;
75 salog_error(0, "Error loading libshare plugin: %s: %s",
82 salog_error(0, "Error loading libshare plugin: %s: %s",
90 "Error loading libshare plugin: %s", path);
95 plugin = (sa_plugin_t *)calloc(1, sizeof (sa_plugin_t));
97 if (plugin == NULL) {
100 "Error loading libshare plugin: %s", path);
119 "Error loading libshare plugin: %s", path);
121 free(plugin);
128 "Error initializing libshare plugin: %s", path);
130 free(plugin);
135 * add plugin to list
138 plugin->pi_next = *pi_list;
139 plugin->pi_ops = pi_ops;
140 plugin->pi_hdl = dlhandle;
141 *pi_list = plugin;
200 "Error loading libshare plugin %s/%s",
212 * mark plugin type as loaded regardless of success.
225 * Unload all plugin modules of the given type.
232 sa_plugin_t *plugin, *next; /* use fs_plugin as generic type */
258 plugin = *pi_list;
259 while (plugin != NULL) {
260 next = plugin->pi_next;
263 * plugin a chance to cleanup.
265 if (plugin->pi_ops->pi_fini != NULL)
266 (void) plugin->pi_ops->pi_fini();
268 if (plugin->pi_hdl != NULL) {
269 (void) dlclose(plugin->pi_hdl);
272 free(plugin);
273 plugin = next;
286 * Unload all loaded plugin modules.
300 * return ops table for specified plugin
305 sa_plugin_t *plugin;
310 * load the plugin if not yet loaded
332 for (plugin = *pi_list; plugin != NULL; plugin = plugin->pi_next) {
333 if (plugin->pi_ops != NULL &&
334 plugin->pi_ops->pi_type == ops_type)
339 if (plugin != NULL)
340 return (plugin->pi_ops);
350 sa_plugin_t *plugin;
358 for (plugin = sa_proto_list; plugin != NULL; plugin = plugin->pi_next) {
359 if (plugin->pi_ops != NULL)
369 for (i = 0, plugin = sa_proto_list;
370 plugin != NULL;
371 ++i, plugin = plugin->pi_next) {
372 if (plugin->pi_ops != NULL)
373 (*protos)[i] = plugin->pi_ops->pi_type;
384 * Return pointer to next plugin in the list of type specified
385 * If ops == NULL return first plugin in the list.
392 sa_plugin_t *plugin;
395 * load the plugin if not yet loaded
418 plugin = *pi_list;
420 for (plugin = *pi_list; plugin != NULL;
421 plugin = plugin->pi_next) {
422 if (plugin->pi_ops == ops) {
423 plugin = plugin->pi_next;
430 if (plugin != NULL)
431 return (plugin->pi_ops);