Commit graph

127 commits

Author SHA1 Message Date
Marco Trevisan (Treviño) 7ed9b0c2f9 cleanup: Don't make nbis depend on libfprint built-sources
Now that nbis is a static library it should be possible to compile it
without any fprint-built dependency, although since it included fp_internal
there was a compile-time dependency on the fp-enums that can be generated at
later times.

So:
 - Move nbis-helpers to nbis includes (and remove inclusion in fp_internal)
 - Move the Minutiae definitions inside a standalone fpi-minutiae header
 - Include fpi-minutiae.h in fp_internal.h
 - Include nbis-hepers.h and fpi-minutiae.h in nbis' lfs.h
 - Adapt missing definitions in libfprint
2019-12-04 18:50:46 +01:00
Marco Trevisan (Treviño) d1fb1e26f3 Uncrustify everything except for nbis 2019-11-20 20:38:06 +01:00
Benjamin Berg 689aff0232 lib: Major rewrite of the libfprint core and API
This is a rewrite of the core based on GObject and Gio. This commit
breaks the build in a lot of ways, but basic functionality will start
working again with the next commits.
2019-11-20 11:03:09 +01:00
Benjamin Berg 45d7046f99 lib: Remove all deprecated API 2019-11-18 15:39:35 +01:00
Bastien Nocera 8a3a974ea3 lib: Add helper for NBIS copy-paste library
This will allow us to segragate helper functions that we want to use
within NBIS. The first helper will be a macro checking for overflow in
multiplications.
2018-12-13 15:48:25 +01:00
Bastien Nocera 451a4c0969 lib: Remove duplicated structs from fp_internal.h
They are already declared in fpi-core.h. Also move their API docs
to fpi-core.h.
2018-11-30 16:08:42 +01:00
Bastien Nocera 1d00c2d4b4 lib: Make 6 async reporting funcs private
As those aren't used in any driver.
2018-11-29 17:32:37 +01:00
Bastien Nocera 61483a4c47 lib: Make the fp_print_data structure private
And add a couple of helpers for the upekts driver to use.
2018-11-29 17:32:37 +01:00
Bastien Nocera 92e3168309 lib: Add documentation for fp_driver_type 2018-11-25 12:42:11 +00:00
Bastien Nocera ca148cbcf1 lib: Add documentation for usb_id 2018-11-25 12:42:11 +00:00
Bastien Nocera c273908471 lib: Tidy fp_internal.h
Group global variables, structure definitions, and functions, and
group functions by which C source they're defined in.

This also removes the FP_IMGDRV_SUPPORTS_UNCONDITIONAL_CAPTURE
definition that's already available in the drivers API-accessible
fpi-core.h
2018-09-28 15:12:39 +02:00
Bastien Nocera fb5527c58c lib: Split off imgdev functions
They now live in fpi-dev-img.[ch]
2018-09-28 15:12:39 +02:00
Bastien Nocera 1035f733aa lib: Split off async functions
And don't add the new fpi-async.h to the driver imports, it will only
be used by the upekts driver.
2018-09-28 15:12:39 +02:00
Bastien Nocera 2818d94010 lib: Split off fp_img helpers
And rename img.c to fpi-img.c, as well as pixman.c to fpi-img-pixman.c
2018-09-28 15:12:39 +02:00
Bastien Nocera ca06fae22e lib: Split off fpi_print_data helpers
And rename data.c to fpi-data.c
2018-09-28 15:12:39 +02:00
Bastien Nocera 948a67a51f lib: Add internal fpi_timeout_cancel_all_for_dev()
This will be used to disable all timeouts for a device that's about
to be closed, and freed.
2018-09-27 14:49:50 +02:00
Bastien Nocera cb8732b255 lib: Remove priv struct member in fp_driver
It's unused.
2018-09-15 01:18:14 +02:00
Bastien Nocera 058f91909d lib: Remove fp_img_dev->priv
And use the new instance data helper.
2018-09-15 01:12:18 +02:00
Bastien Nocera 4f75e63e25 lib: Remove fp_dev->priv
Not precise enough, and it was only used in upekts to get/set the
instance private struct and keep it around, so add a new, more precisely
defined field to fp_dev for that.
2018-09-15 01:12:18 +02:00
Bastien Nocera 2e50ff5e7c lib: Add some TODO items to fp_dev struct 2018-09-15 01:09:50 +02:00
Bastien Nocera 0b7477e72c lib: Use fp_dev to access USB device
Instead of having own own pointer in fp_img_dev
2018-09-15 01:09:50 +02:00
Bastien Nocera 161c3ccf1c lib: Link fp_dev to fp_img_dev and back
So it's easy to switch between the 2 structs, and remove fp_img_dev->dev
direct access, as well as fp_dev->priv "user data" usage.
2018-09-15 01:09:39 +02:00
Bastien Nocera 170da7fec1 lib: Move fp_dev definition and helpers to separate header 2018-09-15 01:09:39 +02:00
Bastien Nocera de5b4e7dcb lib: Split off logging helpers 2018-09-06 13:24:41 +02:00
Bastien Nocera efee7262b6 lib: Split off timeout helpers
And rename poll.c to fpi-poll.c
2018-09-05 17:15:20 +02:00
Bastien Nocera 5ae2ef5407 lib: Split off fpi_ssm functions
Rename drv.c to something more fitting to its contents, and move state
machine code to its own header.
2018-09-05 15:40:01 +02:00
Bastien Nocera 19e7b217c1 lib: Downgrade fp_err() to be non-fatal
Similarly to b1ac865abd, downgrade
fp_err() to be non-fatal. A number of drivers would spit out an error
when encountering this call, but not crash, carry on and most of the
time recover.

