GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
xdrchar.c
Go to the documentation of this file.
1/*!
2 \file lib/db/dbmi_base/xdrchar.c
3
4 \brief DBMI Library (base) - external data representation (char)
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 "xdr.h"
14
15/*!
16 \brief ?
17
18 \param d
19
20 \return
21 */
22int db__send_char(int d)
23{
24 int stat = DB_OK;
25 char c = (char)d;
26
27 if (!db__send(&c, sizeof(c)))
29
30 if (stat == DB_PROTOCOL_ERR)
32
33 return stat;
34}
35
36/*!
37 \brief ?
38
39 \param d
40
41 \return
42 */
43int db__recv_char(char *d)
44{
45 int stat = DB_OK;
46
47 if (!db__recv(d, sizeof(*d)))
49
50 if (stat == DB_PROTOCOL_ERR)
52
53 return stat;
54}
int db__recv(void *buf, size_t size)
int db__send(const void *buf, size_t size)
?
#define DB_PROTOCOL_ERR
Definition dbmi.h:73
#define DB_OK
Definition dbmi.h:69
void db_protocol_error(void)
Report protocol error.
int db__send_char(int d)
?
Definition xdrchar.c:22
int db__recv_char(char *d)
?
Definition xdrchar.c:43