From 2c06a4ebfaed93505bb7daa7d9a49bb394bdbfb4 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Mon, 8 Oct 2007 17:05:58 +0100 Subject: [PATCH] Expose driver info to library users --- libfprint/core.c | 20 ++++++++++++++++++++ libfprint/fprint.h | 7 +++++++ 2 files changed, 27 insertions(+) diff --git a/libfprint/core.c b/libfprint/core.c index a8922c5..2fbaa48 100644 --- a/libfprint/core.c +++ b/libfprint/core.c @@ -118,6 +118,11 @@ API_EXPORTED void fp_dscv_devs_free(struct fp_dscv_dev **devs) g_free(devs); } +API_EXPORTED const struct fp_driver *fp_dscv_dev_get_driver(struct fp_dscv_dev *dev) +{ + return dev->drv; +} + API_EXPORTED struct fp_dev *fp_dev_open(struct fp_dscv_dev *ddev) { struct fp_dev *dev; @@ -152,6 +157,21 @@ API_EXPORTED void fp_dev_close(struct fp_dev *dev) g_free(dev); } +API_EXPORTED const struct fp_driver *fp_dev_get_driver(struct fp_dev *dev) +{ + return dev->drv; +} + +API_EXPORTED const char *fp_driver_get_name(const struct fp_driver *drv) +{ + return drv->name; +} + +API_EXPORTED const char *fp_driver_get_full_name(const struct fp_driver *drv) +{ + return drv->full_name; +} + API_EXPORTED int fp_init(void) { usb_init(); diff --git a/libfprint/fprint.h b/libfprint/fprint.h index 07d35d3..3a3f34e 100644 --- a/libfprint/fprint.h +++ b/libfprint/fprint.h @@ -23,14 +23,21 @@ /* structs that applications are not allowed to peek into */ struct fp_dscv_dev; struct fp_dev; +struct fp_driver; /* Device discovery */ struct fp_dscv_dev **fp_discover_devs(void); void fp_dscv_devs_free(struct fp_dscv_dev **devs); +const struct fp_driver *fp_dscv_dev_get_driver(struct fp_dscv_dev *dev); /* Device handling */ struct fp_dev *fp_dev_open(struct fp_dscv_dev *ddev); void fp_dev_close(struct fp_dev *dev); +const struct fp_driver *fp_dev_get_driver(struct fp_dev *dev); + +/* Drivers */ +const char *fp_driver_get_name(const struct fp_driver *drv); +const char *fp_driver_get_full_name(const struct fp_driver *drv); int fp_init(void);