GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
Main Page
Related Pages
+
Data Structures
Data Structures
Class Hierarchy
+
Data Fields
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
x
y
+
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
t
u
v
w
y
z
+
Enumerations
a
c
d
e
h
l
m
n
o
p
r
s
t
v
y
+
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
interval.c
Go to the documentation of this file.
1
/*!
2
\file lib/db/dbmi_base/interval.c
3
4
\brief DBMI Library (base) - range, interval procedures
5
6
(C) 1999-2009, 2011 by the GRASS Development Team
7
8
This program is free software under the GNU General Public License
9
(>=v2). Read the file COPYING that comes with GRASS for details.
10
11
\author Joel Jones (CERL/UIUC), Radim Blazek
12
\author Doxygenized by Martin Landa <landa.martin gmail.com> (2011)
13
*/
14
15
#include <
grass/dbmi.h
>
16
17
/*!
18
\brief Define range based on SQL data type
19
20
\param sqltype SQL data type
21
\param[out] from
22
\param[out] to
23
*/
24
void
db_interval_range
(
int
sqltype,
int
*from,
int
*to)
25
{
26
switch
(sqltype) {
27
case
DB_SQL_TYPE_DATE
:
28
*from =
DB_YEAR
;
29
*to =
DB_DAY
;
30
return
;
31
case
DB_SQL_TYPE_TIME
:
32
*from =
DB_HOUR
;
33
*to =
DB_FRACTION
;
34
return
;
35
}
36
37
if
(sqltype &
DB_YEAR
)
38
*from =
DB_YEAR
;
39
else
if
(sqltype &
DB_MONTH
)
40
*from =
DB_MONTH
;
41
else
if
(sqltype &
DB_DAY
)
42
*from =
DB_DAY
;
43
else
if
(sqltype &
DB_HOUR
)
44
*from =
DB_HOUR
;
45
else
if
(sqltype &
DB_MINUTE
)
46
*from =
DB_MINUTE
;
47
else
if
(sqltype &
DB_SECOND
)
48
*from =
DB_SECOND
;
49
else
if
(sqltype &
DB_FRACTION
)
50
*from =
DB_FRACTION
;
51
else
52
*from = 0;
53
54
if
(sqltype & DB_FRACTION)
55
*to =
DB_FRACTION
;
56
else
if
(sqltype & DB_SECOND)
57
*to =
DB_SECOND
;
58
else
if
(sqltype & DB_MINUTE)
59
*to =
DB_MINUTE
;
60
else
if
(sqltype & DB_HOUR)
61
*to =
DB_HOUR
;
62
else
if
(sqltype & DB_DAY)
63
*to =
DB_DAY
;
64
else
if
(sqltype & DB_MONTH)
65
*to =
DB_MONTH
;
66
else
if
(sqltype & DB_YEAR)
67
*to =
DB_YEAR
;
68
else
69
*to = 0;
70
}
DB_SECOND
#define DB_SECOND
Definition:
dbmi.h:102
DB_FRACTION
#define DB_FRACTION
Definition:
dbmi.h:103
DB_HOUR
#define DB_HOUR
Definition:
dbmi.h:100
dbmi.h
DB_DAY
#define DB_DAY
Definition:
dbmi.h:99
DB_YEAR
#define DB_YEAR
Definition:
dbmi.h:97
DB_SQL_TYPE_DATE
#define DB_SQL_TYPE_DATE
Definition:
dbmi.h:88
DB_MONTH
#define DB_MONTH
Definition:
dbmi.h:98
db_interval_range
void db_interval_range(int sqltype, int *from, int *to)
Define range based on SQL data type.
Definition:
interval.c:24
DB_SQL_TYPE_TIME
#define DB_SQL_TYPE_TIME
Definition:
dbmi.h:89
DB_MINUTE
#define DB_MINUTE
Definition:
dbmi.h:101
lib
db
dbmi_base
interval.c
Generated on Mon May 31 2021 05:21:30 for GRASS GIS 7 Programmer's Manual by
1.8.13