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. *fgetchar.c - get a character from stdin
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * defines _fgetchar() and getchar() - read a character from stdin
  8. * defines _fgetwchar() and getwchar() - read a wide character from stdin
  9. *
  10. *Revision History:
  11. * 11-20-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 getchar() function
  16. * 02-15-90 GJF Fixed copyright and indents
  17. * 03-16-90 GJF Replaced _LOAD_DS with _CALLTYPE1 and added #include
  18. * <cruntime.h>.
  19. * 10-03-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 fgetwchr.c.
  24. * 03-15-95 GJF Deleted #include <tchar.h>
  25. *
  26. *******************************************************************************/
  27. #include <cruntime.h>
  28. #include <stdio.h>
  29. /***
  30. *int _fgetchar(), getchar() - read a character from stdin
  31. *
  32. *Purpose:
  33. * Reads the next character from stdin. Function version of
  34. * getchar() macro.
  35. *
  36. *Entry:
  37. * None.
  38. *
  39. *Exit:
  40. * Returns character read or EOF if at end-of-file or an error occured,
  41. * in which case the appropriate flag is set in the FILE structure.
  42. *
  43. *Exceptions:
  44. *
  45. *******************************************************************************/
  46. int __cdecl _fgetchar (
  47. void
  48. )
  49. {
  50. return(getc(stdin));
  51. }
  52. #undef getchar
  53. int __cdecl getchar (
  54. void
  55. )
  56. {
  57. return _fgetchar();
  58. }