docs: Move the GChecksum SECTION

Move it to the struct docs.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
This commit is contained in:
Philip Withnall 2023-11-02 16:30:02 +00:00
parent 9e95163a3c
commit 0fe15f9b9b
2 changed files with 14 additions and 23 deletions

View File

@ -33,25 +33,26 @@
/**
* SECTION:checksum
* @title: Data Checksums
* @short_description: computes the checksum for data
* GChecksum:
*
* GLib provides a generic API for computing checksums (or "digests")
* GLib provides a generic API for computing checksums (or digests)
* for a sequence of arbitrary bytes, using various hashing algorithms
* like MD5, SHA-1 and SHA-256. Checksums are commonly used in various
* environments and specifications.
*
* GLib supports incremental checksums using the GChecksum data
* structure, by calling g_checksum_update() as long as there's data
* available and then using g_checksum_get_string() or
* g_checksum_get_digest() to compute the checksum and return it either
* as a string in hexadecimal form, or as a raw sequence of bytes. To
* compute the checksum for binary blobs and NUL-terminated strings in
* one go, use the convenience functions g_compute_checksum_for_data()
* and g_compute_checksum_for_string(), respectively.
* To create a new `GChecksum`, use [ctor@GLib.Checksum.new]. To free
* a `GChecksum`, use [method@GLib.Checksum.free].
*
* Support for checksums has been added in GLib 2.16
* GLib supports incremental checksums using the `GChecksum` data
* structure, by calling [method@GLib.Checksum.update] as long as theres data
* available and then using [method@GLib.Checksum.get_string] or
* [method@GLib.Checksum.get_digest] to compute the checksum and return it
* either as a string in hexadecimal form, or as a raw sequence of bytes. To
* compute the checksum for binary blobs and nul-terminated strings in
* one go, use the convenience functions [func@GLib.compute_checksum_for_data]
* and [func@GLib.compute_checksum_for_string], respectively.
*
* Since: 2.16
**/
#define IS_VALID_TYPE(type) ((type) >= G_CHECKSUM_MD5 && (type) <= G_CHECKSUM_SHA384)

View File

@ -54,16 +54,6 @@ typedef enum {
G_CHECKSUM_SHA384
} GChecksumType;
/**
* GChecksum:
*
* An opaque structure representing a checksumming operation.
*
* To create a new GChecksum, use g_checksum_new(). To free
* a GChecksum, use g_checksum_free().
*
* Since: 2.16
*/
typedef struct _GChecksum GChecksum;
GLIB_AVAILABLE_IN_ALL