Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
786 B

  1. /* _Towupper -- convert wchar_t to upper case for Microsoft */
  2. #include <xlocinfo.h>
  3. #include <wchar.h>
  4. #include <awint.h>
  5. #include <setlocal.h>
  6. _STD_BEGIN
  7. _CRTIMP2 wchar_t __cdecl _Towupper(wchar_t _Ch,
  8. const _Ctypevec *_Ctype)
  9. { /* convert element to upper case */
  10. wchar_t _Res = _Ch;
  11. if (_Ch == WEOF)
  12. ;
  13. else if (_Ctype->_Hand == _CLOCALEHANDLE && _Ch < 256)
  14. { /* handle ASCII character in C locale */
  15. if (L'a' <= _Ch && _Ch <= L'z')
  16. _Res = (wchar_t)(_Ch - L'a' + L'A');
  17. }
  18. else if (__crtLCMapStringW(_Ctype->_Hand, LCMAP_UPPERCASE,
  19. &_Ch, 1, &_Res, 1, _Ctype->_Page) == 0)
  20. _Res = _Ch;
  21. return (_Res);
  22. }
  23. _STD_END
  24. /*
  25. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  26. * Consult your license regarding permissions and restrictions.
  27. V3.10:0009 */