string.h 538 字节
Newer Older
1 2 3 4 5 6 7 8
#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);

9 10
int strtobool(const char *s, bool *res);

11 12 13 14 15
/*
 * 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__)
16 17 18
extern size_t strlcpy(char *dest, const char *src, size_t size);
#endif

19 20
char *str_error_r(int errnum, char *buf, size_t buflen);

21
#endif /* _LINUX_STRING_H_ */