From 2d2263fa4f474f4ef195d52071e2b096607649b9 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 9 Nov 2023 00:06:57 +0000 Subject: [PATCH] girepository: Update docs for GITypelib for gi-docgen Move the SECTION into the struct docs, update the documentation comment syntax, and add `Since: 2.80` everywhere. Signed-off-by: Philip Withnall Helps: #3155 --- girepository/gitypelib.c | 42 ++++++++++++++++++++++++++++------------ girepository/gitypelib.h | 13 ------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/girepository/gitypelib.c b/girepository/gitypelib.c index b49b5cdf8..c4bd52901 100644 --- a/girepository/gitypelib.c +++ b/girepository/gitypelib.c @@ -32,6 +32,15 @@ #include "gitypelib-internal.h" #include "gitypelib.h" +/** + * GITypelib: + * + * `GITypelib` represents a loaded `.typelib` file, which contains a description + * of a single module’s API. + * + * Since: 2.80 + */ + typedef struct { GITypelib *typelib; GSList *context_stack; @@ -2373,11 +2382,13 @@ gi_typelib_ensure_open (GITypelib *typelib) * @len: length of memory chunk containing the typelib * @error: a #GError * - * Creates a new #GITypelib from a memory location. The memory block - * pointed to by @typelib will be automatically g_free()d when the + * Creates a new `GITypelib` from a memory location. + * + * The memory block pointed to by @typelib will be automatically freed when the * repository is destroyed. * * Returns: the new #GITypelib + * Since: 2.80 */ GITypelib * gi_typelib_new_from_memory (guint8 *memory, @@ -2402,11 +2413,12 @@ gi_typelib_new_from_memory (guint8 *memory, * gi_typelib_new_from_const_memory: (skip) * @memory: address of memory chunk containing the typelib * @len: length of memory chunk containing the typelib - * @error: A #GError + * @error: a #GError * - * Creates a new #GITypelib from a memory location. + * Creates a new `GITypelib` from a memory location. * * Returns: the new #GITypelib + * Since: 2.80 */ GITypelib * gi_typelib_new_from_const_memory (const guchar *memory, @@ -2429,12 +2441,14 @@ gi_typelib_new_from_const_memory (const guchar *memory, /** * gi_typelib_new_from_mapped_file: (skip) - * @mfile: a #GMappedFile, that will be free'd when the repository is destroyed + * @mfile: a [type@GLib.MappedFile], that will be freed when the repository is + * destroyed * @error: a #GError * - * Creates a new #GITypelib from a #GMappedFile. + * Creates a new `GITypelib` from a [type@GLib.MappedFile]. * * Returns: the new #GITypelib + * Since: 2.80 */ GITypelib * gi_typelib_new_from_mapped_file (GMappedFile *mfile, @@ -2460,7 +2474,9 @@ gi_typelib_new_from_mapped_file (GMappedFile *mfile, * gi_typelib_free: * @typelib: a #GITypelib * - * Free a #GITypelib. + * Free a `GITypelib`. + * + * Since: 2.80 */ void gi_typelib_free (GITypelib *typelib) @@ -2480,11 +2496,12 @@ gi_typelib_free (GITypelib *typelib) /** * gi_typelib_get_namespace: - * @typelib: TODO + * @typelib: a #GITypelib * - * TODO + * Get the name of the namespace represented by @typelib. * - * Returns: TODO + * Returns: name of the namespace represented by @typelib + * Since: 2.80 */ const gchar * gi_typelib_get_namespace (GITypelib *typelib) @@ -2498,9 +2515,10 @@ gi_typelib_get_namespace (GITypelib *typelib) * @symbol_name: name of symbol to be loaded * @symbol: returns a pointer to the symbol value * - * Loads a symbol from #GITypelib. + * Loads a symbol from a `GITypelib`. * - * Returns: #TRUE on success + * Returns: true on success + * Since: 2.80 */ gboolean gi_typelib_symbol (GITypelib *typelib, const char *symbol_name, gpointer *symbol) diff --git a/girepository/gitypelib.h b/girepository/gitypelib.h index ee647ec5c..0f965a062 100644 --- a/girepository/gitypelib.h +++ b/girepository/gitypelib.h @@ -34,19 +34,6 @@ G_BEGIN_DECLS -/** - * SECTION:gitypelib - * @title: GITypelib - * @short_description: TODO - * - * TODO - */ - -/** - * GITypelib: - * - * TODO - */ typedef struct _GITypelib GITypelib; GI_AVAILABLE_IN_ALL