lib: Move fp_dev definition and helpers to separate header

This commit is contained in:
Bastien Nocera 2018-09-14 17:19:30 +02:00
parent d7af9a4498
commit 170da7fec1
6 changed files with 54 additions and 2 deletions

View file

@ -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);

View file

@ -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) ({ \

21
libfprint/fpi-dev.c Normal file
View file

@ -0,0 +1,21 @@
/*
* fp_dev types manipulation
* Copyright (C) 2018 Bastien Nocera <hadess@hadess.net>
*
* 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 <glib.h>

28
libfprint/fpi-dev.h Normal file
View file

@ -0,0 +1,28 @@
/*
* fp_dev types manipulation
* Copyright (C) 2018 Bastien Nocera <hadess@hadess.net>
*
* 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;

View file

@ -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',

View file

@ -20,6 +20,7 @@
#define FP_COMPONENT "sync"
#include "fp_internal.h"
#include "fpi-dev.h"
#include <config.h>
#include <errno.h>