summaryrefslogtreecommitdiffstats
path: root/include/wctype.h
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-09-05 03:16:13 +0000
committerschwarze <schwarze@openbsd.org>2017-09-05 03:16:13 +0000
commit3a628b46e7aaa520a6215eccabf31d313c2e7de0 (patch)
treec6543ac3a194244f09c381abe688fa69e6c8d49a /include/wctype.h
parentAdd additional errno values required by POSIX. (diff)
downloadwireguard-openbsd-3a628b46e7aaa520a6215eccabf31d313c2e7de0.tar.xz
wireguard-openbsd-3a628b46e7aaa520a6215eccabf31d313c2e7de0.zip
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 'include/wctype.h')
-rw-r--r--include/wctype.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/include/wctype.h b/include/wctype.h
index 5d4e55738e5..bf61d255779 100644
--- a/include/wctype.h
+++ b/include/wctype.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wctype.h,v 1.5 2006/01/06 18:53:04 millert Exp $ */
+/* $OpenBSD: wctype.h,v 1.6 2017/09/05 03:16:13 schwarze Exp $ */
/* $NetBSD: wctype.h,v 1.5 2003/03/02 22:18:11 tshiozak Exp $ */
/*-
@@ -54,6 +54,13 @@ typedef __wctype_t wctype_t;
#define WEOF ((wint_t)-1)
#endif
+#if __POSIX_VISIBLE >= 200809
+#ifndef _LOCALE_T_DEFINED_
+#define _LOCALE_T_DEFINED_
+typedef void *locale_t;
+#endif
+#endif
+
__BEGIN_DECLS
int iswalnum(wint_t);
int iswalpha(wint_t);
@@ -73,6 +80,28 @@ wint_t towlower(wint_t);
wint_t towupper(wint_t);
wctrans_t wctrans(const char *);
wctype_t wctype(const char *);
+
+#if __POSIX_VISIBLE >= 200809
+int iswalnum_l(wint_t, locale_t);
+int iswalpha_l(wint_t, locale_t);
+int iswblank_l(wint_t, locale_t);
+int iswcntrl_l(wint_t, locale_t);
+int iswdigit_l(wint_t, locale_t);
+int iswgraph_l(wint_t, locale_t);
+int iswlower_l(wint_t, locale_t);
+int iswprint_l(wint_t, locale_t);
+int iswpunct_l(wint_t, locale_t);
+int iswspace_l(wint_t, locale_t);
+int iswupper_l(wint_t, locale_t);
+int iswxdigit_l(wint_t, locale_t);
+int iswctype_l(wint_t, wctype_t, locale_t);
+wint_t towctrans_l(wint_t, wctrans_t, locale_t);
+wint_t towlower_l(wint_t, locale_t);
+wint_t towupper_l(wint_t, locale_t);
+wctrans_t wctrans_l(const char *, locale_t);
+wctype_t wctype_l(const char *, locale_t);
+#endif
+
__END_DECLS
#endif /* _WCTYPE_H_ */