storage: add save/load functionality
[libfprint.git] / libfprint / fprint.h
blob8f7984fdf601ccb9b482495d3337284e3b52d4cc
1 /*
2 * Main definitions for libfprint
3 * Copyright (C) 2007 Daniel Drake <dsd@gentoo.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef __FPRINT_H__
21 #define __FPRINT_H__
23 /* structs that applications are not allowed to peek into */
24 struct fp_dscv_dev;
25 struct fp_dev;
26 struct fp_driver;
27 struct fp_print_data;
29 /* misc/general stuff */
30 enum fp_finger {
31 LEFT_THUMB = 1,
32 LEFT_INDEX,
33 LEFT_MIDDLE,
34 LEFT_RING,
35 LEFT_LITTLE,
36 RIGHT_THUMB,
37 RIGHT_INDEX,
38 RIGHT_MIDDLE,
39 RIGHT_RING,
40 RIGHT_LITTLE,
43 /* Device discovery */
44 struct fp_dscv_dev **fp_discover_devs(void);
45 void fp_dscv_devs_free(struct fp_dscv_dev **devs);
46 const struct fp_driver *fp_dscv_dev_get_driver(struct fp_dscv_dev *dev);
48 /* Device handling */
49 struct fp_dev *fp_dev_open(struct fp_dscv_dev *ddev);
50 void fp_dev_close(struct fp_dev *dev);
51 const struct fp_driver *fp_dev_get_driver(struct fp_dev *dev);
52 int fp_dev_get_nr_enroll_stages(struct fp_dev *dev);
54 /* Drivers */
55 const char *fp_driver_get_name(const struct fp_driver *drv);
56 const char *fp_driver_get_full_name(const struct fp_driver *drv);
58 /* Enrollment */
59 enum fp_enroll_result {
60 FP_ENROLL_COMPLETE = 1,
61 FP_ENROLL_FAIL,
62 FP_ENROLL_PASS,
63 FP_ENROLL_RETRY = 100,
64 FP_ENROLL_RETRY_TOO_SHORT,
65 FP_ENROLL_RETRY_CENTER_FINGER,
66 FP_ENROLL_RETRY_REMOVE_FINGER,
69 int fp_enroll_finger(struct fp_dev *dev, struct fp_print_data **print_data);
71 /* Verification */
72 enum fp_verify_result {
73 FP_VERIFY_NO_MATCH = 0,
74 FP_VERIFY_MATCH = 1,
75 FP_VERIFY_RETRY = FP_ENROLL_RETRY,
76 FP_VERIFY_RETRY_TOO_SHORT = FP_ENROLL_RETRY_TOO_SHORT,
77 FP_VERIFY_RETRY_CENTER_FINGER = FP_ENROLL_RETRY_CENTER_FINGER,
78 FP_VERIFY_RETRY_REMOVE_FINGER = FP_ENROLL_RETRY_REMOVE_FINGER,
81 int fp_verify_finger(struct fp_dev *dev, struct fp_print_data *enrolled_print);
83 /* Data handling */
84 int fp_print_data_load(struct fp_dev *dev, enum fp_finger finger,
85 struct fp_print_data **data);
86 int fp_print_data_save(struct fp_print_data *data, enum fp_finger finger);
87 void fp_print_data_free(struct fp_print_data *data);
89 /* Library */
90 int fp_init(void);
92 #endif