summaryrefslogtreecommitdiff
path: root/lib/libc/hidden/ctype.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-09-05 03:16:15 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-09-05 03:16:15 +0000
commit9a429b0d2263bff179436e11aedd8607a30e445d (patch)
tree2e10dcca448d30a69a66b85e910591c02281a79d /lib/libc/hidden/ctype.h
parent5fa20654190f944a2de98b5be63bb85423ae44b2 (diff)
New POSIX xlocale implementation written from scratch.
Complete in the sense that all POSIX *locale(3) and *_l(3) functions are included, but in OpenBSD, we of course only really care about LC_CTYPE and we only support ASCII and UTF-8. With important help from kettenis@, guenther@, and jca@. Repeated testing in ports bulk builds by naddy@. Additional testing by jca@, sebastia@, dcoppa@, and others. OK kettenis@ dcoppa@, and guenther@ on an earlier version. Riding guenther@'s libc/librthread major bump.
Diffstat (limited to 'lib/libc/hidden/ctype.h')
-rw-r--r--lib/libc/hidden/ctype.h43
1 files changed, 39 insertions, 4 deletions
diff --git a/lib/libc/hidden/ctype.h b/lib/libc/hidden/ctype.h
index 36953d86355..7f42789a612 100644
--- a/lib/libc/hidden/ctype.h
+++ b/lib/libc/hidden/ctype.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctype.h,v 1.3 2016/09/06 19:56:36 guenther Exp $ */
+/* $OpenBSD: ctype.h,v 1.4 2017/09/05 03:16:13 schwarze Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
@@ -37,22 +37,57 @@ __only_inline int isascii(int _c);
__only_inline int toascii(int _c);
__only_inline int _tolower(int _c);
__only_inline int _toupper(int _c);
+
+#ifndef _LOCALE_T_DEFINED_
+#define _LOCALE_T_DEFINED_
+typedef void *locale_t;
+#endif
+
+__only_inline int isalnum_l(int _c, locale_t _l);
+__only_inline int isalpha_l(int _c, locale_t _l);
+__only_inline int iscntrl_l(int _c, locale_t _l);
+__only_inline int isdigit_l(int _c, locale_t _l);
+__only_inline int isgraph_l(int _c, locale_t _l);
+__only_inline int islower_l(int _c, locale_t _l);
+__only_inline int isprint_l(int _c, locale_t _l);
+__only_inline int ispunct_l(int _c, locale_t _l);
+__only_inline int isspace_l(int _c, locale_t _l);
+__only_inline int isupper_l(int _c, locale_t _l);
+__only_inline int isxdigit_l(int _c, locale_t _l);
+__only_inline int tolower_l(int _c, locale_t _l);
+__only_inline int toupper_l(int _c, locale_t _l);
+__only_inline int isblank_l(int _c, locale_t _l);
+
PROTO_NORMAL(isalnum);
+PROTO_DEPRECATED(isalnum_l);
PROTO_NORMAL(isalpha);
+PROTO_DEPRECATED(isalpha_l);
+PROTO_NORMAL(isascii);
+PROTO_NORMAL(isblank);
+PROTO_DEPRECATED(isblank_l);
PROTO_NORMAL(iscntrl);
+PROTO_DEPRECATED(iscntrl_l);
PROTO_NORMAL(isdigit);
+PROTO_DEPRECATED(isdigit_l);
PROTO_NORMAL(isgraph);
+PROTO_DEPRECATED(isgraph_l);
PROTO_NORMAL(islower);
+PROTO_DEPRECATED(islower_l);
PROTO_NORMAL(isprint);
+PROTO_DEPRECATED(isprint_l);
PROTO_NORMAL(ispunct);
+PROTO_DEPRECATED(ispunct_l);
PROTO_NORMAL(isspace);
+PROTO_DEPRECATED(isspace_l);
PROTO_NORMAL(isupper);
+PROTO_DEPRECATED(isupper_l);
PROTO_NORMAL(isxdigit);
+PROTO_DEPRECATED(isxdigit_l);
+PROTO_DEPRECATED(toascii);
PROTO_NORMAL(tolower);
+PROTO_DEPRECATED(tolower_l);
PROTO_NORMAL(toupper);
-PROTO_NORMAL(isblank);
-PROTO_NORMAL(isascii);
-PROTO_DEPRECATED(toascii);
+PROTO_DEPRECATED(toupper_l);
PROTO_STD_DEPRECATED(_tolower);
PROTO_STD_DEPRECATED(_toupper);