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

  1. /***
  2. *fsetpos.c - Contains fsetpos runtime
  3. *
  4. *       Copyright (c) 1987-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Fsetpos sets the file position using an internal value returned by an
  8. *       earlier fgetpos call.
  9. *
  10. *******************************************************************************/
  11.  
  12. #include <cruntime.h>
  13. #include <stdio.h>
  14. #include <internal.h>
  15.  
  16. /***
  17. *int fsetpos(stream,pos) - Set file positioning
  18. *
  19. *Purpose:
  20. *       Fsetpos sets the file position for the file indicated by [stream] to
  21. *       the position indicated by [pos].  The [pos] value is defined to be in
  22. *       an internal format (not to be interpreted by the user) and has been
  23. *       generated by an earlier fgetpos call.
  24. *
  25. *Entry:
  26. *       FILE *stream = pointer to a file stream value
  27. *       fpos_t *pos = pointer to a file positioning value
  28. *
  29. *Exit:
  30. *       Successful call returns 0.
  31. *       Unsuccessful call returns non-zero (!0).
  32. *
  33. *Exceptions:
  34. *       None.
  35. *******************************************************************************/
  36.  
  37. int __cdecl fsetpos (
  38.         FILE *stream,
  39.         const fpos_t *pos
  40.         )
  41. {
  42. #ifdef _MAC
  43.         return( fseek(stream, (long) *pos, SEEK_SET) );
  44. #else  /* _MAC */
  45.         return( _fseeki64(stream, *pos, SEEK_SET) );
  46. #endif  /* _MAC */
  47. }
  48.