96 #include <grass/gis.h>
97 #include <grass/glocale.h>
111 const DateTime * dt1,
const DateTime * dt2)
123 while (fgets(buf,
sizeof(buf), fd)) {
124 if (sscanf(buf,
"%1s", comment) != 1 || *comment ==
'#')
151 fprintf(fd,
"%s\n", buf);
173 char temp1[128], temp2[128];
186 else if (ts->count == 2)
187 sprintf(buf,
"%s / %s", temp1, temp2);
214 for (slash = buf; *slash; slash++)
253 DateTime * dt1, DateTime * dt2,
int *count)
274 static int write_timestamp(
const char *
maptype,
const char *dir,
275 const char *
name,
const struct TimeStamp *ts)
282 G_warning(_(
"Can't create timestamp file for %s map %s in mapset %s"),
291 G_warning(_(
"Invalid timestamp specified for %s map %s in mapset %s"),
302 static int read_timestamp(
const char *maptype,
const char *dir,
303 const char *name,
const char *mapset,
304 struct TimeStamp *ts)
313 G_warning(_(
"Can't open timestamp file for %s map %s in mapset %s"),
314 maptype, name, mapset);
322 G_warning(_(
"Invalid timestamp file for %s map %s in mapset %s"),
323 maptype, name, mapset);
327 #define RAST_MISC "cell_misc"
328 #define VECT_MISC "dig_misc"
329 #define GRID3 "grid3"
345 struct TimeStamp *ts)
347 return read_timestamp(
"raster",
RAST_MISC, name, mapset, ts);
383 struct TimeStamp *ts)
385 return read_timestamp(
"vector",
VECT_MISC, name, mapset, ts);
422 struct TimeStamp *ts)
424 return read_timestamp(
"grid3",
GRID3, name, mapset, ts);
461 return write_timestamp(
"raster",
RAST_MISC, name, ts);
480 return write_timestamp(
"vector",
VECT_MISC, name, ts);
498 return write_timestamp(
"grid3",
GRID3, name, ts);