summaryrefslogtreecommitdiffstats
path: root/private/crt32/mbstring/mbtoupr.c
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/crt32/mbstring/mbtoupr.c
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/crt32/mbstring/mbtoupr.c')
-rw-r--r--private/crt32/mbstring/mbtoupr.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/private/crt32/mbstring/mbtoupr.c b/private/crt32/mbstring/mbtoupr.c
new file mode 100644
index 000000000..515e7163b
--- /dev/null
+++ b/private/crt32/mbstring/mbtoupr.c
@@ -0,0 +1,72 @@
+/***
+*mbtoupr.c - Convert character to upper case (MBCS)
+*
+* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* Convert character to upper case (MBCS)
+*
+*Revision History:
+* 11-19-92 KRS Ported from 16-bit sources.
+* 08-20-93 CFW Change short params to int for 32-bit tree.
+*
+*******************************************************************************/
+
+#ifdef _MBCS
+#include <cruntime.h>
+#include <ctype.h>
+#include <mbdata.h>
+#include <mbctype.h>
+#include <mbstring.h>
+
+
+/***
+* _mbctoupper - Convert character to upper case (MBCS)
+*
+*Purpose:
+* If the given character is lower case, convert to upper case.
+* Handles MBCS chars correctly.
+*
+* Note: Use test against 0x00FF instead of _ISLEADBYTE
+* to ensure that we don't call SBCS routine with a two-byte
+* value.
+*
+*Entry:
+* unsigned int c = character to convert
+*
+*Exit:
+* Returns converted character
+*
+*Exceptions:
+*
+*******************************************************************************/
+
+unsigned int _CRTAPI1 _mbctoupper(
+ unsigned int c
+ )
+{
+
+#ifdef _MBCS_OS
+
+ if (c > 0x00FF)
+ return(c);
+ else
+ return((unsigned int)toupper((int)c));
+
+#else
+
+ if (c > 0x00FF) {
+
+ if ( (_mbascii) &&
+ ((c >= _MBLOWERLOW) && (c <= _MBLOWERHIGH))
+ )
+ c -= _MBCASEDIFF;
+ }
+
+ else
+ return((unsigned int)toupper((int)c));
+
+#endif
+
+}
+#endif /* _MBCS */