history.c File Reference

#include <string.h>
#include "gis.h"
#include "glocale.h"

Include dependency graph for history.c:

Go to the source code of this file.

Functions

int G_read_history (char *name, char *mapset, struct History *hist)
 read raster history file
int G_write_history (char *name, struct History *hist)
 write raster history file
int G_short_history (char *name, char *type, struct History *hist)
 initialize history structure


Function Documentation

int G_read_history ( char *  name,
char *  mapset,
struct History *  hist 
)

read raster history file

This routine reads the history file for the raster file name in mapset into the history structure. A diagnostic message is printed and -1 is returned if there is an error reading the history file. Otherwise, 0 is returned.

Parameters:
name 
mapset 
history 
Returns:
int

Definition at line 60 of file history.c.

References G_ascii_check(), G_fopen_old(), G_getl(), G_warning(), G_zero(), and NULL.

int G_short_history ( char *  name,
char *  type,
struct History *  hist 
)

initialize history structure

This routine initializes the history structure, recording the date, user, module name and the raster file name structure. The type is an anachronism from earlier versions of GRASS and should be specified as "raster". Note. This routine only initializes the data structure. It does not write the history file.

Parameters:
name 
type 
history 
Returns:
int

Definition at line 192 of file history.c.

References G_date(), G_mapset(), G_program_name(), and G_whoami().

int G_write_history ( char *  name,
struct History *  hist 
)

write raster history file

This routine writes the history file for the raster file name in the current mapset from the history structure. A diagnostic message is printed and -1 is returned if there is an error writing the history file. Otherwise, 0 is returned. Note. The history structure should first be initialized using G_short_history.

Parameters:
name 
history 
Returns:
int

Definition at line 141 of file history.c.

References fprintf(), G_fopen_new(), and G_warning().


Generated on Mon Jan 1 19:49:34 2007 for GRASS by  doxygen 1.5.1