GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
incr2.c File Reference
#include <grass/datetime.h>
Include dependency graph for incr2.c:

Go to the source code of this file.

Functions

int datetime_is_valid_increment (const DateTime *src, const DateTime *incr)
 Returns: datetime_check_increment(src, incr) == 0. More...
 
int datetime_check_increment (const DateTime *src, const DateTime *incr)
 This checks if the type of 'incr' is valid for incrementing/decrementing 'src'. The type (mode/from/to) of the 'src' can be anything. The incr.mode must be RELATIVE A timezone in 'src' is allowed - it's presence is ignored. To aid in setting the 'incr' type, see datetime_get_increment_type(). Returns: More...
 

Function Documentation

◆ datetime_check_increment()

int datetime_check_increment ( const DateTime src,
const DateTime incr 
)

This checks if the type of 'incr' is valid for incrementing/decrementing 'src'. The type (mode/from/to) of the 'src' can be anything. The incr.mode must be RELATIVE A timezone in 'src' is allowed - it's presence is ignored. To aid in setting the 'incr' type, see datetime_get_increment_type(). Returns:

  • 0 valid increment
  • 1 src is not a legal DateTime, error code/msg are those set by datetime_is_valid_type()
  • 2 incr is not a legal DateTime, error code/msg are those set by datetime_is_valid_type()
  • -1 incr.mode not relative
  • -2 incr more precise that src
  • -3 illegal incr, must be YEAR-MONTH
  • -4 illegal incr, must be DAY-SECOND
Parameters
src
incr
Returns
int

Definition at line 60 of file incr2.c.

◆ datetime_is_valid_increment()

int datetime_is_valid_increment ( const DateTime src,
const DateTime incr 
)

Returns: datetime_check_increment(src, incr) == 0.

Parameters
src
incr
Returns
int

Definition at line 21 of file incr2.c.