From 0fe15f9b9b2c15a4f164652801a1ef707767b726 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 2 Nov 2023 16:30:02 +0000 Subject: [PATCH] docs: Move the GChecksum SECTION Move it to the struct docs. Signed-off-by: Philip Withnall Helps: #3037 --- glib/gchecksum.c | 27 ++++++++++++++------------- glib/gchecksum.h | 10 ---------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/glib/gchecksum.c b/glib/gchecksum.c index fea7803cd..28de99d68 100644 --- a/glib/gchecksum.c +++ b/glib/gchecksum.c @@ -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 there’s 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) diff --git a/glib/gchecksum.h b/glib/gchecksum.h index e5c54e7c7..3dd84fd84 100644 --- a/glib/gchecksum.h +++ b/glib/gchecksum.h @@ -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