Make GChecksum more fully introspectable

In 2.34, g_compute_checksum_for_bytes() was added, but this patch
allows binding users to use the incremental update API; this is
significantly more efficient than reading entire files into memory.

https://bugzilla.gnome.org/show_bug.cgi?id=689982
This commit is contained in:
Colin Walters
2012-12-10 10:50:30 -05:00
parent afdb2abb13
commit bf1e63c2aa
3 changed files with 16 additions and 4 deletions

View File

@@ -1424,7 +1424,7 @@ g_checksum_type_get_length (GChecksumType checksum_type)
* will be closed and it won't be possible to call g_checksum_update()
* on it anymore.
*
* Return value: the newly created #GChecksum, or %NULL.
* Return value: (transfer full): the newly created #GChecksum, or %NULL.
* Use g_checksum_free() to free the memory allocated by it.
*
* Since: 2.16
@@ -1531,7 +1531,7 @@ g_checksum_free (GChecksum *checksum)
/**
* g_checksum_update:
* @checksum: a #GChecksum
* @data: buffer used to compute the checksum
* @data: (array length=length) (element-type guint8): buffer used to compute the checksum
* @length: size of the buffer, or -1 if it is a null-terminated string.
*
* Feeds @data into an existing #GChecksum. The checksum must still be
@@ -1635,7 +1635,7 @@ g_checksum_get_string (GChecksum *checksum)
}
/**
* g_checksum_get_digest:
* g_checksum_get_digest: (skip)
* @checksum: a #GChecksum
* @buffer: output buffer
* @digest_len: an inout parameter. The caller initializes it to the size of @buffer.
@@ -1713,7 +1713,7 @@ g_checksum_get_digest (GChecksum *checksum,
/**
* g_compute_checksum_for_data:
* @checksum_type: a #GChecksumType
* @data: binary blob to compute the digest of
* @data: (array length=length) (element-type guint8): binary blob to compute the digest of
* @length: length of @data
*
* Computes the checksum for a binary @data of @length. This is a