summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-05-16 22:32:44 +0000
committerobrien <obrien@FreeBSD.org>2001-05-16 22:32:44 +0000
commit89ba5881e53f6b82743a1e5ea6f9db8ad458997c (patch)
treecae039e1a2c56a600baa436c6d3915971799b673 /sys
parent9e804492abbf2ff2087fc952f4b0b98a6e3f8ba7 (diff)
downloadFreeBSD-src-89ba5881e53f6b82743a1e5ea6f9db8ad458997c.zip
FreeBSD-src-89ba5881e53f6b82743a1e5ea6f9db8ad458997c.tar.gz
Consistently define the rune types.
Follow NetBSD's lead and add a _BSD_MBSTATE_T_ type.
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/include/ansi.h21
-rw-r--r--sys/arm/include/ansi.h21
-rw-r--r--sys/i386/include/ansi.h20
-rw-r--r--sys/ia64/include/ansi.h23
-rw-r--r--sys/powerpc/include/ansi.h18
5 files changed, 86 insertions, 17 deletions
diff --git a/sys/alpha/include/ansi.h b/sys/alpha/include/ansi.h
index f6de9f7..b6a842d 100644
--- a/sys/alpha/include/ansi.h
+++ b/sys/alpha/include/ansi.h
@@ -94,11 +94,13 @@ typedef struct {
* one (perhaps nonstandard) header are defined here. Standard headers
* use _BSD_XXX_T_ without undef'ing it.
*/
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
#define _BSD_OFF_T_ long /* file offset */
#define _BSD_PID_T_ int /* process [group] */
/*
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t.
+ *
* Runes (wchar_t) is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
@@ -112,9 +114,20 @@ typedef struct {
* and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
* defined for ctype.h.
*/
-#define _BSD_WCHAR_T_ int /* wchar_t */
-#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_RUNE_T_ int /* rune_t */
+#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
+#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t */
+#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t */
+#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t */
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+ } __mbstate_t;
+#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
/*
* Frequencies of the clock ticks reported by clock() and times(). They
diff --git a/sys/arm/include/ansi.h b/sys/arm/include/ansi.h
index deac37c..24c3ee4 100644
--- a/sys/arm/include/ansi.h
+++ b/sys/arm/include/ansi.h
@@ -88,11 +88,13 @@ typedef unsigned int __uintptr_t;
* one (perhaps nonstandard) header are defined here. Standard headers
* use _BSD_XXX_T_ without undef'ing it.
*/
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
#define _BSD_OFF_T_ __int64_t /* file offset */
#define _BSD_PID_T_ int /* process [group] */
/*
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t.
+ *
* Runes (wchar_t) is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
@@ -106,9 +108,20 @@ typedef unsigned int __uintptr_t;
* and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
* defined for ctype.h.
*/
-#define _BSD_WCHAR_T_ int /* wchar_t */
-#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_RUNE_T_ int /* rune_t */
+#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
+#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t */
+#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t */
+#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t */
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+ } __mbstate_t;
+#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
/*
* Frequencies of the clock ticks reported by clock() and times(). They
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h
index b9b62da..8f41b26 100644
--- a/sys/i386/include/ansi.h
+++ b/sys/i386/include/ansi.h
@@ -93,12 +93,14 @@ typedef unsigned int __uintptr_t;
* one (perhaps nonstandard) header are defined here. Standard headers
* use _BSD_XXX_T_ without undef'ing it.
*/
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
#define _BSD_OFF_T_ __int64_t /* file offset */
#define _BSD_PID_T_ int /* process [group] */
#define _BSD_VA_LIST_ char * /* va_list */
/*
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t.
+ *
* The rune type is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
@@ -108,7 +110,23 @@ typedef unsigned int __uintptr_t;
* ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
* here, you lose a bit of ANSI conformance, but your programs will still
* work.
+ *
+ * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.
+ */
+#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
+#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t */
+#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t */
+#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t */
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
*/
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+ } __mbstate_t;
+#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
/*
* Frequencies of the clock ticks reported by clock() and times(). They
diff --git a/sys/ia64/include/ansi.h b/sys/ia64/include/ansi.h
index 622e8bb..5151df5 100644
--- a/sys/ia64/include/ansi.h
+++ b/sys/ia64/include/ansi.h
@@ -84,11 +84,13 @@ typedef unsigned long __uintptr_t;
* one (perhaps nonstandard) header are defined here. Standard headers
* use _BSD_XXX_T_ without undef'ing it.
*/
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
#define _BSD_OFF_T_ long /* file offset */
#define _BSD_PID_T_ int /* process [group] */
/*
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t.
+ *
* Runes (wchar_t) is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
@@ -101,10 +103,23 @@ typedef unsigned long __uintptr_t;
* Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t
* and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
* defined for ctype.h.
+ *
+ * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.
+ */
+#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
+#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t */
+#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t */
+#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t */
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
*/
-#define _BSD_WCHAR_T_ int /* wchar_t */
-#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_RUNE_T_ int /* rune_t */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+ } __mbstate_t;
+#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
/*
* Frequencies of the clock ticks reported by clock() and times(). They
diff --git a/sys/powerpc/include/ansi.h b/sys/powerpc/include/ansi.h
index 3f2ddc7..f5b8507 100644
--- a/sys/powerpc/include/ansi.h
+++ b/sys/powerpc/include/ansi.h
@@ -95,7 +95,6 @@ typedef struct {
* one (perhaps nonstandard) header are defined here. Standard headers
* use _BSD_XXX_T_ without undef'ing it.
*/
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
#define _BSD_OFF_T_ __int64_t /* file offset */
#define _BSD_PID_T_ int /* process [group] */
@@ -113,9 +112,20 @@ typedef struct {
* and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
* defined for ctype.h.
*/
-#define _BSD_WCHAR_T_ int /* wchar_t */
-#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_RUNE_T_ int /* rune_t */
+#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
+#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t */
+#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t */
+#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t */
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+ } __mbstate_t;
+#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
/*
* Frequencies of the clock ticks reported by clock() and times(). They
OpenPOWER on IntegriCloud