From 614da5b9e2939602806d1956bbec1af1e54a948a Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 13 Dec 2023 00:26:56 +0000 Subject: [PATCH] giconstantinfo: Port documentation to gi-docgen and update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review and update the documentation, making sure it’s complete, formatted in gi-docgen format, and has all appropriate GIR annotations and `Since:` lines. Signed-off-by: Philip Withnall Helps: #3155 --- girepository/giconstantinfo.c | 40 ++++++++++++++++++++--------------- girepository/giconstantinfo.h | 6 ++++-- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/girepository/giconstantinfo.c b/girepository/giconstantinfo.c index e08455809..1383e73a5 100644 --- a/girepository/giconstantinfo.c +++ b/girepository/giconstantinfo.c @@ -34,26 +34,26 @@ #include "giconstantinfo.h" /** - * SECTION:giconstantinfo - * @title: GIConstantInfo - * @short_description: Struct representing a constant + * GIConstantInfo: * - * GIConstantInfo represents a constant. + * `GIConstantInfo` represents a constant. * - * A constant has a type associated which can be obtained by calling - * gi_constant_info_get_type_info() and a value, which can be obtained by - * calling gi_constant_info_get_value(). + * A constant has a type associated – which can be obtained by calling + * [method@GIRepository.ConstantInfo.get_type_info] – and a value – which can be + * obtained by calling [method@GIRepository.ConstantInfo.get_value]. + * + * Since: 2.80 */ - /** * gi_constant_info_get_type_info: * @info: a #GIConstantInfo * - * Obtain the type of the constant as a #GITypeInfo. + * Obtain the type of the constant as a [class@GIRepository.TypeInfo]. * - * Returns: (transfer full): the #GITypeInfo. Free the struct by calling - * gi_base_info_unref() when done. + * Returns: (transfer full): The [class@GIRepository.TypeInfo]. Free the struct + * by calling [method@GIRepository.BaseInfo.unref] when done. + * Since: 2.80 */ GITypeInfo * gi_constant_info_get_type_info (GIConstantInfo *info) @@ -74,7 +74,7 @@ gi_constant_info_get_type_info (GIConstantInfo *info) * @info: a #GIConstantInfo * @value: the argument * - * Free the value returned from gi_constant_info_get_value(). + * Free the value returned from [method@GIRepository.ConstantInfo.get_value]. * * Since: 2.80 */ @@ -101,14 +101,20 @@ gi_constant_info_free_value (GIConstantInfo *info, /** * gi_constant_info_get_value: (skip) * @info: a #GIConstantInfo - * @value: (out): an argument + * @value: (out caller-allocates): an argument * - * Obtain the value associated with the #GIConstantInfo and store it in the - * @value parameter. @argument needs to be allocated before passing it in. - * The size of the constant value stored in @argument will be returned. - * Free the value with gi_constant_info_free_value(). + * Obtain the value associated with the `GIConstantInfo` and store it in the + * @value parameter. + * + * @argument needs to be allocated before passing it in. + * + * The size of the constant value (in bytes) stored in @argument will be + * returned. + * + * Free the value with [method@GIRepository.ConstantInfo.free_value]. * * Returns: size of the constant, in bytes + * Since: 2.80 */ gsize gi_constant_info_get_value (GIConstantInfo *info, diff --git a/girepository/giconstantinfo.h b/girepository/giconstantinfo.h index 4b4b882a2..c28c5ddbf 100644 --- a/girepository/giconstantinfo.h +++ b/girepository/giconstantinfo.h @@ -33,10 +33,12 @@ G_BEGIN_DECLS /** - * GI_IS_CONSTANT_INFO + * GI_IS_CONSTANT_INFO: * @info: an info structure * - * Checks if @info is a #GIConstantInfo. + * Checks if @info is a [class@GIRepository.ConstantInfo]. + * + * Since: 2.80 */ #define GI_IS_CONSTANT_INFO(info) \ (gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_CONSTANT)