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
gis/seek.c
Go to the documentation of this file.
1
14
#include <stdio.h>
15
#include <sys/types.h>
16
#include <grass/gis.h>
17
#include <grass/glocale.h>
18
27
off_t
G_ftell
(FILE *fp)
28
{
29
#ifdef HAVE_FSEEKO
30
return
ftello(fp);
31
#else
32
return
(off_t) ftell(fp);
33
#endif
34
}
35
48
void
G_fseek
(FILE *fp, off_t offset,
int
whence)
49
{
50
#ifdef HAVE_FSEEKO
51
if
(fseeko(fp, offset, whence) != 0)
52
G_fatal_error
(_(
"Unable to seek"
));
53
#else
54
long
loff = (long) offset;
55
if
((off_t) loff != offset)
56
G_fatal_error
(_(
"Seek offset out of range"
));
57
if
(fseek(fp, loff, whence) != 0)
58
G_fatal_error
(_(
"Unable to seek"
));
59
#endif
60
}
lib
gis
seek.c
Generated on Thu Sep 26 2013 09:48:06 for GRASS Programmer's Manual by
1.8.4