lib: Split off timeout helpers
And rename poll.c to fpi-poll.c
This commit is contained in:
parent
1102d6e478
commit
efee7262b6
5 changed files with 31 additions and 13 deletions
|
@ -37,6 +37,7 @@
|
||||||
|
|
||||||
#include "fprint.h"
|
#include "fprint.h"
|
||||||
#include "fpi-ssm.h"
|
#include "fpi-ssm.h"
|
||||||
|
#include "fpi-poll.h"
|
||||||
#include "assembling.h"
|
#include "assembling.h"
|
||||||
#include "drivers/driver_ids.h"
|
#include "drivers/driver_ids.h"
|
||||||
|
|
||||||
|
@ -203,15 +204,6 @@ struct fp_img *fpi_img_new_for_imgdev(struct fp_img_dev *dev);
|
||||||
struct fp_img *fpi_img_resize(struct fp_img *img, size_t newsize);
|
struct fp_img *fpi_img_resize(struct fp_img *img, size_t newsize);
|
||||||
struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int w_factor, unsigned int h_factor);
|
struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int w_factor, unsigned int h_factor);
|
||||||
|
|
||||||
/* polling and timeouts */
|
|
||||||
|
|
||||||
typedef void (*fpi_timeout_fn)(void *data);
|
|
||||||
|
|
||||||
struct fpi_timeout;
|
|
||||||
struct fpi_timeout *fpi_timeout_add(unsigned int msec, fpi_timeout_fn callback,
|
|
||||||
void *data);
|
|
||||||
void fpi_timeout_cancel(struct fpi_timeout *timeout);
|
|
||||||
|
|
||||||
void fpi_drvcb_open_complete(struct fp_dev *dev, int status);
|
void fpi_drvcb_open_complete(struct fp_dev *dev, int status);
|
||||||
void fpi_drvcb_close_complete(struct fp_dev *dev);
|
void fpi_drvcb_close_complete(struct fp_dev *dev);
|
||||||
|
|
||||||
|
|
|
@ -341,13 +341,11 @@ int fpi_img_compare_print_data_to_gallery(struct fp_print_data *print,
|
||||||
struct fp_print_data **gallery, int match_threshold, size_t *match_offset);
|
struct fp_print_data **gallery, int match_threshold, size_t *match_offset);
|
||||||
struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int w_factor, unsigned int h_factor);
|
struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int w_factor, unsigned int h_factor);
|
||||||
|
|
||||||
/* polling and timeouts */
|
/* polling */
|
||||||
|
|
||||||
void fpi_poll_init(void);
|
void fpi_poll_init(void);
|
||||||
void fpi_poll_exit(void);
|
void fpi_poll_exit(void);
|
||||||
|
|
||||||
typedef void (*fpi_timeout_fn)(void *data);
|
|
||||||
|
|
||||||
void fpi_drvcb_open_complete(struct fp_dev *dev, int status);
|
void fpi_drvcb_open_complete(struct fp_dev *dev, int status);
|
||||||
void fpi_drvcb_close_complete(struct fp_dev *dev);
|
void fpi_drvcb_close_complete(struct fp_dev *dev);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#define FP_COMPONENT "poll"
|
#define FP_COMPONENT "poll"
|
||||||
|
|
||||||
#include "fp_internal.h"
|
#include "fp_internal.h"
|
||||||
|
#include "fpi-poll.h"
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
26
libfprint/fpi-poll.h
Normal file
26
libfprint/fpi-poll.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Polling/timing management
|
||||||
|
* Copyright (C) 2008 Daniel Drake <dsd@gentoo.org>
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef void (*fpi_timeout_fn)(void *data);
|
||||||
|
|
||||||
|
struct fpi_timeout;
|
||||||
|
struct fpi_timeout *fpi_timeout_add(unsigned int msec, fpi_timeout_fn callback,
|
||||||
|
void *data);
|
||||||
|
void fpi_timeout_cancel(struct fpi_timeout *timeout);
|
|
@ -6,9 +6,10 @@ libfprint_sources = [
|
||||||
'data.c',
|
'data.c',
|
||||||
'fpi-ssm.c',
|
'fpi-ssm.c',
|
||||||
'fpi-ssm.h',
|
'fpi-ssm.h',
|
||||||
|
'fpi-poll.h',
|
||||||
|
'fpi-poll.c',
|
||||||
'img.c',
|
'img.c',
|
||||||
'imgdev.c',
|
'imgdev.c',
|
||||||
'poll.c',
|
|
||||||
'sync.c',
|
'sync.c',
|
||||||
'assembling.c',
|
'assembling.c',
|
||||||
'assembling.h',
|
'assembling.h',
|
||||||
|
|
Loading…
Reference in a new issue