rewind_nat.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*!
  2. \file rewind.c
  3. \brief Vector library - rewind data (native format)
  4. Higher level functions for reading/writing/manipulating vectors.
  5. (C) 2001-2009 by the GRASS Development Team
  6. This program is free software under the GNU General Public License
  7. (>=v2). Read the file COPYING that comes with GRASS for details.
  8. \author Original author CERL, probably Dave Gerdes or Mike Higgins.
  9. \author Update to GRASS 5.7 Radim Blazek and David D. Gray.
  10. */
  11. #include <grass/vector.h>
  12. /*!
  13. \brief Rewind vector data file to cause reads to start at beginning (level 1)
  14. \param Map vector map
  15. \return 0 on success
  16. \return -1 on error
  17. */
  18. int V1_rewind_nat(struct Map_info *Map)
  19. {
  20. return (dig_fseek(&(Map->dig_fp), Map->head.head_size, SEEK_SET));
  21. }
  22. /*!
  23. \brief Rewind vector data file to cause reads to start at beginning (level 2)
  24. \param Map vector map
  25. \return 0 on success
  26. \return -1 on error
  27. */
  28. int V2_rewind_nat(struct Map_info *Map)
  29. {
  30. Map->next_line = 1;
  31. return V1_rewind_nat(Map); /* make sure level 1 reads are reset too */
  32. }