GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-f63024f571
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)
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)
54 
55  return stat;
56 }
int db__recv(void *buf, size_t size)
int db__send(const void *buf, size_t size)
?
#define DB_PROTOCOL_ERR
Definition: dbmi.h:75
#define DB_OK
Definition: dbmi.h:71
void db_protocol_error(void)
Report protocol error.
int db__send_char(int d)
?
Definition: xdrchar.c:24
int db__recv_char(char *d)
?
Definition: xdrchar.c:45