summaryrefslogtreecommitdiffstats
path: root/private/crt32/mbstring/ismbdgt.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/ismbdgt.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/ismbdgt.c')
-rw-r--r--private/crt32/mbstring/ismbdgt.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/private/crt32/mbstring/ismbdgt.c b/private/crt32/mbstring/ismbdgt.c
new file mode 100644
index 000000000..e5733261e
--- /dev/null
+++ b/private/crt32/mbstring/ismbdgt.c
@@ -0,0 +1,60 @@
+/***
+*ismbdgt.c - Test if character is a digit (MBCS)
+*
+* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* Test if character is a digit (MBCS)
+*
+*Revision History:
+* 11-19-92 KRS Ported from 16-bit sources.
+*
+*******************************************************************************/
+
+#ifdef _MBCS
+#include <cruntime.h>
+#include <ctype.h>
+#include <mbdata.h>
+#include <mbctype.h>
+#include <mbstring.h>
+
+/***
+* _ismbcdigit - Test if character is a digit (MBCS)
+*
+*Purpose:
+* Tests the character to see if it is a digit.
+* 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 test
+*
+*Exit:
+* Returns TRUE if character is a digit, else FALSE
+*
+*Exceptions:
+*
+*******************************************************************************/
+
+int _CRTAPI1 _ismbcdigit(c)
+unsigned int c;
+{
+
+ if (c > 0x00FF)
+
+#ifdef _MBCS_OS
+ return (0);
+#else
+ if (_mbascii)
+ return ((c >= _MBDIGITLOW) && (c <= _MBDIGITHIGH));
+ else
+ return (0);
+#endif
+
+ else
+ return (isdigit(c));
+}
+#endif /* _MBCS */