From ccfedf08cbbffc5588c1c25d0d889dd7389b3f6e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 25 Sep 2023 08:26:37 -0400 Subject: [PATCH] docs: Move the GPatternSpec SECTION Move the contents to the struct docs. Helps: #3037 --- glib/gpattern.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/glib/gpattern.c b/glib/gpattern.c index 09bdd5ad9..b0045059c 100644 --- a/glib/gpattern.c +++ b/glib/gpattern.c @@ -31,32 +31,24 @@ #include "gutils.h" /** - * SECTION:patterns - * @title: Glob-style pattern matching - * @short_description: matches strings against patterns containing '*' - * (wildcard) and '?' (joker) + * GPatternSpec: * - * The g_pattern_match* functions match a string - * against a pattern containing '*' and '?' wildcards with similar - * semantics as the standard glob() function: '*' matches an arbitrary, + * A `GPatternSpec` struct is the 'compiled' form of a glob-style pattern. + * + * The [func@g_pattern_match_simple] and [method@GLib.PatternSpec.match] functions + * match a string against a pattern containing '*' and '?' wildcards with similar + * semantics as the standard `glob()` function: '*' matches an arbitrary, * possibly empty, string, '?' matches an arbitrary character. * - * Note that in contrast to glob(), the '/' character can be matched by + * Note that in contrast to `glob()`, the '/' character can be matched by * the wildcards, there are no '[...]' character ranges and '*' and '?' * can not be escaped to include them literally in a pattern. * - * When multiple strings must be matched against the same pattern, it - * is better to compile the pattern to a #GPatternSpec using - * g_pattern_spec_new() and use g_pattern_match_string() instead of - * g_pattern_match_simple(). This avoids the overhead of repeated + * When multiple strings must be matched against the same pattern, it is better + * to compile the pattern to a [struct@GLib.PatternSpec] using + * [method@GLib.PatternSpec.new] and use [method@GLib.PatternSpec.match_string] + * instead of [func@g_pattern_match_simple]. This avoids the overhead of repeated * pattern compilation. - **/ - -/** - * GPatternSpec: - * - * A GPatternSpec struct is the 'compiled' form of a pattern. This - * structure is opaque and its fields cannot be accessed directly. */ /* keep enum and structure of gpattern.c and patterntest.c in sync */