dutil: Adopt strstart() from the linux perf tools sources
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
3aa3fd506e
commit
a2cdc6c2a0
10
dutil.h
10
dutil.h
|
@ -291,6 +291,16 @@ static inline bool strlist__empty(const struct strlist *slist)
|
|||
return rb_first(&slist->entries) == NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* strstarts - does @str start with @prefix?
|
||||
* @str: string to examine
|
||||
* @prefix: prefix to look for.
|
||||
*/
|
||||
static inline bool strstarts(const char *str, const char *prefix)
|
||||
{
|
||||
return strncmp(str, prefix, strlen(prefix)) == 0;
|
||||
}
|
||||
|
||||
void *zalloc(const size_t size);
|
||||
|
||||
Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
|
||||
|
|
Loading…
Reference in New Issue