core: Clean up checksumming

Don't expose GChecksum in APIs.  Add a new stream class which allows
us to pass an input stream somewhere, but gather a checksum as it's
read.

Move some bits of the internals towards binary csums.
This commit is contained in:
Colin Walters committed 2012-04-11 22:04:06 -04:00
1 parent fa4cbc8b89
commit f15c184584
17 files changed
+605 -274

No files matched your search

+5 -5
View File
@@ -41,14 +41,14 @@ on_checksum_received (GObject *obj,
GAsyncResult *result,
gpointer user_data)
{
GChecksum *checksum = NULL;
ot_lfree guchar *csum = NULL;
ot_lfree char *checksum = NULL;
AsyncChecksumData *data = user_data;
if (ostree_checksum_file_async_finish ((GFile*)obj, result, &checksum, data->error))
if (ostree_checksum_file_async_finish ((GFile*)obj, result, &csum, data->error))
{
g_print ("%s\n", g_checksum_get_string (checksum));
ot_clear_checksum (&checksum);
checksum = ostree_checksum_from_bytes (csum);
g_print ("%s\n", checksum);
}
g_main_loop_quit (data->loop);