GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Go to the source code of this file.
Macros | |
#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, const DateTime *dt) |
void | G_set_timestamp_range (struct TimeStamp *ts, const DateTime *dt1, const DateTime *dt2) |
int | G__read_timestamp (FILE *fd, struct TimeStamp *ts) |
int | G__write_timestamp (FILE *fd, const struct TimeStamp *ts) |
output TimeStamp structure to a file as a formatted string More... | |
int | G_format_timestamp (const struct TimeStamp *ts, char *buf) |
Create text string from TimeStamp structure. More... | |
int | G_scan_timestamp (struct TimeStamp *ts, const char *buf) |
Fill a TimeStamp structure from a datetime string. More... | |
int | G_get_timestamps (const struct TimeStamp *ts, DateTime *dt1, DateTime *dt2, int *count) |
copy TimeStamp into [two] Datetimes structs More... | |
int | G_read_raster_timestamp (const char *name, const char *mapset, struct TimeStamp *ts) |
Read timestamp from raster map. More... | |
int | G_remove_raster_timestamp (const char *name) |
Only timestamp files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail. More... | |
int | G_read_vector_timestamp (const char *name, const char *mapset, struct TimeStamp *ts) |
Read vector timestamp. More... | |
int | G_remove_vector_timestamp (const char *name) |
Is this used anymore with the new GRASS 6 vector engine??? More... | |
int | G_read_grid3_timestamp (const char *name, const char *mapset, struct TimeStamp *ts) |
read grid3 timestamp More... | |
int | G_remove_grid3_timestamp (const char *name) |
remove grid3 timestamp More... | |
int | G_write_raster_timestamp (const char *name, const struct TimeStamp *ts) |
Returns: 1 on success. -1 error - can't create timestamp file -2 error - invalid datetime in ts. More... | |
int | G_write_vector_timestamp (const char *name, const struct TimeStamp *ts) |
Returns: 1 on success. -1 error - can't create timestamp file -2 error - invalid datetime in ts. More... | |
int | G_write_grid3_timestamp (const char *name, const struct TimeStamp *ts) |
write grid3 timestamp More... | |
#define GRID3 "grid3" |
Definition at line 329 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 327 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 328 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 | ||
) |
Definition at line 118 of file timestamp.c.
References buf, and G_scan_timestamp().
int G__write_timestamp | ( | FILE * | fd, |
const 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 145 of file timestamp.c.
References buf, and G_format_timestamp().
int G_format_timestamp | ( | const 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 171 of file timestamp.c.
References datetime_format(), and sprintf().
Referenced by G__write_timestamp(), and G_site_put_head().
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 252 of file timestamp.c.
References datetime_copy().
void G_init_timestamp | ( | struct TimeStamp * | ts | ) |
Definition at line 99 of file timestamp.c.
Referenced by G_scan_timestamp().
int G_read_grid3_timestamp | ( | const char * | name, |
const char * | mapset, | ||
struct TimeStamp * | ts | ||
) |
read grid3 timestamp
Returns 1 on success. 0 or negative on error.
name | |
mapset | |
ts |
Definition at line 421 of file timestamp.c.
References GRID3.
int G_read_raster_timestamp | ( | const char * | name, |
const 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 344 of file timestamp.c.
References RAST_MISC.
int G_read_vector_timestamp | ( | const char * | name, |
const 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 382 of file timestamp.c.
References VECT_MISC.
int G_remove_grid3_timestamp | ( | const 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 440 of file timestamp.c.
References G_remove_misc(), and GRID3.
int G_remove_raster_timestamp | ( | const 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 363 of file timestamp.c.
References G_remove_misc(), and RAST_MISC.
int G_remove_vector_timestamp | ( | const 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 404 of file timestamp.c.
References G_remove_misc(), and VECT_MISC.
int G_scan_timestamp | ( | struct TimeStamp * | ts, |
const 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 207 of file timestamp.c.
References datetime_scan(), G_init_timestamp(), G_set_timestamp(), and G_set_timestamp_range().
Referenced by G__read_timestamp(), G_site_get_head(), and G_site_put_head().
void G_set_timestamp | ( | struct TimeStamp * | ts, |
const DateTime * | dt | ||
) |
Definition at line 104 of file timestamp.c.
References datetime_copy().
Referenced by G_scan_timestamp().
void G_set_timestamp_range | ( | struct TimeStamp * | ts, |
const DateTime * | dt1, | ||
const DateTime * | dt2 | ||
) |
Definition at line 110 of file timestamp.c.
References datetime_copy().
Referenced by G_scan_timestamp().
int G_write_grid3_timestamp | ( | const char * | name, |
const 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 496 of file timestamp.c.
References GRID3.
int G_write_raster_timestamp | ( | const char * | name, |
const 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 459 of file timestamp.c.
References RAST_MISC.
Referenced by IL_output_2d().
int G_write_vector_timestamp | ( | const char * | name, |
const 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 478 of file timestamp.c.
References VECT_MISC.