timestamp.c File Reference

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

Include dependency graph for timestamp.c:

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)
int G_format_timestamp (struct TimeStamp *ts, char *buf)
 Returns: 1 on success -1 error.
int G_scan_timestamp (struct TimeStamp *ts, char *buf)
 Returns: 1 on success -1 error.
int G_get_timestamps (struct TimeStamp *ts, DateTime *dt1, DateTime *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 copiedcopy TimeStamp into Datetimes.
int G_read_raster_timestamp (char *name, char *mapset, struct TimeStamp *ts)
 Returns 1 on success. 0 or negative on error.Read raster timestamp.
int G_remove_raster_timestamp (char *name)
 Only 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)
 Returns 1 on success. 0 or negative on error.Read vector timestamp.
int G_remove_vector_timestamp (char *name)
 Only files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail.
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 Documentation

#define GRID3   "grid3"

Definition at line 309 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 307 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 308 of file timestamp.c.

Referenced by G_read_vector_timestamp(), G_remove_vector_timestamp(), and G_write_vector_timestamp().


Function Documentation

int G__read_timestamp ( FILE *  fd,
struct TimeStamp *  ts 
)

Definition at line 56 of file timestamp.c.

References G_scan_timestamp().

int G__write_timestamp ( FILE *  fd,
struct TimeStamp *  ts 
)

Definition at line 70 of file timestamp.c.

References fprintf(), and G_format_timestamp().

int G_format_timestamp ( struct TimeStamp *  ts,
char *  buf 
)

Returns: 1 on success -1 error.

Returns: 1 on success -1 error

Parameters:
ts 
buf 
Returns:
int

Definition at line 105 of file timestamp.c.

Referenced by G__write_timestamp().

int G_get_timestamps ( struct TimeStamp *  ts,
DateTime *  dt1,
DateTime *  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 copiedcopy TimeStamp into Datetimes.

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

Parameters:
ts 
dt1 
dt2 
count 
Returns:
int

Definition at line 221 of file timestamp.c.

void G_init_timestamp ( struct TimeStamp *  ts  ) 

Definition at line 36 of file timestamp.c.

Referenced by G_scan_timestamp().

int G_read_grid3_timestamp ( char *  name,
char *  mapset,
struct TimeStamp *  ts 
)

read grid3 timestamp

Returns 1 on success. 0 or negative on error.

Parameters:
name 
mapset 
ts 
Returns:
int

Definition at line 462 of file timestamp.c.

References GRID3.

int G_read_raster_timestamp ( char *  name,
char *  mapset,
struct TimeStamp *  ts 
)

Returns 1 on success. 0 or negative on error.Read raster timestamp.

Returns 1 on success. 0 or negative on error.

Parameters:
name 
mapset 
ts 
Returns:
int

Definition at line 335 of file timestamp.c.

References RAST_MISC.

int G_read_vector_timestamp ( char *  name,
char *  mapset,
struct TimeStamp *  ts 
)

Returns 1 on success. 0 or negative on error.Read vector timestamp.

Returns 1 on success. 0 or negative on error.

Parameters:
name 
mapset 
ts 
Returns:
int

Definition at line 404 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

Parameters:
name 
Returns:
int

Definition at line 486 of file timestamp.c.

References G_remove(), and GRID3.

int G_remove_raster_timestamp ( char *  name  ) 

Only files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail.

Only timestamp files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail

Parameters:
name 
Returns:
int

Definition at line 372 of file timestamp.c.

References G_remove(), and RAST_MISC.

int G_remove_vector_timestamp ( char *  name  ) 

Only files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail.

Only timestamp files in current mapset can be removed Returns: 0 if no file 1 if successful -1 on fail

Parameters:
name 
Returns:
int

Definition at line 441 of file timestamp.c.

References G_remove(), and VECT_MISC.

int G_scan_timestamp ( struct TimeStamp *  ts,
char *  buf 
)

Returns: 1 on success -1 error.

Returns: 1 on success -1 error

Parameters:
ts 
buf 
Returns:
int

Definition at line 154 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 
)

Definition at line 41 of file timestamp.c.

Referenced by G_scan_timestamp().

void G_set_timestamp_range ( struct TimeStamp *  ts,
DateTime *  dt1,
DateTime *  dt2 
)

Definition at line 47 of file timestamp.c.

Referenced by G_scan_timestamp().

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

Parameters:
name 
ts 
Returns:
int

Definition at line 582 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.

Returns: 1 on success. -1 error - can't create timestamp file -2 error - invalid datetime in ts

Parameters:
name 
ts 
Returns:
int

Definition at line 521 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.

Returns: 1 on success. -1 error - can't create timestamp file -2 error - invalid datetime in ts

Parameters:
name 
ts 
Returns:
int

Definition at line 558 of file timestamp.c.

References VECT_MISC.


Generated on Wed Aug 23 17:50:01 2006 for GRASS by  doxygen 1.4.7