2010-05-30 21:33:06 +00:00
|
|
|
/*
|
|
|
|
* uhub - A tiny ADC p2p connection hub
|
2011-12-09 09:29:50 +00:00
|
|
|
* Copyright (C) 2007-2011, Jan Vidar Krey
|
2010-05-30 21:33:06 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HAVE_UHUB_PLUGIN_LOADER_H
|
|
|
|
#define HAVE_UHUB_PLUGIN_LOADER_H
|
|
|
|
|
2010-06-22 14:04:33 +00:00
|
|
|
#include "plugin_api/handle.h"
|
|
|
|
|
2010-06-12 00:54:53 +00:00
|
|
|
struct hub_config;
|
2011-12-09 09:29:50 +00:00
|
|
|
struct hub_info;
|
2010-06-12 00:54:53 +00:00
|
|
|
struct linked_list;
|
2010-07-29 06:43:22 +00:00
|
|
|
struct plugin_handle;
|
2010-06-06 14:15:15 +00:00
|
|
|
|
2010-05-30 21:33:06 +00:00
|
|
|
struct uhub_plugin
|
|
|
|
{
|
|
|
|
void* handle;
|
2010-06-22 14:04:33 +00:00
|
|
|
plugin_unregister_f unregister;
|
2011-12-01 12:37:07 +00:00
|
|
|
char* filename;
|
2011-12-09 09:29:50 +00:00
|
|
|
void* internals; // Hub internal stuff
|
2010-05-30 21:33:06 +00:00
|
|
|
};
|
|
|
|
|
2010-06-12 00:54:53 +00:00
|
|
|
struct uhub_plugins
|
|
|
|
{
|
|
|
|
struct linked_list* loaded;
|
|
|
|
};
|
2010-06-06 14:15:15 +00:00
|
|
|
|
2010-06-12 00:54:53 +00:00
|
|
|
// High level plugin loader ode
|
2011-12-09 09:29:50 +00:00
|
|
|
extern struct plugin_handle* plugin_load(const char* filename, const char* config, struct hub_info* hub);
|
2010-07-29 06:43:22 +00:00
|
|
|
extern void plugin_unload(struct plugin_handle* plugin);
|
2010-06-06 14:15:15 +00:00
|
|
|
|
2010-07-29 06:43:22 +00:00
|
|
|
// extern void plugin_unload(struct plugin_handle*);
|
2011-12-09 09:29:50 +00:00
|
|
|
extern int plugin_initialize(struct hub_config* config, struct hub_info* hub);
|
2010-07-29 06:41:26 +00:00
|
|
|
extern void plugin_shutdown(struct uhub_plugins* handle);
|
2010-06-12 00:54:53 +00:00
|
|
|
|
|
|
|
// Low level plugin loader code (used internally)
|
|
|
|
extern struct uhub_plugin* plugin_open(const char* filename);
|
|
|
|
extern void plugin_close(struct uhub_plugin*);
|
2010-06-06 14:15:15 +00:00
|
|
|
extern void* plugin_lookup_symbol(struct uhub_plugin*, const char* symbol);
|
2010-05-30 21:33:06 +00:00
|
|
|
|
2011-12-09 09:29:50 +00:00
|
|
|
// Used internally only
|
|
|
|
extern struct hub_info* plugin_get_hub(struct plugin_handle*);
|
|
|
|
|
2010-05-30 21:33:06 +00:00
|
|
|
#endif /* HAVE_UHUB_PLUGIN_LOADER_H */
|
|
|
|
|