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.

65 lines
1.8 KiB

  1. /***
  2. *toupper.c - convert character to uppercase
  3. *
  4. * Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Defines function versions of _toupper() and toupper().
  8. *
  9. *Revision History:
  10. * 11-09-84 DFW created
  11. * 12-11-87 JCR Added "_LOAD_DS" to declaration
  12. * 02-23-89 GJF Added function version of _toupper and cleaned up.
  13. * 03-26-89 GJF Migrated to 386 tree
  14. * 03-06-90 GJF Fixed calling type, added #include <cruntime.h> and
  15. * fixed copyright.
  16. * 09-27-90 GJF New-style function declarators.
  17. * 10-11-91 ETC Locale support for toupper under _INTL switch.
  18. * 12-10-91 ETC Updated nlsapi; added multithread.
  19. * 12-17-92 KRS Updated and optimized for latest NLSAPI. Bug-fixes.
  20. * 01-19-93 CFW Fixed typo.
  21. * 03-25-93 CFW _toupper now defined when _INTL.
  22. * 06-02-93 SRW ignore _INTL if _NTSUBSET_ defined.
  23. * 09-15-93 CFW Change buffer to unsigned char to fix nasty cast bug.
  24. * 01-14-94 SRW if _NTSUBSET_ defined call Rtl functions
  25. * 11-14-95 JAE Use Win32 API
  26. *
  27. *******************************************************************************/
  28. #include <windows.h>
  29. #include <cruntime.h>
  30. /* remove macro definitions of _toupper() and toupper()
  31. */
  32. #undef _toupper
  33. #undef toupper
  34. /* define function-like macro equivalent to _toupper()
  35. */
  36. #define mkupper(c) ( (c)-'a'+'A' )
  37. /***
  38. *int toupper(c) - convert character to uppercase
  39. *
  40. *Purpose:
  41. * toupper() is simply a function version of the macro of the same name.
  42. *
  43. *Entry:
  44. * c - int value of character to be converted
  45. *
  46. *Exit:
  47. * if c is a lower case letter, returns int value of uppercase
  48. * representation of c. otherwise, it returns c.
  49. *
  50. *Exceptions:
  51. *
  52. *******************************************************************************/
  53. int _CALLTYPE1 toupper (
  54. int c
  55. )
  56. {
  57. return (int)CharUpper ((LPTSTR)c);
  58. }