diff options
author | Elliott Hughes <enh@google.com> | 2014-11-06 15:04:08 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-11-06 15:52:22 -0800 |
commit | b20c24456e43df430ec5626a68e5dc0dc6929344 (patch) | |
tree | c9b85b4d913f8f2738bdc8772b9b9a21d6ab51dc /libc/include | |
parent | 08a70184b42ef2963794a56233b0253e0b367253 (diff) | |
download | bionic-b20c24456e43df430ec5626a68e5dc0dc6929344.zip bionic-b20c24456e43df430ec5626a68e5dc0dc6929344.tar.gz bionic-b20c24456e43df430ec5626a68e5dc0dc6929344.tar.bz2 |
Implement all the POSIX _l functions.
Strictly speaking, this only implements the _l variants of the functions
we actually have. We're still missing nl_langinfo_l, for example, but we
don't have nl_langinfo either.
Change-Id: Ie711c7b04e7b9100932a13f5a5d5b28847eb4c12
Diffstat (limited to 'libc/include')
-rw-r--r-- | libc/include/string.h | 8 | ||||
-rw-r--r-- | libc/include/strings.h | 15 | ||||
-rw-r--r-- | libc/include/wchar.h | 3 |
3 files changed, 17 insertions, 9 deletions
diff --git a/libc/include/string.h b/libc/include/string.h index 611c31a..f0bed10 100644 --- a/libc/include/string.h +++ b/libc/include/string.h @@ -58,8 +58,11 @@ extern char* stpcpy(char* __restrict, const char* __restrict); extern char* strcpy(char* __restrict, const char* __restrict); extern char* strcat(char* __restrict, const char* __restrict); -extern int strcasecmp(const char *, const char *) __purefunc; -extern int strncasecmp(const char *, const char *, size_t) __purefunc; +int strcasecmp(const char*, const char*) __purefunc; +int strcasecmp_l(const char*, const char*, locale_t) __purefunc; +int strncasecmp(const char*, const char*, size_t) __purefunc; +int strncasecmp_l(const char*, const char*, size_t, locale_t) __purefunc; + extern char* strdup(const char *); extern char* strstr(const char *, const char *) __purefunc; @@ -68,6 +71,7 @@ extern char* strtok(char* __restrict, const char* __restrict); extern char* strtok_r(char* __restrict, const char* __restrict, char** __restrict); extern char* strerror(int); +extern char* strerror_l(int, locale_t); #if defined(__USE_GNU) extern char* strerror_r(int, char*, size_t) __RENAME(__gnu_strerror_r); #else /* POSIX */ diff --git a/libc/include/strings.h b/libc/include/strings.h index ae261cf..1253006 100644 --- a/libc/include/strings.h +++ b/libc/include/strings.h @@ -41,22 +41,23 @@ #include <sys/types.h> #include <sys/cdefs.h> +#include <xlocale.h> __BEGIN_DECLS #if defined(__BIONIC_FORTIFY) -#define bcopy(b1, b2, len) \ - (void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2))) -#define bzero(b, len) \ - (void)(__builtin___memset_chk((b), '\0', (len), __bos0(b))) +#define bcopy(b1, b2, len) (void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2))) +#define bzero(b, len) (void)(__builtin___memset_chk((b), '\0', (len), __bos0(b))) #else #define bcopy(b1, b2, len) (void)(__builtin_memmove((b2), (b1), (len))) #define bzero(b, len) (void)(__builtin_memset((b), '\0', (len))) #endif +int ffs(int); -int ffs(int); -int strcasecmp(const char *, const char *); -int strncasecmp(const char *, const char *, size_t); +int strcasecmp(const char*, const char*) __purefunc; +int strcasecmp_l(const char*, const char*, locale_t) __purefunc; +int strncasecmp(const char*, const char*, size_t) __purefunc; +int strncasecmp_l(const char*, const char*, size_t, locale_t) __purefunc; __END_DECLS diff --git a/libc/include/wchar.h b/libc/include/wchar.h index 10a78b8..9e279d3 100644 --- a/libc/include/wchar.h +++ b/libc/include/wchar.h @@ -34,6 +34,7 @@ #include <stdarg.h> #include <stddef.h> #include <time.h> +#include <xlocale.h> #include <machine/wchar_limits.h> @@ -112,6 +113,7 @@ extern int vwprintf(const wchar_t*, va_list); extern int vwscanf(const wchar_t*, va_list); extern size_t wcrtomb(char *, wchar_t, mbstate_t *); extern int wcscasecmp(const wchar_t *, const wchar_t *); +extern int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t); extern wchar_t *wcscat(wchar_t *, const wchar_t *); extern wchar_t *wcschr(const wchar_t *, wchar_t); extern int wcscmp(const wchar_t *, const wchar_t *); @@ -121,6 +123,7 @@ extern size_t wcscspn(const wchar_t *, const wchar_t *); extern size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *) __LIBC_ABI_PUBLIC__; extern size_t wcslen(const wchar_t *); extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); +extern int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t); extern wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t); extern int wcsncmp(const wchar_t *, const wchar_t *, size_t); extern wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t); |