aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/regex.h
blob: 1ba4fe3834f930b5d096c7fe44c6a88c54146588 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/** @file
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef __WSUTIL_REGEX_H__
#define __WSUTIL_REGEX_H__

#include <wireshark.h>

#ifdef __cplusplus
extern "C" {
#endif

struct _ws_regex;
typedef struct _ws_regex ws_regex_t;

WS_DLL_PUBLIC ws_regex_t *
ws_regex_compile(const char *patt, char **errmsg);

WS_DLL_PUBLIC bool
ws_regex_matches(const ws_regex_t *re, const char *subj, ssize_t subj_size);

WS_DLL_PUBLIC void
ws_regex_free(ws_regex_t *re);

WS_DLL_PUBLIC const char *
ws_regex_pattern(const ws_regex_t *re);

#ifdef __cplusplus
}
#endif

#endif /* __WSUTIL_REGEX_H__ */