Linux Perf
strfilter.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_STRFILTER_H
3 #define __PERF_STRFILTER_H
4 /* General purpose glob matching filter */
5 
6 #include <linux/list.h>
7 #include <stdbool.h>
8 
9 /* A node of string filter */
11  struct strfilter_node *l; /* Tree left branche (for &,|) */
12  struct strfilter_node *r; /* Tree right branche (for !,&,|) */
13  const char *p; /* Operator or rule */
14 };
15 
16 /* String filter */
17 struct strfilter {
19 };
20 
30 struct strfilter *strfilter__new(const char *rules, const char **err);
31 
42 int strfilter__or(struct strfilter *filter,
43  const char *rules, const char **err);
44 
55 int strfilter__and(struct strfilter *filter,
56  const char *rules, const char **err);
57 
65 bool strfilter__compare(struct strfilter *filter, const char *str);
66 
73 void strfilter__delete(struct strfilter *filter);
74 
82 char *strfilter__string(struct strfilter *filter);
83 
84 #endif
int strfilter__or(struct strfilter *filter, const char *rules, const char **err)
Definition: strfilter.c:206
int int err
Definition: 5sec.c:44
bool strfilter__compare(struct strfilter *filter, const char *str)
Definition: strfilter.c:238
struct strfilter_node * root
Definition: strfilter.h:18
void strfilter__delete(struct strfilter *filter)
Definition: strfilter.c:28
char * strfilter__string(struct strfilter *filter)
Definition: strfilter.c:297
static int str(yyscan_t scanner, int token)
struct strfilter_node * r
Definition: strfilter.h:12
struct strfilter_node * l
Definition: strfilter.h:11
struct strfilter * strfilter__new(const char *rules, const char **err)
Definition: strfilter.c:159
struct strfilter * filter
Definition: builtin-probe.c:60
int strfilter__and(struct strfilter *filter, const char *rules, const char **err)
Definition: strfilter.c:211
const char * p
Definition: strfilter.h:13