home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / fileno.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  1KB  |  42 lines

  1. /***
  2. *fileno.c - defines _fileno()
  3. *
  4. *       Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Defines fileno() - return the file handle for the specified stream
  8. *
  9. *******************************************************************************/
  10.  
  11. #include <cruntime.h>
  12. #include <stdio.h>
  13.  
  14. /* remove macro definition for fileno()
  15.  */
  16. #undef  _fileno
  17.  
  18. /***
  19. *int _fileno(stream) - return the file handle for stream
  20. *
  21. *Purpose:
  22. *       Returns the file handle for the given stream is. Normally fileno()
  23. *       is a macro, but it is also available as a true function (for
  24. *       consistency with ANSI, though it is not required).
  25. *
  26. *Entry:
  27. *       FILE *stream - stream to fetch handle for
  28. *
  29. *Exit:
  30. *       returns the file handle for the given stream
  31. *
  32. *Exceptions:
  33. *
  34. *******************************************************************************/
  35.  
  36. int __cdecl _fileno (
  37.         FILE *stream
  38.         )
  39. {
  40.         return( stream->_file );
  41. }
  42.