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
2.0 KiB

  1. /***
  2. *fsetpos.c - Contains fsetpos runtime
  3. *
  4. * Copyright (c) 1987-2001, 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. *Revision History:
  11. * 01-16-87 JCR Module created
  12. * 04-13-87 JCR Added const to declaration
  13. * 12-11-87 JCR Added "_LOAD_DS" to declaration
  14. * 02-15-90 GJF Fixed copyright and indents
  15. * 03-19-90 GJF Replaced _LOAD_DS with _CALLTYPE1 and added #include
  16. * <cruntime.h>.
  17. * 10-02-90 GJF New-style function declarators.
  18. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  19. * 12-23-94 GJF Use 64-bit file position (_fseeki64) for non-_MAC_.
  20. * 01-05-94 GJF Temporarily commented out above change due to MFC/IDE
  21. * bugs.
  22. * 01-24-95 GJF Restored 64-bit fpos_t support.
  23. * 06-28-96 SKS Enable 64-bit fpos_t support for the MAC
  24. * 05-17-99 PML Remove all Macintosh support.
  25. *
  26. *******************************************************************************/
  27. #include <cruntime.h>
  28. #include <stdio.h>
  29. #include <internal.h>
  30. /***
  31. *int fsetpos(stream,pos) - Set file positioning
  32. *
  33. *Purpose:
  34. * Fsetpos sets the file position for the file indicated by [stream] to
  35. * the position indicated by [pos]. The [pos] value is defined to be in
  36. * an internal format (not to be interpreted by the user) and has been
  37. * generated by an earlier fgetpos call.
  38. *
  39. *Entry:
  40. * FILE *stream = pointer to a file stream value
  41. * fpos_t *pos = pointer to a file positioning value
  42. *
  43. *Exit:
  44. * Successful call returns 0.
  45. * Unsuccessful call returns non-zero (!0).
  46. *
  47. *Exceptions:
  48. * None.
  49. *******************************************************************************/
  50. int __cdecl fsetpos (
  51. FILE *stream,
  52. const fpos_t *pos
  53. )
  54. {
  55. #ifdef _POSIX_
  56. return( fseek(stream, *pos, SEEK_SET) );
  57. #else
  58. return( _fseeki64(stream, *pos, SEEK_SET) );
  59. #endif
  60. }