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 */
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 */
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}
Main header of GRASS DataBase Management Interface.
#define DB_OK
Definition dbmi.h:69
#define DB_SEND_CHAR(x)
Definition macros.h:50
#define DB_RECV_CHAR(x)
Definition macros.h:55
#define DB_RECV_DOUBLE(x)
Definition macros.h:109
#define DB_SEND_INT(x)
Definition macros.h:82
#define DB_RECV_INT(x)
Definition macros.h:87
#define DB_SEND_DOUBLE(x)
Definition macros.h:104
double t
Definition r_raster.c:37
int db__recv_datetime(dbDateTime *t)
Receive datetime.
Definition xdrdatetime.c:45
int db__send_datetime(dbDateTime *t)
Send datetime.
Definition xdrdatetime.c:23