summaryrefslogtreecommitdiffstats
path: root/private/crt32/mbstring/mbsnextc.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/mbsnextc.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/mbsnextc.c')
-rw-r--r--private/crt32/mbstring/mbsnextc.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/private/crt32/mbstring/mbsnextc.c b/private/crt32/mbstring/mbsnextc.c
new file mode 100644
index 000000000..6ab8f9b12
--- /dev/null
+++ b/private/crt32/mbstring/mbsnextc.c
@@ -0,0 +1,50 @@
+/***
+*mbsnextc.c - Get the next character in an MBCS string.
+*
+* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* To return the value of the next character in an MBCS string.
+*
+*Revision History:
+* 11-19-92 KRS Ported from 16-bit sources.
+*
+*******************************************************************************/
+
+#ifdef _MBCS
+#include <cruntime.h>
+#include <mbdata.h>
+#include <mbctype.h>
+#include <mbstring.h>
+
+
+/***
+*_mbsnextc: Returns the next character in a string.
+*
+*Purpose:
+* To return the value of the next character in an MBCS string.
+* Does not advance pointer to the next character.
+*
+*Entry:
+* unsigned char *s = string
+*
+*Exit:
+* unsigned int next = next character.
+*
+*Exceptions:
+*
+*******************************************************************************/
+
+unsigned int _CRTAPI1 _mbsnextc(s)
+const unsigned char *s;
+{
+ unsigned int next = 0;
+
+ if (_ISLEADBYTE(*s))
+ next = ((unsigned int) *s++) << 8;
+
+ next += (unsigned int) *s;
+
+ return(next);
+}
+#endif /* _MBCS */