summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Makefile2
-rw-r--r--include/stdatomic.h2
-rw-r--r--include/uchar.h60
-rw-r--r--include/xlocale/Makefile2
-rw-r--r--include/xlocale/_uchar.h46
5 files changed, 108 insertions, 4 deletions
diff --git a/include/Makefile b/include/Makefile
index 1cd70aa..a6aaa64 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -23,7 +23,7 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
stdnoreturn.h stdio.h stdlib.h string.h stringlist.h \
strings.h sysexits.h tar.h termios.h tgmath.h \
time.h timeconv.h timers.h ttyent.h \
- ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h \
+ uchar.h ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h \
wchar.h wctype.h wordexp.h xlocale.h
.PATH: ${.CURDIR}/../contrib/libc-vis
diff --git a/include/stdatomic.h b/include/stdatomic.h
index 44f73b5..4d03bb9 100644
--- a/include/stdatomic.h
+++ b/include/stdatomic.h
@@ -145,10 +145,8 @@ typedef _Atomic(long) atomic_long;
typedef _Atomic(unsigned long) atomic_ulong;
typedef _Atomic(long long) atomic_llong;
typedef _Atomic(unsigned long long) atomic_ullong;
-#if 0
typedef _Atomic(__char16_t) atomic_char16_t;
typedef _Atomic(__char32_t) atomic_char32_t;
-#endif
typedef _Atomic(__wchar_t) atomic_wchar_t;
typedef _Atomic(__int_least8_t) atomic_int_least8_t;
typedef _Atomic(__uint_least8_t) atomic_uint_least8_t;
diff --git a/include/uchar.h b/include/uchar.h
new file mode 100644
index 0000000..34c919f
--- /dev/null
+++ b/include/uchar.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2013 Ed Schouten <ed@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _UCHAR_H_
+#define _UCHAR_H_
+
+#include <sys/cdefs.h>
+#include <sys/_types.h>
+
+#ifndef _MBSTATE_T_DECLARED
+typedef __mbstate_t mbstate_t;
+#define _MBSTATE_T_DECLARED
+#endif
+
+#ifndef _SIZE_T_DECLARED
+typedef __size_t size_t;
+#define _SIZE_T_DECLARED
+#endif
+
+typedef __char16_t char16_t;
+typedef __char32_t char32_t;
+
+__BEGIN_DECLS
+size_t c16rtomb(char * __restrict, char16_t, mbstate_t * __restrict);
+size_t c32rtomb(char * __restrict, char32_t, mbstate_t * __restrict);
+size_t mbrtoc16(char16_t * __restrict, const char * __restrict, size_t,
+ mbstate_t * __restrict);
+size_t mbrtoc32(char32_t * __restrict, const char * __restrict, size_t,
+ mbstate_t * __restrict);
+#if __BSD_VISIBLE || defined(_XLOCALE_H_)
+#include <xlocale/_uchar.h>
+#endif
+__END_DECLS
+
+#endif /* !_UCHAR_H_ */
diff --git a/include/xlocale/Makefile b/include/xlocale/Makefile
index e45ddca..a35db50 100644
--- a/include/xlocale/Makefile
+++ b/include/xlocale/Makefile
@@ -2,7 +2,7 @@
NO_OBJ=
INCS= _ctype.h _inttypes.h _langinfo.h _locale.h _monetary.h _stdio.h\
- _stdlib.h _string.h _time.h _wchar.h
+ _stdlib.h _string.h _time.h _uchar.h _wchar.h
INCSDIR=${INCLUDEDIR}/xlocale
.include <bsd.prog.mk>
diff --git a/include/xlocale/_uchar.h b/include/xlocale/_uchar.h
new file mode 100644
index 0000000..4256c87
--- /dev/null
+++ b/include/xlocale/_uchar.h
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2013 Ed Schouten <ed@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LOCALE_T_DEFINED
+#define _LOCALE_T_DEFINED
+typedef struct _xlocale *locale_t;
+#endif
+
+#ifndef _XLOCALE_UCHAR_H_
+#define _XLOCALE_UCHAR_H_
+
+size_t c16rtomb_l(char * __restrict, char16_t, mbstate_t * __restrict,
+ locale_t);
+size_t c32rtomb_l(char * __restrict, char32_t, mbstate_t * __restrict,
+ locale_t);
+size_t mbrtoc16_l(char16_t * __restrict, const char * __restrict, size_t,
+ mbstate_t * __restrict, locale_t);
+size_t mbrtoc32_l(char32_t * __restrict, const char * __restrict, size_t,
+ mbstate_t * __restrict, locale_t);
+
+#endif /* _XLOCALE_UCHAR_H_ */
OpenPOWER on IntegriCloud