Make sure we don't assert in those cases.
2018-07-16 16:08:54 +02:00
Bastien Nocera b1ac865abd lib: Downgrade BUG* assertions to work-around crashes
BUG() and BUG_ON() didn't use to assert, but only print an error if
debugging was enabled. This was hiding a lot of state bugs in drivers,
and transforming those into assertions causes crashes.

Downgrade the assertion to only print a warning, and hope that those
eventually get fixed in the drivers so we can re-enable them.

Closes: #77
2018-07-03 11:40:25 +02:00
Bastien Nocera 2a4893d946 lib: fp_imgdev_*() functions are only used in drivers 2018-05-29 13:34:18 +02:00
Bastien Nocera cee061b363 lib: fpi_ssm_start_subsm() is only used in drivers 2018-05-29 13:34:18 +02:00
Bastien Nocera 1bbdf304ab lib: Remove never defined fpi_ssm_has_completed() 2018-05-29 13:34:18 +02:00
Bastien Nocera 6155068f9e lib: Split off some fp_img related functions
Some are internal, some are for drivers.
2018-05-29 13:34:18 +02:00
Bastien Nocera 475250ce71 lib: Split off some polling related functions 2018-05-29 13:34:18 +02:00
Bastien Nocera d15282bff1 lib: Remove minutiae utils from internal header
It's only used by drivers.
2018-05-29 13:34:18 +02:00
Bastien Nocera 933fab6ed4 lib: Remove array_n_elements() from internal header
It's unused.
2018-05-29 13:34:18 +02:00
Bastien Nocera 7e5661caff lib: Don't include assembling.h in internal header
It's not needed.
2018-05-29 13:34:18 +02:00
Bastien Nocera 0e351db91a lib: Fix new BUG_ON() implementation again
This time, the macro didn't wrap the condition, resulting in calls
like BUG_ON(size > 100) being expanded to g_assert(!size > 100), when
what we wanted was BUG_ON(!(size > 100)).

See 9cca501650,
ff09456cf5, and egg on my face.
2018-05-25 17:38:40 +02:00
Bastien Nocera 9cca501650 lib: Fix new BUG_ON() implementation
A thinko reversed the meaning of the BUG_ON() condition. This fixes
the inverted implementation in commit
ff09456cf5.
2018-05-25 16:12:29 +02:00
Bastien Nocera ff5de4ff03 lib: Replace open-coded array_n_elements()
Replace it with glib's version, which already exists.

https://bugs.freedesktop.org/show_bug.cgi?id=106280
2018-05-25 13:20:34 +02:00
Bastien Nocera 994061af44 drivers: Simplify headers
Remove all the headers already included through "fp_internal.h" such as
<libusb.h> and <errno.h>, include "assembling.h" and "driver_ids.h" there
as well to avoid doing it in (almost) every driver.
2018-05-24 17:02:15 +02:00
Bastien Nocera fc92f62136 build: Remove the need to modify sources for new drivers
Instead of having to modify both fp_internal.h to list each driver
definition structure, and core.c to add those drivers to arrays we
can loop over, generate both of those using meson.
2018-05-24 12:23:39 +02:00
Bastien Nocera ff09456cf5 lib: Use g_assert* to implement BUG() and BUG_ON() assertions 2018-05-23 19:14:33 +02:00
Bastien Nocera 32fcfde86b lib: Use GLib and libusb directly for debug output
Use GLib internally to output debug information, and tell about
libusb's LIBUSB_DEBUG envvar for libusb debug.

fp_set_debug() is now a no-op.

https://bugs.freedesktop.org/show_bug.cgi?id=106552
2018-05-23 19:13:08 +02:00
Bastien Nocera 8e6e23b8d0 build: Always enable debugging logging
We shouldn't need to specifically enable debug logging to get useful
data out of a compiled libfprint either, so always enable debugging
output. It will still be switched off at runtime, by default.
2018-05-23 19:11:02 +02:00
Bastien Nocera 63e5d56441 build: Always allow switching log level at runtime
There are no parts of libfprint that are so resource intensive that we'd
want to disable logging. This avoids (hopefully rare) cases where
compiled versions of libfprint are distributed with logging completely
disabled, and thus can't be debugged.
2018-05-23 19:10:58 +02:00
Bastien Nocera be68bacc94 lib: Merge two other async callback types
Merge fp_capture_cb and fp_verify_cb.

https://bugs.freedesktop.org/show_bug.cgi?id=106551
2018-05-23 15:18:34 +02:00
Bastien Nocera 317d7bc988 lib: Simplify fp_*_stop_cb callback definitions
They're all the same, so merge them into a single fp_operation_stop_cb.

https://bugs.freedesktop.org/show_bug.cgi?id=106551
2018-05-23 13:39:10 +02:00
Bastien Nocera 78b8602cf6 lib: Make fp_minutia an opaque structure
Nothing uses the elements of the structure, so make it opaque.
2018-05-23 13:39:10 +02:00
Bastien Nocera 83a0a7681b img: Make fpi_img_detect_minutiae() static
It's unused outside img.c, so mark it as static.
2018-05-23 13:39:10 +02:00
Bastien Nocera 3661d146a7 drivers: Remove UPEKE2 driver
The device is already handled by upektc_img driver, and its sources
still exist in git if needed.

https://bugs.freedesktop.org/show_bug.cgi?id=106514
2018-05-15 10:46:54 +02:00