GRASS 8 Programmer's Manual
8.6.0dev(2026)-c83afef6d3
Loading...
Searching...
No Matches
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
SPDX-FileCopyrightText: 1999-2009, 2011 GRASS Development Team
7
SPDX-License-Identifier: GPL-2.0-or-later
8
9
\author Joel Jones (CERL/UIUC), Radim Blazek, Brad Douglas, Markus Neteler
10
\author Doxygenized by Martin Landa <landa.martin gmail.com> (2011)
11
*/
12
13
#include <
grass/dbmi.h
>
14
#include "
macros.h
"
15
16
/*!
17
\brief Send datetime
18
19
\param t pointer to dbDateTime
20
21
\return DB_OK
22
*/
23
int
db__send_datetime
(
dbDateTime
*
t
)
24
{
25
DB_SEND_CHAR
(
t
->current);
26
if
(!
t
->current) {
27
DB_SEND_INT
(
t
->year);
28
DB_SEND_INT
(
t
->month);
29
DB_SEND_INT
(
t
->day);
30
DB_SEND_INT
(
t
->hour);
31
DB_SEND_INT
(
t
->minute);
32
DB_SEND_DOUBLE
(
t
->seconds);
33
}
34
35
return
DB_OK
;
36
}
37
38
/*!
39
\brief Receive datetime
40
41
\param t pointer to dbDateTime
42
43
\return DB_OK
44
*/
45
int
db__recv_datetime
(
dbDateTime
*
t
)
46
{
47
DB_RECV_CHAR
(&
t
->current);
48
if
(!
t
->current) {
49
DB_RECV_INT
(&
t
->year);
50
DB_RECV_INT
(&
t
->month);
51
DB_RECV_INT
(&
t
->day);
52
DB_RECV_INT
(&
t
->hour);
53
DB_RECV_INT
(&
t
->minute);
54
DB_RECV_DOUBLE
(&
t
->seconds);
55
}
56
57
return
DB_OK
;
58
}
dbmi.h
Main header of GRASS DataBase Management Interface.
DB_OK
#define DB_OK
Definition
dbmi.h:69
macros.h
DB_SEND_CHAR
#define DB_SEND_CHAR(x)
Definition
macros.h:50
DB_RECV_CHAR
#define DB_RECV_CHAR(x)
Definition
macros.h:55
DB_RECV_DOUBLE
#define DB_RECV_DOUBLE(x)
Definition
macros.h:109
DB_SEND_INT
#define DB_SEND_INT(x)
Definition
macros.h:82
DB_RECV_INT
#define DB_RECV_INT(x)
Definition
macros.h:87
DB_SEND_DOUBLE
#define DB_SEND_DOUBLE(x)
Definition
macros.h:104
t
double t
Definition
r_raster.c:37
_db_date_time
Definition
dbmi.h:175
db__recv_datetime
int db__recv_datetime(dbDateTime *t)
Receive datetime.
Definition
xdrdatetime.c:45
db__send_datetime
int db__send_datetime(dbDateTime *t)
Send datetime.
Definition
xdrdatetime.c:23
lib
db
dbmi_base
xdrdatetime.c
Generated on Fri Sep 11 2026 06:57:47 for GRASS 8 Programmer's Manual by
1.9.8