From 5f45ab0bb19d0482506797dc3daf739cd74f11a7 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 28 Mar 2017 22:42:26 -0400 Subject: [PATCH] libutil: Delete some unused checksum helper API This code was last used in 9618232f4da325692dcf98fd6ff5b8abd9fce66c which is sooo old and outdated. Delete. Closes: #767 Approved by: jlebon --- src/libotutil/ot-checksum-utils.c | 43 ------------------------------- src/libotutil/ot-checksum-utils.h | 10 ------- 2 files changed, 53 deletions(-) diff --git a/src/libotutil/ot-checksum-utils.c b/src/libotutil/ot-checksum-utils.c index 4b5c824a..39417044 100644 --- a/src/libotutil/ot-checksum-utils.c +++ b/src/libotutil/ot-checksum-utils.c @@ -180,46 +180,3 @@ ot_checksum_file_at (int dfd, return ret; } - -static void -checksum_stream_thread (GSimpleAsyncResult *result, - GObject *object, - GCancellable *cancellable) -{ - GError *error = NULL; - guchar *csum; - - if (!ot_gio_checksum_stream ((GInputStream*)object, &csum, - cancellable, &error)) - g_simple_async_result_take_error (result, error); - else - g_simple_async_result_set_op_res_gpointer (result, csum, g_free); -} - -void -ot_gio_checksum_stream_async (GInputStream *in, - int io_priority, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - GSimpleAsyncResult *result; - - result = g_simple_async_result_new ((GObject*) in, - callback, user_data, - ot_gio_checksum_stream_async); - - g_simple_async_result_run_in_thread (result, checksum_stream_thread, io_priority, cancellable); - g_object_unref (result); -} - -guchar * -ot_gio_checksum_stream_finish (GInputStream *in, - GAsyncResult *result, - GError **error) -{ - GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); - - g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == ot_gio_checksum_stream_async); - return g_memdup (g_simple_async_result_get_op_res_gpointer (simple), 32); -} diff --git a/src/libotutil/ot-checksum-utils.h b/src/libotutil/ot-checksum-utils.h index b580fc1c..fdf7b09b 100644 --- a/src/libotutil/ot-checksum-utils.h +++ b/src/libotutil/ot-checksum-utils.h @@ -61,14 +61,4 @@ char * ot_checksum_file_at (int dfd, GCancellable *cancellable, GError **error); -void ot_gio_checksum_stream_async (GInputStream *in, - int io_priority, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); - -guchar * ot_gio_checksum_stream_finish (GInputStream *in, - GAsyncResult *result, - GError **error); - G_END_DECLS