GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
xdrchar.c
Go to the documentation of this file.
1 #include "xdr.h"
2 
3 
4 int db__send_char(int d)
5 {
6  int stat = DB_OK;
7  char c = (char)d;
8 
9  if (!db__send(&c, sizeof(c)))
10  stat = DB_PROTOCOL_ERR;
11 
12  if (stat == DB_PROTOCOL_ERR)
14 
15  return stat;
16 }
17 
18 
19 int db__recv_char(char *d)
20 {
21  int stat = DB_OK;
22 
23  if (!db__recv(d, sizeof(*d)))
24  stat = DB_PROTOCOL_ERR;
25 
26  if (stat == DB_PROTOCOL_ERR)
28 
29  return stat;
30 }
int db__send(const void *buf, size_t size)
Definition: xdr.c:77
void db_protocol_error(void)
int stat
Definition: g3dcolor.c:369
int db__send_char(int d)
Definition: xdrchar.c:4
int db__recv(void *buf, size_t size)
Definition: xdr.c:88
int db__recv_char(char *d)
Definition: xdrchar.c:19