Commit 7ebf710d authored by Benjamin Berg's avatar Benjamin Berg

lib: Remove fp_handle_events API

The API is not needed anymore and all internal users have been removed.
parent b51b6f2d
Pipeline #43900 failed with stages
in 1 minute and 19 seconds
......@@ -6,8 +6,6 @@
LIBFPRINT_DEPRECATED
fp_init
fp_exit
fp_handle_events_timeout
fp_handle_events
</SECTION>
<SECTION>
......
......@@ -144,58 +144,6 @@ fpi_timeout_cancel(fpi_timeout *timeout)
g_source_destroy (timeout->source);
}
static gboolean
dummy_cb (gpointer user_data)
{
return G_SOURCE_REMOVE;
}
/**
* fp_handle_events_timeout:
* @timeout: Maximum timeout for this blocking function
*
* Handle any pending events. If a non-zero timeout is specified, the function
* will potentially block for the specified amount of time, although it may
* return sooner if events have been handled. The function acts as non-blocking
* for a zero timeout.
*
* Returns: 0 on success, non-zero on error.
*/
API_EXPORTED int fp_handle_events_timeout(struct timeval *timeout)
{
guint timeout_id;
if (timeout->tv_sec == 0 && timeout->tv_usec == 0) {
g_main_context_iteration (NULL, FALSE);
return 0;
}
/* Register a timeout on the mainloop and then run in blocking mode */
timeout_id = g_timeout_add (timeout->tv_sec * 1000 + timeout->tv_usec / 1000,
dummy_cb, NULL);
g_main_context_iteration (NULL, TRUE);
g_source_remove (timeout_id);
return 0;
}
/**
* fp_handle_events:
*
* Convenience function for calling fp_handle_events_timeout() with a sensible
* default timeout value of two seconds (subject to change if we decide another
* value is more sensible).
*
* Returns: 0 on success, non-zero on error.
*/
API_EXPORTED int fp_handle_events(void)
{
struct timeval tv;
tv.tv_sec = 2;
tv.tv_usec = 0;
return fp_handle_events_timeout(&tv);
}
typedef struct {
GSource source;
GSList *fds;
......
......@@ -279,11 +279,6 @@ struct fp_minutia **fp_img_get_minutiae(struct fp_img *img, int *nr_minutiae);
int fp_minutia_get_coords(struct fp_minutia *minutia, int *coord_x, int *coord_y);
void fp_img_free(struct fp_img *img);
/* Polling and timing */
int fp_handle_events_timeout(struct timeval *timeout);
int fp_handle_events(void);
/* Library */
int fp_init(void);
void fp_exit(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment