ReactOS 0.4.16-dev-2104-gb84fa49
ctype.h File Reference
#include <corecrt_wctype.h>
Include dependency graph for ctype.h:

Go to the source code of this file.

Macros

#define WEOF   (wint_t)(0xFFFF)
 

Functions

_ACRTIMP int __cdecl __isascii (int)
 
_ACRTIMP int __cdecl __iscsym (int)
 
_ACRTIMP int __cdecl __iscsymf (int)
 
_ACRTIMP int __cdecl __toascii (int)
 
_ACRTIMP int __cdecl _isblank_l (int, _locale_t)
 
_ACRTIMP int __cdecl _isctype (int, int)
 
_ACRTIMP int __cdecl _isctype_l (int, int, _locale_t)
 
_ACRTIMP int __cdecl _islower_l (int, _locale_t)
 
_ACRTIMP int __cdecl _isupper_l (int, _locale_t)
 
_ACRTIMP int __cdecl _isdigit_l (int, _locale_t)
 
_ACRTIMP int __cdecl _isxdigit_l (int, _locale_t)
 
_ACRTIMP int __cdecl _tolower (int)
 
_ACRTIMP int __cdecl _tolower_l (int, _locale_t)
 
_ACRTIMP int __cdecl _toupper (int)
 
_ACRTIMP int __cdecl _toupper_l (int, _locale_t)
 
_ACRTIMP int __cdecl isalnum (int)
 
_ACRTIMP int __cdecl isalpha (int)
 
_ACRTIMP int __cdecl isblank (int)
 
_ACRTIMP int __cdecl iscntrl (int)
 
_ACRTIMP int __cdecl isdigit (int)
 
_ACRTIMP int __cdecl isgraph (int)
 
_ACRTIMP int __cdecl islower (int)
 
_ACRTIMP int __cdecl isprint (int)
 
_ACRTIMP int __cdecl _isprint_l (int, _locale_t)
 
_ACRTIMP int __cdecl ispunct (int)
 
_ACRTIMP int __cdecl isspace (int)
 
_ACRTIMP int __cdecl _isspace_l (int, _locale_t)
 
_ACRTIMP int __cdecl isupper (int)
 
_ACRTIMP int __cdecl isxdigit (int)
 
_ACRTIMP int __cdecl tolower (int)
 
_ACRTIMP int __cdecl toupper (int)
 
static int isascii (int c)
 
static int iscsym (int c)
 
static int iscsymf (int c)
 
static int toascii (int c)
 

Macro Definition Documentation

◆ WEOF

#define WEOF   (wint_t)(0xFFFF)

Definition at line 18 of file ctype.h.

Function Documentation

◆ __isascii()

_ACRTIMP int __cdecl __isascii ( int  c)

Definition at line 417 of file ctype.c.

418{
419 return ((unsigned)c < 0x80);
420}
const GLubyte * c
Definition: glext.h:8905

◆ __iscsym()

_ACRTIMP int __cdecl __iscsym ( int  c)

Definition at line 442 of file ctype.c.

443{
444 return (c < 127 && (isalnum(c) || c == '_'));
445}
int CDECL isalnum(int c)
Definition: ctype.c:214

◆ __iscsymf()

_ACRTIMP int __cdecl __iscsymf ( int  c)

Definition at line 450 of file ctype.c.

451{
452 return (c < 127 && (isalpha(c) || c == '_'));
453}
#define isalpha(c)
Definition: acclib.h:74

◆ __toascii()

_ACRTIMP int __cdecl __toascii ( int  c)

Definition at line 425 of file ctype.c.

426{
427 return (unsigned)c & 0x7f;
428}

◆ _isblank_l()

_ACRTIMP int __cdecl _isblank_l ( int  c,
_locale_t  locale 
)

Definition at line 398 of file ctype.c.

399{
400#if _MSVCR_VER < 140
401 if (c == '\t') return _BLANK;
402#endif
403 return _isctype_l( c, _BLANK, locale );
404}
Definition: _locale.h:75
int CDECL _isctype_l(int c, int type, _locale_t locale)
Definition: ctype.c:165
#define _BLANK

◆ _isctype()

_ACRTIMP int __cdecl _isctype ( int  c,
int  type 
)

Definition at line 198 of file ctype.c.

199{
200 return _isctype_l(c, type, NULL);
201}
#define NULL
Definition: types.h:112
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by _tolower(), _toupper(), isalnum(), isalpha(), isblank(), iscntrl(), isdigit(), isgraph(), isleadbyte(), islower(), isprint(), ispunct(), isspace(), isupper(), iswctype(), isxdigit(), test_isblank(), tolower(), and toupper().

◆ _isctype_l()

_ACRTIMP int __cdecl _isctype_l ( int  c,
int  type,
_locale_t  locale 
)

Definition at line 165 of file ctype.c.

166{
168
169 if(!locale)
171 else
172 locinfo = locale->locinfo;
173
174 if (c >= -1 && c <= 255)
175 return locinfo->pctype[c] & type;
176
177 if (locinfo->mb_cur_max != 1 && c > 0)
178 {
179 /* FIXME: Is there a faster way to do this? */
180 WORD typeInfo;
181 char convert[3], *pconv = convert;
182
183 if (locinfo->pctype[(UINT)c >> 8] & _LEADBYTE)
184 *pconv++ = (UINT)c >> 8;
185 *pconv++ = c & 0xff;
186 *pconv = 0;
187
188 if (GetStringTypeExA(locinfo->lc_handle[LC_CTYPE],
189 CT_CTYPE1, convert, convert[1] ? 2 : 1, &typeInfo))
190 return typeInfo & type;
191 }
192 return 0;
193}
BOOL WINAPI GetStringTypeExA(LCID locale, DWORD type, LPCSTR src, INT count, LPWORD chartype)
Definition: locale.c:3259
#define _LEADBYTE
#define LC_CTYPE
Definition: locale.h:27
else locinfo
Definition: scanf.h:225
unsigned short WORD
Definition: ntddk_ex.h:93
#define c
Definition: ke_i.h:80
int convert
Definition: msacm.c:1374
unsigned int UINT
Definition: ndis.h:50
#define get_locinfo()
Definition: winesup.h:25
#define CT_CTYPE1
Definition: winnls.h:255

Referenced by _isalnum_l(), _isalpha_l(), _isblank_l(), _ischartype_l(), _iscntrl_l(), _isctype(), _isdigit_l(), _isgraph_l(), _isleadbyte_l(), _islower_l(), _isprint_l(), _ispunct_l(), _isspace_l(), _isupper_l(), _isxdigit_l(), fast_check_current_locale(), and fast_check_given_locale().

◆ _isdigit_l()

_ACRTIMP int __cdecl _isdigit_l ( int  c,
_locale_t  locale 
)

Definition at line 254 of file ctype.c.

255{
256 return _isctype_l( c, _DIGIT, locale );
257}
#define _DIGIT

◆ _islower_l()

_ACRTIMP int __cdecl _islower_l ( int  c,
_locale_t  locale 
)

Definition at line 302 of file ctype.c.

303{
304 return _isctype_l( c, _LOWER, locale );
305}
#define _LOWER

◆ _isprint_l()

_ACRTIMP int __cdecl _isprint_l ( int  c,
_locale_t  locale 
)

Definition at line 318 of file ctype.c.

319{
320 return _isctype_l( c, _ALPHA | _DIGIT | _BLANK | _PUNCT, locale );
321}
#define _PUNCT
#define _ALPHA

◆ _isspace_l()

_ACRTIMP int __cdecl _isspace_l ( int  c,
_locale_t  locale 
)

Definition at line 350 of file ctype.c.

351{
352 return _isctype_l( c, _SPACE, locale );
353}
#define _SPACE

◆ _isupper_l()

_ACRTIMP int __cdecl _isupper_l ( int  c,
_locale_t  locale 
)

Definition at line 366 of file ctype.c.

367{
368 return _isctype_l( c, _UPPER, locale );
369}
#define _UPPER

◆ _isxdigit_l()

_ACRTIMP int __cdecl _isxdigit_l ( int  c,
_locale_t  locale 
)

Definition at line 382 of file ctype.c.

383{
384 return _isctype_l( c, _HEX, locale );
385}
#define _HEX

◆ _tolower()

_ACRTIMP int __cdecl _tolower ( int  c)

Definition at line 582 of file ctype.c.

583{
584 return c + 0x20; /* sic */
585}

◆ _tolower_l()

_ACRTIMP int __cdecl _tolower_l ( int  c,
_locale_t  locale 
)

Definition at line 532 of file ctype.c.

533{
535 unsigned char str[2], *p = str, ret[2];
536
537 if(!locale)
539 else
540 locinfo = locale->locinfo;
541
542 if((unsigned)c < 256)
543 {
544 if(locinfo->pctype[c] & _LEADBYTE)
545 return c;
546 return locinfo->pclmap[c];
547 }
548
549 if(locinfo->pctype[(c>>8)&255] & _LEADBYTE)
550 *p++ = (c>>8) & 255;
551 else {
552 *_errno() = EILSEQ;
553 str[1] = 0;
554 }
555 *p++ = c & 255;
556
558 (char*)str, p-str, (char*)ret, 2, locinfo->lc_codepage, 0))
559 {
560 case 0:
561 return c;
562 case 1:
563 return ret[0];
564 default:
565 return ret[0] + (ret[1]<<8);
566 }
567}
int *CDECL _errno(void)
Definition: errno.c:215
#define EILSEQ
Definition: errno.h:62
int CDECL __crtLCMapStringA(LCID lcid, DWORD mapflags, const char *src, int srclen, char *dst, int dstlen, unsigned int codepage, int xflag)
Definition: locale.c:877
return ret
Definition: mutex.c:146
GLfloat GLfloat p
Definition: glext.h:8902
const WCHAR * str
#define LCMAP_LOWERCASE
Definition: winnls.h:197

Referenced by _mbslwr_l(), _mbslwr_s_l(), _memicmp_l(), _strlwr_s_l(), _strnicmp_l(), _strtoi64_l(), _strtoui64_l(), test__tolower_l(), and tolower().

