From 170da7fec18878e38871d8b413d7793bccac3c46 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 14 Sep 2018 17:19:30 +0200 Subject: [PATCH] lib: Move fp_dev definition and helpers to separate header --- libfprint/drivers_api.h | 3 +-- libfprint/fp_internal.h | 1 + libfprint/fpi-dev.c | 21 +++++++++++++++++++++ libfprint/fpi-dev.h | 28 ++++++++++++++++++++++++++++ libfprint/meson.build | 2 ++ libfprint/sync.c | 1 + 6 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 libfprint/fpi-dev.c create mode 100644 libfprint/fpi-dev.h diff --git a/libfprint/drivers_api.h b/libfprint/drivers_api.h index bd0bdd7..67caad5 100644 --- a/libfprint/drivers_api.h +++ b/libfprint/drivers_api.h @@ -33,10 +33,10 @@ #include "fpi-log.h" #include "fpi-ssm.h" #include "fpi-poll.h" +#include "fpi-dev.h" #include "assembling.h" #include "drivers/driver_ids.h" -struct fp_dev; libusb_device_handle *fpi_dev_get_usb_dev(struct fp_dev *dev); void *fpi_dev_get_user_data (struct fp_dev *dev); void fpi_dev_set_user_data (struct fp_dev *dev, void *user_data); @@ -69,7 +69,6 @@ enum fp_imgdev_enroll_state { IMG_ACQUIRE_STATE_DEACTIVATING, }; -struct fp_img_dev; libusb_device_handle *fpi_imgdev_get_usb_dev(struct fp_img_dev *dev); void fpi_imgdev_set_user_data(struct fp_img_dev *imgdev, void *user_data); diff --git a/libfprint/fp_internal.h b/libfprint/fp_internal.h index 3336cac..e84f520 100644 --- a/libfprint/fp_internal.h +++ b/libfprint/fp_internal.h @@ -29,6 +29,7 @@ #include "fprint.h" #include "fpi-log.h" +#include "fpi-dev.h" #include "drivers/driver_ids.h" #define container_of(ptr, type, member) ({ \ diff --git a/libfprint/fpi-dev.c b/libfprint/fpi-dev.c new file mode 100644 index 0000000..6a188d2 --- /dev/null +++ b/libfprint/fpi-dev.c @@ -0,0 +1,21 @@ +/* + * fp_dev types manipulation + * Copyright (C) 2018 Bastien Nocera + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "fp_internal.h" +#include diff --git a/libfprint/fpi-dev.h b/libfprint/fpi-dev.h new file mode 100644 index 0000000..2edbeb9 --- /dev/null +++ b/libfprint/fpi-dev.h @@ -0,0 +1,28 @@ +/* + * fp_dev types manipulation + * Copyright (C) 2018 Bastien Nocera + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +struct fp_dev; + +/** + * fp_img_dev: + * + * #fp_img_dev is an opaque structure type. You must access it using the + * appropriate functions. + */ +struct fp_img_dev; diff --git a/libfprint/meson.build b/libfprint/meson.build index ceacc35..c593dae 100644 --- a/libfprint/meson.build +++ b/libfprint/meson.build @@ -4,6 +4,8 @@ libfprint_sources = [ 'async.c', 'core.c', 'data.c', + 'fpi-dev.c', + 'fpi-dev.h', 'fpi-log.h', 'fpi-ssm.c', 'fpi-ssm.h', diff --git a/libfprint/sync.c b/libfprint/sync.c index c194f5c..8f71b6e 100644 --- a/libfprint/sync.c +++ b/libfprint/sync.c @@ -20,6 +20,7 @@ #define FP_COMPONENT "sync" #include "fp_internal.h" +#include "fpi-dev.h" #include #include