mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 23:20:05 +00:00
43cbcd8acb
The tools/perf/util/rbtree.c copy already drifted by three csets: 4b324126e0c6c3a5080ca3ec0981e8766ed6f1ee 4c60117811171d867d4f27f17ea07d7419d45dae 16c047add3ceaf0ab882e3e094d1ec904d02312d So remove the copy and use the lib/rbtree.c directly, sharing the source code while still generating a separate object file, since tools/perf uses a far more agressive -O6 switch. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20090701152837.GG15682@ghostprotocols.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
33 lines
769 B
C
33 lines
769 B
C
#ifndef STRLIST_H_
|
|
#define STRLIST_H_
|
|
|
|
#include <linux/rbtree.h>
|
|
#include <stdbool.h>
|
|
|
|
struct str_node {
|
|
struct rb_node rb_node;
|
|
const char *s;
|
|
};
|
|
|
|
struct strlist {
|
|
struct rb_root entries;
|
|
bool dupstr;
|
|
};
|
|
|
|
struct strlist *strlist__new(bool dupstr, const char *slist);
|
|
void strlist__delete(struct strlist *self);
|
|
|
|
void strlist__remove(struct strlist *self, struct str_node *sn);
|
|
int strlist__load(struct strlist *self, const char *filename);
|
|
int strlist__add(struct strlist *self, const char *str);
|
|
|
|
bool strlist__has_entry(struct strlist *self, const char *entry);
|
|
|
|
static inline bool strlist__empty(const struct strlist *self)
|
|
{
|
|
return rb_first(&self->entries) == NULL;
|
|
}
|
|
|
|
int strlist__parse_list(struct strlist *self, const char *s);
|
|
#endif /* STRLIST_H_ */
|