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.

63 lines
1.5 KiB

  1. /***
  2. *fputchar.c - write a character to stdout
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * defines _fputchar(), putchar() - write a character to stdout, function version
  8. * defines _fputwchar(), putwchar() - write a wide character to stdout, function version
  9. *
  10. *Revision History:
  11. * 11-30-83 RN initial version
  12. * 11-09-87 JCR Multi-thread support
  13. * 12-11-87 JCR Added "_LOAD_DS" to declaration
  14. * 05-31-88 PHG Merged DLL and normal versions
  15. * 06-21-89 PHG Added putchar() function
  16. * 02-15-90 GJF Fixed copyright and indents
  17. * 03-19-90 GJF Replaced _LOAD_DS with _CALLTYPE1, added #include
  18. * <cruntime.h> and removed #include <register.h>.
  19. * 10-02-90 GJF New-style function declarators.
  20. * 01-21-91 GJF ANSI naming.
  21. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  22. * 04-26-93 CFW Wide char enable.
  23. * 04-30-93 CFW Move wide char support to fputwchr.c.
  24. * 03-15-95 GJF Deleted #include <tchar.h>
  25. *
  26. *******************************************************************************/
  27. #include <cruntime.h>
  28. #include <stdio.h>
  29. /***
  30. *int _fputchar(ch), putchar() - put a character to stdout
  31. *
  32. *Purpose:
  33. * Puts the given characters to stdout. Function version of macro
  34. * putchar().
  35. *
  36. *Entry:
  37. * int ch - character to output
  38. *
  39. *Exit:
  40. * returns character written if successful
  41. * returns EOF if fails
  42. *
  43. *Exceptions:
  44. *
  45. *******************************************************************************/
  46. int __cdecl _fputchar (
  47. REG1 int ch
  48. )
  49. {
  50. return(putc(ch, stdout));
  51. }
  52. #undef putchar
  53. int __cdecl putchar (
  54. int ch
  55. )
  56. {
  57. return _fputchar(ch);
  58. }