GRASS 8 Programmer's Manual 8.6.0dev(2026)-985dd2421b
Loading...
Searching...
No Matches
rewind_nat.c
Go to the documentation of this file.
1/*!
2 \file lib/vector/Vlib/rewind.c
3
4 \brief Vector library - rewind data (native format)
5
6 Higher level functions for reading/writing/manipulating vectors.
7
8 SPDX-FileCopyrightText: 2001-2009, 2011-2012 GRASS Development Team
9 SPDX-License-Identifier: GPL-2.0-or-later
10
11 \author Original author CERL, probably Dave Gerdes or Mike Higgins.
12 \author Update to GRASS 5.7 Radim Blazek and David D. Gray.
13 */
14
15#include <grass/vector.h>
16
17/*! \brief Rewind vector map to cause reads to start at beginning on
18 non-topological level (level 1) - native format - internal use only
19
20 \param Map pointer to Map_info struct
21
22 \return 0 on success
23 \return -1 on error
24 */
26{
27 return dig_fseek(&(Map->dig_fp), Map->head.head_size, SEEK_SET);
28}
29
30/*! \brief Rewind vector map to cause reads to start at beginning on
31 topological level (level 2) - native format - internal use only
32
33 \param Map pointer to Map_info struct
34
35 \return 0 on success
36 \return -1 on error
37 */
39{
40 Map->next_line = 1;
41 return V1_rewind_nat(Map); /* make sure level 1 reads are reset too */
42}
int dig_fseek(struct gvfile *file, off_t offset, int whence)
Set struct gvfile position.
Definition file.c:58
int V2_rewind_nat(struct Map_info *Map)
Rewind vector map to cause reads to start at beginning on topological level (level 2) - native format...
Definition rewind_nat.c:38
int V1_rewind_nat(struct Map_info *Map)
Rewind vector map to cause reads to start at beginning on non-topological level (level 1) - native fo...
Definition rewind_nat.c:25
Vector map info.