GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
xdrdatetime.c
Go to the documentation of this file.
1
/*!
2
\file lib/db/dbmi_base/xdrdatetime.c
3
4
\brief DBMI Library (base) - external data representation (datatime)
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, Brad Douglas, Markus Neteler
12
\author Doxygenized by Martin Landa <landa.martin gmail.com> (2011)
13
*/
14
15
#include <
grass/dbmi.h
>
16
#include "
macros.h
"
17
18
/*!
19
\brief Send datetime
20
21
\param t pointer to dbDateTime
22
23
\return DB_OK
24
*/
25
int
db__send_datetime
(
dbDateTime
*
t
)
26
{
27
DB_SEND_CHAR
(t->
current
);
28
if
(!t->
current
) {
29
DB_SEND_INT
(t->
year
);
30
DB_SEND_INT
(t->
month
);
31
DB_SEND_INT
(t->
day
);
32
DB_SEND_INT
(t->
hour
);
33
DB_SEND_INT
(t->
minute
);
34
DB_SEND_DOUBLE
(t->
seconds
);
35
}
36
37
return
DB_OK
;
38
}
39
40
/*!
41
\brief Receive datetime
42
43
\param t pointer to dbDateTime
44
45
\return DB_OK
46
*/
47
int
db__recv_datetime
(
dbDateTime
*
t
)
48
{
49
DB_RECV_CHAR
(&t->
current
);
50
if
(!t->
current
) {
51
DB_RECV_INT
(&t->
year
);
52
DB_RECV_INT
(&t->
month
);
53
DB_RECV_INT
(&t->
day
);
54
DB_RECV_INT
(&t->
hour
);
55
DB_RECV_INT
(&t->
minute
);
56
DB_RECV_DOUBLE
(&t->
seconds
);
57
}
58
59
return
DB_OK
;
60
}
db__recv_datetime
int db__recv_datetime(dbDateTime *t)
Receive datetime.
Definition:
xdrdatetime.c:47
DB_SEND_CHAR
#define DB_SEND_CHAR(x)
Definition:
macros.h:23
_db_date_time::minute
int minute
Definition:
dbmi.h:189
DB_SEND_INT
#define DB_SEND_INT(x)
Definition:
macros.h:37
DB_RECV_INT
#define DB_RECV_INT(x)
Definition:
macros.h:39
_db_date_time
Definition:
dbmi.h:182
_db_date_time::hour
int hour
Definition:
dbmi.h:188
DB_RECV_DOUBLE
#define DB_RECV_DOUBLE(x)
Definition:
macros.h:49
db__send_datetime
int db__send_datetime(dbDateTime *t)
Send datetime.
Definition:
xdrdatetime.c:25
dbmi.h
macros.h
t
double t
Definition:
r_raster.c:39
DB_SEND_DOUBLE
#define DB_SEND_DOUBLE(x)
Definition:
macros.h:47
DB_RECV_CHAR
#define DB_RECV_CHAR(x)
Definition:
macros.h:25
_db_date_time::seconds
double seconds
Definition:
dbmi.h:190
_db_date_time::current
char current
Definition:
dbmi.h:184
_db_date_time::month
int month
Definition:
dbmi.h:186
_db_date_time::year
int year
Definition:
dbmi.h:185
_db_date_time::day
int day
Definition:
dbmi.h:187
DB_OK
#define DB_OK
Definition:
dbmi.h:71
lib
db
dbmi_base
xdrdatetime.c
Generated on Mon May 31 2021 05:21:32 for GRASS GIS 7 Programmer's Manual by
1.8.13