64,647
社区成员
发帖
与我相关
我的任务
分享
File: "C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\ctype.h"
265: #define isdigit(_c) (MB_CUR_MAX > 1 ? _isctype(_c,_DIGIT) : __chvalidchk(_c, _DIGIT))
File: "C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\isctype.c"
152: extern "C" int __cdecl _isctype (
153: int c,
154: int mask
155: )
156: {
157: if (__locale_changed == 0)
158: {
159: return __initiallocinfo.pctype[c] & mask;
160: }
161: else
162: {
163: return _isctype_l(c, mask, NULL);
164: }
165: }
File: "C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\isctype.c"
109: extern "C" int __cdecl _isctype_l (
110: int c,
111: int mask,
112: _locale_t plocinfo
113: )
114: {
115: int size;
116: unsigned short chartype;
117: char buffer[3];
118: _LocaleUpdate _loc_update(plocinfo);
119:
120: /* c valid between -1 and 255 */
121: if ( c >= -1 && c <= 255 )
122: return _loc_update.GetLocaleT()->locinfo->pctype[c] & mask;
123:
124: if ( _isleadbyte_l(c >> 8 & 0xff, _loc_update.GetLocaleT()) )
125: {
126: buffer[0] = (c >> 8 & 0xff); /* put lead-byte at start of str */
127: buffer[1] = (char)c;
128: buffer[2] = 0;
129: size = 2;
130: } else {
131: buffer[0] = (char)c;
132: buffer[1] = 0;
133: size = 1;
134: }
135:
136: if ( 0 == __crtGetStringTypeA(
137: _loc_update.GetLocaleT(),
138: CT_CTYPE1,
139: buffer,
140: size,
141: &chartype,
142: _loc_update.GetLocaleT()->locinfo->lc_codepage,
143: _loc_update.GetLocaleT()->locinfo->lc_handle[LC_CTYPE],
144: TRUE) )
145: {
146: return 0;
147: }
148:
149: return (int)(chartype & mask);
150: }