Leaked source code of windows server 2003
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
816 B

  1. /* _Towlower -- convert wchar_t to lower 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 _Towlower(wchar_t _Ch,
  8. const _Ctypevec *_Ctype)
  9. { /* convert element to lower 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_LOWERCASE,
  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 */