GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
xdrprocedure.c
Go to the documentation of this file.
1/*!
2 \file lib/db/dbmi_base/xdrprocedure.c
3
4 \brief DBMI Library (base) - external data representation (procedure)
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#include "macros.h"
15
16/*!
17 \brief ? (client only)
18
19 \param procnum
20
21 \return
22 */
24{
25 int reply;
26
29 if (reply != procnum) {
30 if (reply == 0) {
32 }
33 else {
35 }
36 return DB_PROTOCOL_ERR;
37 }
38
39 return DB_OK;
40}
41
42/*!
43 \brief ? (driver only)
44
45 \param n
46
47 \return DB_OK ok
48 \return DB_EOF eof from client
49 */
51{
52 int stat = DB_OK;
53
54 if (!db__recv(n, sizeof(*n)))
55 stat = DB_EOF;
56
57 return stat;
58}
59
60/*!
61 \brief ?
62
63 \param n
64
65 \return
66 */
68{
69 return db__send_int(n);
70}
71
72/*!
73 \brief ?
74
75 \param n
76
77 \return
78 */
80{
81 return db__send_int(n ? 0 : -1);
82}
int db__recv(void *buf, size_t size)
#define DB_PROTOCOL_ERR
Definition dbmi.h:73
#define DB_EOF
Definition dbmi.h:74
#define DB_OK
Definition dbmi.h:69
int db__send_int(int)
Send integer.
Definition xdrint.c:22
void db_noproc_error(int)
Report no procedure error.
void db_protocol_error(void)
Report protocol error.
#define DB_SEND_INT(x)
Definition macros.h:82
#define DB_RECV_INT(x)
Definition macros.h:87
int procnum
Definition procs.h:33
int db__send_procedure_ok(int n)
?
int db__recv_procnum(int *n)
? (driver only)
int db__send_procedure_not_implemented(int n)
?
int db__start_procedure_call(int procnum)
? (client only)