GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
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
(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 "
xdr.h
"
16
17
/*!
18
\brief ?
19
20
\param d
21
22
\return
23
*/
24
int
db__send_char
(
int
d)
25
{
26
int
stat =
DB_OK
;
27
char
c = (char)d;
28
29
if
(!
db__send
(&c,
sizeof
(c)))
30
stat =
DB_PROTOCOL_ERR
;
31
32
if
(stat ==
DB_PROTOCOL_ERR
)
33
db_protocol_error
();
34
35
return
stat;
36
}
37
38
/*!
39
\brief ?
40
41
\param d
42
43
\return
44
*/
45
int
db__recv_char
(
char
*d)
46
{
47
int
stat =
DB_OK
;
48
49
if
(!
db__recv
(d,
sizeof
(*d)))
50
stat =
DB_PROTOCOL_ERR
;
51
52
if
(stat ==
DB_PROTOCOL_ERR
)
53
db_protocol_error
();
54
55
return
stat;
56
}
db__recv
int db__recv(void *buf, size_t size)
Definition:
db/dbmi_base/xdr.c:100
db__send
int db__send(const void *buf, size_t size)
?
Definition:
db/dbmi_base/xdr.c:89
DB_PROTOCOL_ERR
#define DB_PROTOCOL_ERR
Definition:
dbmi.h:75
DB_OK
#define DB_OK
Definition:
dbmi.h:71
db_protocol_error
void db_protocol_error(void)
Report protocol error.
Definition:
db/dbmi_base/error.c:85
xdr.h
db__send_char
int db__send_char(int d)
?
Definition:
xdrchar.c:24
db__recv_char
int db__recv_char(char *d)
?
Definition:
xdrchar.c:45
lib
db
dbmi_base
xdrchar.c
Generated on Thu Nov 21 2024 07:03:31 for GRASS GIS 8 Programmer's Manual by
1.9.1