]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - tools/perf/util/strlist.h
perf report: Add --dsos parameter
[mirror_ubuntu-focal-kernel.git] / tools / perf / util / strlist.h
CommitLineData
25903407
ACM
1#ifndef STRLIST_H_
2#define STRLIST_H_
3
4#include "rbtree.h"
5#include <stdbool.h>
6
7struct str_node {
8 struct rb_node rb_node;
9 const char *s;
10};
11
12struct strlist {
13 struct rb_root entries;
14 bool dupstr;
15};
16
17struct strlist *strlist__new(bool dupstr, const char *slist);
18void strlist__delete(struct strlist *self);
19
20void strlist__remove(struct strlist *self, struct str_node *sn);
21int strlist__load(struct strlist *self, const char *filename);
22int strlist__add(struct strlist *self, const char *str);
23
24bool strlist__has_entry(struct strlist *self, const char *entry);
25
26static inline bool strlist__empty(const struct strlist *self)
27{
28 return rb_first(&self->entries) == NULL;
29}
30
31int strlist__parse_list(struct strlist *self, const char *s);
32#endif /* STRLIST_H_ */