◆ _toupper()

_ACRTIMP int __cdecl _toupper ( int  c)

Definition at line 524 of file ctype.c.

525{
526 return c - 0x20; /* sic */
527}

◆ _toupper_l()

_ACRTIMP int __cdecl _toupper_l ( int  c,
_locale_t  locale 
)

Definition at line 474 of file ctype.c.

475{
477 unsigned char str[2], *p = str, ret[2];
478
479 if(!locale)
481 else
482 locinfo = locale->locinfo;
483
484 if((unsigned)c < 256)
485 {
486 if(locinfo->pctype[c] & _LEADBYTE)
487 return c;
488 return locinfo->pcumap[c];
489 }
490
491 if(locinfo->pctype[(c>>8)&255] & _LEADBYTE)
492 *p++ = (c>>8) & 255;
493 else {
494 *_errno() = EILSEQ;
495 str[1] = 0;
496 }
497 *p++ = c & 255;
498
500 (char*)str, p-str, (char*)ret, 2, locinfo->lc_codepage, 0))
501 {
502 case 0:
503 return c;
504 case 1:
505 return ret[0];
506 default:
507 return ret[0] + (ret[1]<<8);
508 }
509}
#define LCMAP_UPPERCASE
Definition: winnls.h:198

Referenced by _mbsupr_l(), _mbsupr_s_l(), _strupr_s_l(), and toupper().

◆ isalnum()

◆ isalpha()

_ACRTIMP int __cdecl isalpha ( int  c)

Definition at line 230 of file ctype.c.

231{
232 return _isctype( c, _ALPHA );
233}

◆ isascii()

static int isascii ( int  c)
inlinestatic

Definition at line 58 of file ctype.h.

58{ return __isascii(c); }
#define __isascii(_Char)
Definition: ctype.h:656

◆ isblank()

_ACRTIMP int __cdecl isblank ( int  c)

Definition at line 409 of file ctype.c.

410{
411 return c == '\t' || _isctype( c, _BLANK );
412}

◆ iscntrl()

◆ iscsym()

static int iscsym ( int  c)
inlinestatic

Definition at line 59 of file ctype.h.

59{ return __iscsym(c); }
#define __iscsym(_c)
Definition: ctype.h:691

◆ iscsymf()

static int iscsymf ( int  c)
inlinestatic

Definition at line 60 of file ctype.h.

60{ return __iscsymf(c); }
#define __iscsymf(_c)
Definition: ctype.h:690

◆ isdigit()

_ACRTIMP int __cdecl isdigit ( int  c)

Definition at line 262 of file ctype.c.

263{
264 return _isctype( c, _DIGIT );
265}

◆ isgraph()

_ACRTIMP int __cdecl isgraph ( int  c)

Definition at line 278 of file ctype.c.

279{
280 return _isctype( c, _ALPHA | _DIGIT | _PUNCT );
281}

Referenced by _ismbbgraph(), compress_block(), and gen_codes().

◆ islower()

_ACRTIMP int __cdecl islower ( int  c)

Definition at line 310 of file ctype.c.

311{
312 return _isctype( c, _LOWER );
313}

◆ isprint()

_ACRTIMP int __cdecl isprint ( int  c)

Definition at line 326 of file ctype.c.

327{
328 return _isctype( c, _ALPHA | _DIGIT | _BLANK | _PUNCT );
329}

◆ ispunct()

_ACRTIMP int __cdecl ispunct ( int  c)

Definition at line 334 of file ctype.c.

335{
336 return _isctype( c, _PUNCT );
337}

Referenced by _Locale_init(), and UnDosLine().

◆ isspace()

_ACRTIMP int __cdecl isspace ( int  c)

Definition at line 358 of file ctype.c.

359{
360 return _isctype( c, _SPACE );
361}

◆ isupper()

_ACRTIMP int __cdecl isupper ( int  c)

Definition at line 374 of file ctype.c.

375{
376 return _isctype( c, _UPPER );
377}

◆ isxdigit()

_ACRTIMP int __cdecl isxdigit ( int  c)

Definition at line 390 of file ctype.c.

391{
392 return _isctype( c, _HEX );
393}

◆ toascii()

static int toascii ( int  c)
inlinestatic

Definition at line 61 of file ctype.h.

61{ return __toascii(c); }
#define __toascii(_Char)
Definition: ctype.h:657

◆ tolower()

_ACRTIMP int __cdecl tolower ( int  c)

Definition at line 572 of file ctype.c.

573{
575 return c>='A' && c<='Z' ? c-'A'+'a' : c;
576 return _tolower_l(c, NULL);
577}
int CDECL _tolower_l(int c, _locale_t locale)
Definition: ctype.c:532
BOOL initial_locale
Definition: locale.c:49

◆ toupper()

_ACRTIMP int __cdecl toupper ( int  c)

Definition at line 514 of file ctype.c.

515{
517 return c>='a' && c<='z' ? c-'a'+'A' : c;
518 return _toupper_l(c, NULL);
519}
int CDECL _toupper_l(int c, _locale_t locale)
Definition: ctype.c:474