OpenVAS Scanner  22.7.9
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 
21 int
22 str_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 }
support.h
Support macros for special platforms.
strutils.h
str_match
int str_match(const gchar *string, const gchar *pattern, int icase)
Matches a string against a pattern.
Definition: strutils.c:22