GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
incr3.c
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1995. Bill Brown <brown@gis.uiuc.edu> & Michael Shapiro
3
*
4
* This program is free software under the GPL (>=v2)
5
* Read the file GPL.TXT coming with GRASS for details.
6
*/
7
#include <grass/datetime.h>
8
40
int
41
datetime_get_increment_type
(
const
DateTime * dt,
int
*
mode
,
int
*from,
42
int
*to,
int
*fracsec)
43
{
44
if
(!
datetime_is_valid_type
(dt))
45
return
datetime_error_code
();
46
47
*mode = DATETIME_RELATIVE;
48
*to = dt->to;
49
*fracsec = dt->fracsec;
50
51
if
(
datetime_is_absolute
(dt)) {
52
if
(
datetime_in_interval_year_month
(dt->to))
53
*from = DATETIME_YEAR;
54
else
55
*from = DATETIME_DAY;
56
}
57
else
{
58
*from = dt->from;
59
}
60
return
0;
61
}
62
63
85
int
datetime_set_increment_type
(
const
DateTime * src, DateTime * incr)
86
{
87
int
mode
, from, to, fracsec;
88
89
if
(
datetime_get_increment_type
(src, &mode, &from, &to, &fracsec) != 0)
90
return
datetime_error_code
();
91
return
datetime_set_type
(incr, mode, from, to, fracsec);
92
}
lib
datetime
incr3.c
Generated on Sat Oct 5 2013 12:11:08 for GRASS Programmer's Manual by
1.8.4