14ddd3274SArnaldo Carvalho de Melo #ifndef _TOOLS_LINUX_STRING_H_ 24ddd3274SArnaldo Carvalho de Melo #define _TOOLS_LINUX_STRING_H_ 34ddd3274SArnaldo Carvalho de Melo 44ddd3274SArnaldo Carvalho de Melo 54ddd3274SArnaldo Carvalho de Melo #include <linux/types.h> /* for size_t */ 64ddd3274SArnaldo Carvalho de Melo 74ddd3274SArnaldo Carvalho de Melo void *memdup(const void *src, size_t len); 84ddd3274SArnaldo Carvalho de Melo 97d85c434SWang Nan int strtobool(const char *s, bool *res); 107d85c434SWang Nan 110215d59bSVineet Gupta /* 120215d59bSVineet Gupta * glibc based builds needs the extern while uClibc doesn't. 130215d59bSVineet Gupta * However uClibc headers also define __GLIBC__ hence the hack below 140215d59bSVineet Gupta */ 150215d59bSVineet Gupta #if defined(__GLIBC__) && !defined(__UCLIBC__) 16ce990917SJosh Poimboeuf extern size_t strlcpy(char *dest, const char *src, size_t size); 17ce990917SJosh Poimboeuf #endif 18ce990917SJosh Poimboeuf 19c8b5f2c9SArnaldo Carvalho de Melo char *str_error_r(int errnum, char *buf, size_t buflen); 20c8b5f2c9SArnaldo Carvalho de Melo 2196395cbbSArnaldo Carvalho de Melo int prefixcmp(const char *str, const char *prefix); 2296395cbbSArnaldo Carvalho de Melo 234ddd3274SArnaldo Carvalho de Melo #endif /* _LINUX_STRING_H_ */ 24