Initial driver registration mechanism

Also added the basis of the upekts driver, which is the first I'll
implement.
This commit is contained in:
Daniel Drake
2007-10-08 16:46:42 +01:00
parent 7d3612d9f6
commit 046bdc0bda
5 changed files with 131 additions and 2 deletions

View File

@@ -19,7 +19,31 @@
#include <config.h>
#include <glib.h>
#include "fp_internal.h"
static GList *registered_drivers = NULL;
static void register_driver(const struct fp_driver *drv)
{
registered_drivers = g_list_prepend(registered_drivers, (gpointer) drv);
}
static const struct fp_driver * const drivers[] = {
&upekts_driver,
};
static void register_drivers(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(drivers); i++)
register_driver(drivers[i]);
}
API_EXPORTED int fp_init(void)
{
register_drivers();
return 0;
}