From b26616c2f4bba3df866592ddd60720a3a2805a99 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 3 Sep 2015 18:59:14 +0200 Subject: add _l functions in ctype.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/ctype.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ctype.c b/src/ctype.c index 522a799..2c8fe83 100644 --- a/src/ctype.c +++ b/src/ctype.c @@ -224,7 +224,7 @@ int (toupper)(int c) * Check whether a character is an ASCII character. * * @param c The character - * @return - Whether the character is an ASCII character. + * @return Whether the character is an ASCII character. */ int (isascii)(int c) { @@ -238,8 +238,8 @@ int (isascii)(int c) * Note that this does not make a proper character set * convertion and the result is virtually arbitrary. * - * @param c The character. - * @param c The character with the 8:th bit cleared. + * @param c The character. + * @return The character with the 8:th bit cleared. */ int (toascii)(int c) { @@ -266,3 +266,29 @@ int _toupper(int c) return toupper(c); } + + +#define CTYPE_LOCALE(F) \ + int F##_l(int c, locale_t locale) \ + { \ + return F(c); \ + (void) locale; \ + } + +CTYPE_LOCALE(isalnum) +CTYPE_LOCALE(isalpha) +CTYPE_LOCALE(isblank) +CTYPE_LOCALE(iscntrl) +CTYPE_LOCALE(isdigit) +CTYPE_LOCALE(isgraph) +CTYPE_LOCALE(islower) +CTYPE_LOCALE(isprint) +CTYPE_LOCALE(ispunct) +CTYPE_LOCALE(isspace) +CTYPE_LOCALE(isupper) +CTYPE_LOCALE(isxdigit) +CTYPE_LOCALE(isascii) +CTYPE_LOCALE(toascii) +CTYPE_LOCALE(tolower) +CTYPE_LOCALE(toupper) + -- cgit v1.2.3-70-g09d2