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.

51 lines
1.2 KiB

  1. /***
  2. *fileno.c - defines _fileno()
  3. *
  4. * Copyright (c) 1989-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Defines fileno() - return the file handle for the specified stream
  8. *
  9. *Revision History:
  10. * 03-13-89 GJF Module created
  11. * 03-27-89 GJF Moved to 386 tree
  12. * 02-15-90 GJF _file is now an int. Also, fixed copyright.
  13. * 03-19-90 GJF Made calling type _CALLTYPE1 and added #include
  14. * <cruntime.h>.
  15. * 10-02-90 GJF New-style function declarator.
  16. * 01-21-91 GJF ANSI naming.
  17. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  18. *
  19. *******************************************************************************/
  20. #include <cruntime.h>
  21. #include <stdio.h>
  22. /* remove macro definition for fileno()
  23. */
  24. #undef _fileno
  25. /***
  26. *int _fileno(stream) - return the file handle for stream
  27. *
  28. *Purpose:
  29. * Returns the file handle for the given stream is. Normally fileno()
  30. * is a macro, but it is also available as a true function (for
  31. * consistency with ANSI, though it is not required).
  32. *
  33. *Entry:
  34. * FILE *stream - stream to fetch handle for
  35. *
  36. *Exit:
  37. * returns the file handle for the given stream
  38. *
  39. *Exceptions:
  40. *
  41. *******************************************************************************/
  42. int __cdecl _fileno (
  43. FILE *stream
  44. )
  45. {
  46. return( stream->_file );
  47. }