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.

40 lines
839 B

  1. /* towctrans/wctrans functions for Microsoft */
  2. #include <string.h>
  3. #include <wctype.h>
  4. #ifndef _LIMITS
  5. #include <yvals.h>
  6. #endif
  7. _STD_BEGIN
  8. static const struct wctab {
  9. const char *s;
  10. wctype_t val;
  11. } tab[] = {
  12. {"tolower", 0},
  13. {"toupper", 1},
  14. {(const char *)0, 0}};
  15. _CRTIMP2 wint_t (towctrans)(wint_t c, wctrans_t val)
  16. { /* translate wide character */
  17. return (val == 1 ? towupper(c) : towlower(c));
  18. }
  19. _CRTIMP2 wctrans_t (wctrans)(const char *name)
  20. { /* find translation for wide character */
  21. int n;
  22. for (n = 0; tab[n].s != 0; ++n)
  23. if (strcmp(tab[n].s, name) == 0)
  24. return (tab[n].val);
  25. return (0);
  26. }
  27. _STD_END
  28. /*
  29. * Copyright (c) 1995 by P.J. Plauger. ALL RIGHTS RESERVED.
  30. * Consult your license regarding permissions and restrictions.
  31. */
  32. /*
  33. 951207 pjp: added new file
  34. */