lib: Add fpi_poll_is_setup() sanity check
This checks whether polling was correctly setup for integration with a mainloop.
This commit is contained in:
parent
a54d020c97
commit
97d0a6dfe6
2 changed files with 8 additions and 0 deletions
|
@ -482,6 +482,12 @@ void fpi_poll_exit(void)
|
||||||
libusb_set_pollfd_notifiers(fpi_usb_ctx, NULL, NULL, NULL);
|
libusb_set_pollfd_notifiers(fpi_usb_ctx, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
fpi_poll_is_setup(void)
|
||||||
|
{
|
||||||
|
return (fd_added_cb != NULL && fd_removed_cb != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fpi_timeout_cancel_all_for_dev(struct fp_dev *dev)
|
fpi_timeout_cancel_all_for_dev(struct fp_dev *dev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,4 +48,6 @@ void fpi_timeout_set_name(fpi_timeout *timeout,
|
||||||
const char *name);
|
const char *name);
|
||||||
void fpi_timeout_cancel(fpi_timeout *timeout);
|
void fpi_timeout_cancel(fpi_timeout *timeout);
|
||||||
|
|
||||||
|
gboolean fpi_poll_is_setup(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue