OpenVAS Scanner 23.32.3
strutils.c
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
6#include "strutils.h"
7
8#include "support.h"
9
10#include <glib.h>
11
21int
22str_match (const gchar *string, const gchar *pattern, int icase)
23{
24 gboolean res;
25 GPatternSpec *patt = NULL;
26
27 if (icase)
28 {
29 patt = g_pattern_spec_new (g_ascii_strdown (pattern, -1));
30 res = g_pattern_spec_match_string (patt, g_ascii_strdown (string, -1));
31 }
32 else
33 {
34 patt = g_pattern_spec_new (pattern);
35 res = g_pattern_spec_match_string (patt, string);
36 }
37 g_pattern_spec_free (patt);
38 return res;
39}
int str_match(const gchar *string, const gchar *pattern, int icase)
Matches a string against a pattern.
Definition strutils.c:22
Support macros for special platforms.