#include "gis.h"This structure is defined in gis.h, but there should be no reason to access its elements directly:
struct TimeStamp { DateTime dt[2]; /* two datetimes */ int count; };Using the G_*_timestamp routines reads/writes a timestamp file in the cell_misc/rastername or dig_misc/vectorname mapset element.
A TimeStamp can be one DateTime, or two DateTimes representing a
range. When preparing to write a TimeStamp, the programmer should
use one of:
G_set_timestamp to set a single DateTime
G_set_timestamp_range to set two DateTimes.
int G_read_raster_timestamp (name, mapset, ts) char *name, *mapset; struct TimeStamp *ts; Returns 1 on success. 0 or negative on error.int G_read_vector_timestamp (name, mapset, ts) char *name, *mapset; struct TimeStamp *ts; Returns 1 on success. 0 or negative on error.
G_get_timestamps (ts, dt1, dt2, count) struct TimeStamp *ts; DateTime *dt1, *dt2; int *count; Use to copy the TimeStamp information into Datetimes, so the members of struct TimeStamp shouldn't be accessed directly. count=0 means no datetimes were copied count=1 means 1 datetime was copied into dt1 count=2 means 2 datetimes were copied
G_init_timestamp (ts) struct TimeStamp *ts; Sets ts->count = 0, to indicate no valid DateTimes are in TimeStamp.
G_set_timestamp (ts, dt) struct TimeStamp *ts; DateTime *dt; Copies a single DateTime to a TimeStamp in preparation for writing. (overwrites any existing information in TimeStamp)
G_set_timestamp_range (ts, dt1, dt2) struct TimeStamp *ts; DateTime *dt1, *dt2; Copies two DateTimes (a range) to a TimeStamp in preparation for writing. (overwrites any existing information in TimeStamp)
int G_write_raster_timestamp (name, ts) char *name; struct TimeStamp *ts; Returns: 1 on success. -1 error - can't create timestamp file -2 error - invalid datetime in ts
int G_write_vector_timestamp (name, ts) char *name; struct TimeStamp *ts; Returns: 1 on success. -1 error - can't create timestamp file -2 error - invalid datetime in ts int G_format_timestamp (ts, buf) struct TimeStamp *ts; char *buf; Returns: 1 on success -1 error int G_scan_timestamp (ts, buf) struct TimeStamp *ts; char *buf; Returns: 1 on success -1 error int G_remove_raster_timestamp (name) char *name; Only files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail int G_remove_vector_timestamp (name) char *name; Only files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail