GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
xdrprocedure.c
Go to the documentation of this file.
1 #include "xdr.h"
2 #include "macros.h"
3 
4 
5 /******** client only ***************/
7 {
8  int reply;
9 
10  DB_SEND_INT(procnum);
11  DB_RECV_INT(&reply);
12  if (reply != procnum) {
13  if (reply == 0) {
14  db_noproc_error(procnum);
15  }
16  else {
18  }
19  return DB_PROTOCOL_ERR;
20  }
21 
22  return DB_OK;
23 }
24 
25 /***** driver only *******************/
26 
27 /* return codes:
28  * DB_OK ok
29  * DB_EOF eof from client
30  */
32 {
33  int stat = DB_OK;
34 
35  if (!db__recv(n, sizeof(*n)))
36  stat = DB_EOF;
37 
38  return stat;
39 }
40 
42 {
43  return db__send_int(n);
44 }
45 
47 {
48  return db__send_int(n ? 0 : -1);
49 }
#define DB_SEND_INT(x)
Definition: macros.h:37
#define DB_RECV_INT(x)
Definition: macros.h:39
void db_protocol_error(void)
void db_noproc_error(procnum)
int stat
Definition: g3dcolor.c:369
int db__recv_procnum(int *n)
Definition: xdrprocedure.c:31
int db__send_procedure_not_implemented(int n)
Definition: xdrprocedure.c:46
int db__send_int(int n)
Definition: xdrint.c:4
int db__recv(void *buf, size_t size)
Definition: xdr.c:88
int db__start_procedure_call(int procnum)
Definition: xdrprocedure.c:6
int db__send_procedure_ok(int n)
Definition: xdrprocedure.c:41
int n
Definition: dataquad.c:291
int procnum
Definition: procs.h:34