![Arnaldo Carvalho de Melo](/assets/img/avatar_default.png)
Both had copies originating from git.git, move those to tools/lib/string.c, getting both tools/lib/subcmd/ and tools/perf/ to use it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-uidwtticro1qhttzd2rkrkg1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
24 lines
591 B
C
24 lines
591 B
C
#ifndef _TOOLS_LINUX_STRING_H_
|
|
#define _TOOLS_LINUX_STRING_H_
|
|
|
|
|
|
#include <linux/types.h> /* for size_t */
|
|
|
|
void *memdup(const void *src, size_t len);
|
|
|
|
int strtobool(const char *s, bool *res);
|
|
|
|
/*
|
|
* glibc based builds needs the extern while uClibc doesn't.
|
|
* However uClibc headers also define __GLIBC__ hence the hack below
|
|
*/
|
|
#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
|
extern size_t strlcpy(char *dest, const char *src, size_t size);
|
|
#endif
|
|
|
|
char *str_error_r(int errnum, char *buf, size_t buflen);
|
|
|
|
int prefixcmp(const char *str, const char *prefix);
|
|
|
|
#endif /* _LINUX_STRING_H_ */
|