#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Go to the source code of this file.
Defines | |
#define | RAST_MISC "cell_misc" |
#define | VECT_MISC "dig_misc" |
#define | GRID3 "grid3" |
Functions | |
void | G_init_timestamp (struct TimeStamp *ts) |
void | G_set_timestamp (struct TimeStamp *ts, DateTime *dt) |
void | G_set_timestamp_range (struct TimeStamp *ts, DateTime *dt1, DateTime *dt2) |
int | G__read_timestamp (FILE *fd, struct TimeStamp *ts) |
int | G__write_timestamp (FILE *fd, struct TimeStamp *ts) |
output TimeStamp structure to a file as a formatted string | |
int | G_format_timestamp (struct TimeStamp *ts, char *buf) |
Create text string from TimeStamp structure. | |
int | G_scan_timestamp (struct TimeStamp *ts, char *buf) |
Fill a TimeStamp structure from a datetime string. | |
int | G_get_timestamps (struct TimeStamp *ts, DateTime *dt1, DateTime *dt2, int *count) |
copy TimeStamp into [two] Datetimes structs | |
int | G_read_raster_timestamp (char *name, char *mapset, struct TimeStamp *ts) |
Read timestamp from raster map. | |
int | G_remove_raster_timestamp (char *name) |
Only timestamp files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail. | |
int | G_read_vector_timestamp (char *name, char *mapset, struct TimeStamp *ts) |
Read vector timestamp. | |
int | G_remove_vector_timestamp (char *name) |
Is this used anymore with the new GRASS 6 vector engine??? | |
int | G_read_grid3_timestamp (char *name, char *mapset, struct TimeStamp *ts) |
read grid3 timestamp | |
int | G_remove_grid3_timestamp (char *name) |
remove grid3 timestamp | |
int | G_write_raster_timestamp (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 (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_grid3_timestamp (char *name, struct TimeStamp *ts) |
write grid3 timestamp |
#define GRID3 "grid3" |
Definition at line 350 of file timestamp.c.
Referenced by G_read_grid3_timestamp(), G_remove_grid3_timestamp(), and G_write_grid3_timestamp().
#define RAST_MISC "cell_misc" |
Definition at line 348 of file timestamp.c.
Referenced by G_read_raster_timestamp(), G_remove_raster_timestamp(), and G_write_raster_timestamp().
#define VECT_MISC "dig_misc" |
Definition at line 349 of file timestamp.c.
Referenced by G_read_vector_timestamp(), G_remove_vector_timestamp(), and G_write_vector_timestamp().
int G__read_timestamp | ( | FILE * | fd, | |
struct TimeStamp * | ts | |||
) |
int G__write_timestamp | ( | FILE * | fd, | |
struct TimeStamp * | ts | |||
) |
output TimeStamp structure to a file as a formatted string
A handy fd might be "stdout".
Returns: 0 on success -1 error
fd | file descriptor | |
ts | TimeStamp struct |
Definition at line 147 of file timestamp.c.
References G_format_timestamp().
int G_format_timestamp | ( | struct TimeStamp * | ts, | |
char * | buf | |||
) |
Create text string from TimeStamp structure.
Fills string *buf with info from TimeStamp structure *ts in a pretty way. The TimeStamp struct is defined in gis.h and populated with e.g. G_read_raster_timestamp().
Returns: 1 on success -1 error
ts | TimeStamp structure containing time info | |
buf | string to receive formatted timestamp |
Definition at line 173 of file timestamp.c.
Referenced by G__write_timestamp().
int G_get_timestamps | ( | struct TimeStamp * | ts, | |
DateTime * | dt1, | |||
DateTime * | dt2, | |||
int * | count | |||
) |
copy TimeStamp into [two] Datetimes structs
Use to copy the TimeStamp information into Datetimes, as 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
ts | source TimeStamp structure | |
dt1 | first DateTime struct to be filled | |
dt2 | second DateTime struct to be filled | |
count | return code |
Definition at line 261 of file timestamp.c.
void G_init_timestamp | ( | struct TimeStamp * | ts | ) |
int G_read_grid3_timestamp | ( | char * | name, | |
char * | mapset, | |||
struct TimeStamp * | ts | |||
) |
read grid3 timestamp
Returns 1 on success. 0 or negative on error.
name | ||
mapset | ||
ts |
Definition at line 456 of file timestamp.c.
References GRID3.
int G_read_raster_timestamp | ( | char * | name, | |
char * | mapset, | |||
struct TimeStamp * | ts | |||
) |
Read timestamp from raster map.
Returns: 1 on success 0 or negative on error.
name | map name | |
mapset | mapset the map lives in | |
ts | TimeStamp struct to populate |
Definition at line 365 of file timestamp.c.
References RAST_MISC.
int G_read_vector_timestamp | ( | char * | name, | |
char * | mapset, | |||
struct TimeStamp * | ts | |||
) |
Read vector timestamp.
Is this used anymore with the new GRASS 6 vector engine???
Returns 1 on success. 0 or negative on error.
name | ||
mapset | ||
ts |
Definition at line 410 of file timestamp.c.
References VECT_MISC.
int G_remove_grid3_timestamp | ( | char * | name | ) |
remove grid3 timestamp
Only timestamp files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail
name |
Definition at line 479 of file timestamp.c.
References G_remove(), and GRID3.
int G_remove_raster_timestamp | ( | char * | name | ) |
Only timestamp files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail.
name |
Definition at line 388 of file timestamp.c.
References G_remove(), and RAST_MISC.
int G_remove_vector_timestamp | ( | char * | name | ) |
Is this used anymore with the new GRASS 6 vector engine???
Only timestamp files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail
name |
Definition at line 436 of file timestamp.c.
References G_remove(), and VECT_MISC.
int G_scan_timestamp | ( | struct TimeStamp * | ts, | |
char * | buf | |||
) |
Fill a TimeStamp structure from a datetime string.
Populate a TimeStamp structure (defined in gis.h) from a text string. Checks to make sure text string is in valid GRASS datetime format.
Returns: 1 on success -1 error
ts | TimeStamp structure to be populated | |
buf | String containing formatted time info |
Definition at line 212 of file timestamp.c.
References G_init_timestamp(), G_set_timestamp(), and G_set_timestamp_range().
Referenced by G__read_timestamp().
void G_set_timestamp | ( | struct TimeStamp * | ts, | |
DateTime * | dt | |||
) |
void G_set_timestamp_range | ( | struct TimeStamp * | ts, | |
DateTime * | dt1, | |||
DateTime * | dt2 | |||
) |
int G_write_grid3_timestamp | ( | char * | name, | |
struct TimeStamp * | ts | |||
) |
write grid3 timestamp
Returns: 1 on success. -1 error - can't create timestamp file -2 error - invalid datetime in ts
name | ||
ts |
Definition at line 548 of file timestamp.c.
References GRID3.
int G_write_raster_timestamp | ( | char * | name, | |
struct TimeStamp * | ts | |||
) |
Returns: 1 on success. -1 error - can't create timestamp file -2 error - invalid datetime in ts.
name | ||
ts |
Definition at line 501 of file timestamp.c.
References RAST_MISC.
int G_write_vector_timestamp | ( | char * | name, | |
struct TimeStamp * | ts | |||
) |
Returns: 1 on success. -1 error - can't create timestamp file -2 error - invalid datetime in ts.
name | ||
ts |
Definition at line 525 of file timestamp.c.
References VECT_MISC.