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
*/
22
int
db__send_char
(
int
d)
23
{
24
int
stat
=
DB_OK
;
25
char
c = (
char
)d;
26
27
if
(!
db__send
(&c,
sizeof
(c)))
28
stat
=
DB_PROTOCOL_ERR
;
29
30
if
(
stat
==
DB_PROTOCOL_ERR
)
31
db_protocol_error
();
32
33
return
stat
;
34
}
35
36
/*!
37
\brief ?
38
39
\param d
40
41
\return
42
*/
43
int
db__recv_char
(
char
*d)
44
{
45
int
stat
=
DB_OK
;
46
47
if
(!
db__recv
(d,
sizeof
(*d)))
48
stat
=
DB_PROTOCOL_ERR
;
49
50
if
(
stat
==
DB_PROTOCOL_ERR
)
51
db_protocol_error
();
52
53
return
stat
;
54
}
AMI_STREAM
Definition
ami_stream.h:153
db__recv
int db__recv(void *buf, size_t size)
Definition
db/dbmi_base/xdr.c:98
db__send
int db__send(const void *buf, size_t size)
?
Definition
db/dbmi_base/xdr.c:87
DB_PROTOCOL_ERR
#define DB_PROTOCOL_ERR
Definition
dbmi.h:73
DB_OK
#define DB_OK
Definition
dbmi.h:69
db_protocol_error
void db_protocol_error(void)
Report protocol error.
Definition
db/dbmi_base/error.c:83
xdr.h
db__send_char
int db__send_char(int d)
?
Definition
xdrchar.c:22
db__recv_char
int db__recv_char(char *d)
?
Definition
xdrchar.c:43
lib
db
dbmi_base
xdrchar.c
Generated on Thu Sep 10 2026 06:57:36 for GRASS 8 Programmer's Manual by
1.9.8