GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
segment/seek.c
Go to the documentation of this file.
1
15
#include <stdio.h>
16
#include <sys/types.h>
17
#include <unistd.h>
18
#include <string.h>
19
#include <errno.h>
20
#include <grass/config.h>
21
#include <grass/gis.h>
22
#include <grass/segment.h>
23
24
37
int
segment_seek
(
const
SEGMENT * SEG,
int
n,
int
index)
38
{
39
off_t offset;
40
41
offset = (off_t) n *SEG->size + index + SEG->offset;
42
43
if
(lseek(SEG->fd, offset, SEEK_SET) == (off_t) - 1) {
44
G_warning
(
"segment_seek: %s"
, strerror(
errno
));
45
return
-1;
46
}
47
48
return
0;
49
}
lib
segment
seek.c
Generated on Sat Oct 5 2013 12:11:10 for GRASS Programmer's Manual by
1.8.4