ReactOS 0.4.16-dev-732-g2d1144a
wctype.cpp
Go to the documentation of this file.
1//
2// wctype.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Implementations of the wctype function.
7//
8#include <corecrt.h>
9#include <string.h>
10#include <wctype.h>
11
12
13
14static struct wctab
15{
16 char const* s;
18}
19const tab[] =
20{
21 { "alnum", _ALPHA | _DIGIT },
22 { "alpha", _ALPHA },
23 { "cntrl", _CONTROL },
24 { "digit", _DIGIT },
25 { "graph", _PUNCT | _ALPHA | _DIGIT },
26 { "lower", _LOWER },
27 { "print", _BLANK | _PUNCT | _ALPHA | _DIGIT },
28 { "punct", _PUNCT },
29 { "blank", _BLANK },
30 { "space", _SPACE },
31 { "upper", _UPPER },
32 { "xdigit", _HEX },
33 { nullptr, 0 }
34};
35
36
37
38#pragma warning(push)
39#pragma warning(disable: 4273)
40
41extern "C" wctype_t __cdecl wctype(char const* const name)
42{
43 for (unsigned n = 0; tab[n].s != 0; ++n)
44 {
45 if (strcmp(tab[n].s, name) == 0)
46 return tab[n].value;
47 }
48
49 return 0;
50}
51
52#pragma warning(pop)
53
54/*
55 * Copyright (c) 1992-2007 by P.J. Plauger. ALL RIGHTS RESERVED.
56 * Consult your license regarding permissions and restrictions.
57 V5.03:0009 */
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define __cdecl
Definition: accygwin.h:79
GLdouble s
Definition: gl.h:2039
GLdouble n
Definition: glext.h:7729
#define _BLANK
Definition: ctype.h:72
#define _PUNCT
Definition: ctype.h:70
#define _CONTROL
Definition: ctype.h:71
#define _LOWER
Definition: ctype.h:66
#define _SPACE
Definition: ctype.h:68
#define _ALPHA
Definition: ctype.h:76
#define _UPPER
Definition: ctype.h:65
#define _HEX
Definition: ctype.h:73
#define _DIGIT
Definition: ctype.h:67
Definition: name.c:39
wctype_t value
Definition: wctrans.cpp:22
char const * s
Definition: wctrans.cpp:21
unsigned short wctype_t
Definition: corecrt.h:617
wctype_t __cdecl wctype(char const *const name)
Definition: wctype.cpp:41
static struct wctab tab[]