summaryrefslogtreecommitdiff
path: root/src/wctype/towupper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wctype/towupper.c')
-rw-r--r--src/wctype/towupper.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/wctype/towupper.c b/src/wctype/towupper.c
new file mode 100644
index 00000000..1310e109
--- /dev/null
+++ b/src/wctype/towupper.c
@@ -0,0 +1,32 @@
+#include <wctype.h>
+#include "wchar.h"
+#include "nonstd/assert.h"
+
+/** convert a wide lowercase letter to uppercase **/
+wint_t towupper(wint_t wc)
+{
+ ASSERT_REPRESENTABLE(wc, WCHAR_MIN, WCHAR_MAX, "wchar_t", WEOF);
+
+ if (!iswlower(wc)) {
+ return wc;
+ }
+
+ wctrans_t trans = wctrans("toupper");
+ return towctrans(wc, trans);
+}
+
+/***
+The fn(towupper) function converts a wide lowercase letter to its equivalent
+uppercase letter in the current locale.
+***/
+
+/* RETURN(arg(c)): arg(wc) was not a wide lowercase letter or it has no equivalent upercase letter */
+/* RETURN: arg(c) converted to uppercase */
+
+/* UNSPECIFIED: - */
+/* IMPLEMENTATION: - */
+/* LOCALE: LC_CTYPE */
+
+/*
+STDC(199409)
+*/