GRASS Programmer's Manual  6.4.2(2012)
gis/seek.c File Reference

GIS Library - file seek routines. More...

#include <stdio.h>
#include <sys/types.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for gis/seek.c:

Go to the source code of this file.

Functions

int G_ftell (FILE *fp)
 Get the current file position of the stream.
void G_fseek (FILE *fp, int offset, int whence)
 Change the file position of the stream.

Detailed Description

GIS Library - file seek routines.

(C) 2009-2010 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author:
Glynn Clements

Definition in file gis/seek.c.


Function Documentation

void G_fseek ( FILE *  fp,
int  offset,
int  whence 
)

Change the file position of the stream.

The value of whence must be one of the constants `SEEK_SET', `SEEK_CUR', or `SEEK_END', to indicate whether the offset is relative to the beginning of the file, the current file position, or the end of the file, respectively.

Parameters:
fpfile descriptor
offsetoffset
whence

Definition at line 48 of file gis/seek.c.

References G_fatal_error().

int G_ftell ( FILE *  fp)

Get the current file position of the stream.

Parameters:
fpfile descriptor
Returns:
file position
-1 on failure

Definition at line 27 of file gis/seek.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines