From bc76cfe623a5317465d00cae557f69b5b30157ba Mon Sep 17 00:00:00 2001 From: Gavan Fantom Date: Sun, 29 Apr 2007 13:12:36 +0000 Subject: [PATCH] Add plugins files missing from earlier commit --- src/lsi/plugin.h | 10 ++++++++++ src/lsi/plugins.c | 23 +++++++++++++++++++++++ src/lsi/plugins.h | 13 +++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 src/lsi/plugin.h create mode 100644 src/lsi/plugins.c create mode 100644 src/lsi/plugins.h diff --git a/src/lsi/plugin.h b/src/lsi/plugin.h new file mode 100644 index 0000000..ee954ce --- /dev/null +++ b/src/lsi/plugin.h @@ -0,0 +1,10 @@ +/* plugin.h */ + +struct plugin { + char *pl_name; + int (*pl_init)(void); + void (*pl_shutdown)(void); + int pl_active; + /* function table? */ +}; + diff --git a/src/lsi/plugins.c b/src/lsi/plugins.c new file mode 100644 index 0000000..9f8a5d0 --- /dev/null +++ b/src/lsi/plugins.c @@ -0,0 +1,23 @@ +/* plugins.c */ + +/* + * This is the master table of plugins. Add a plugin here + * for it to take effect. + */ + +#include "plugin.h" + +#include "midi.h" +#include "dmx.h" +#include "beatdetect.h" +#include "mouse.h" + +struct plugin plugins_table[] = { + {"midi", midi_init, midi_close, 0}, + {"dmx", dmx_init, dmx_close, 0}, + {"beatdetect", beatdetect_init, beatdetect_close, 0}, + {"mouse", mouse_init, mouse_close, 0}, +}; + +int nplugins = (sizeof(plugins_table) / sizeof(struct plugin)); + diff --git a/src/lsi/plugins.h b/src/lsi/plugins.h new file mode 100644 index 0000000..1cfafd0 --- /dev/null +++ b/src/lsi/plugins.h @@ -0,0 +1,13 @@ +/* plugins.h */ + +/* + * The master table of plugins is found in plugins.c. This is + * just a declaration to allow the table to be used. + */ + +#include "plugin.h" + +extern struct plugin plugins_table[]; + +extern int nplugins; +