nfs: add licenses into generated files.
[ccan] / ccan / nfs / libnfs-raw-portmap.c
1 /* Licensed under GPLv3+ - see LICENSE file for details */
2 /*
3  * Please do not edit this file.
4  * It was generated using rpcgen.
5  */
6
7 #include "rpc/portmap.h"
8
9 bool_t
10 xdr_mapping (XDR *xdrs, mapping *objp)
11 {
12         register int32_t *buf;
13
14
15         if (xdrs->x_op == XDR_ENCODE) {
16                 buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
17                 if (buf == NULL) {
18                          if (!xdr_u_int (xdrs, &objp->prog))
19                                  return FALSE;
20                          if (!xdr_u_int (xdrs, &objp->vers))
21                                  return FALSE;
22                          if (!xdr_u_int (xdrs, &objp->prot))
23                                  return FALSE;
24                          if (!xdr_u_int (xdrs, &objp->port))
25                                  return FALSE;
26                 } else {
27                         IXDR_PUT_U_LONG(buf, objp->prog);
28                         IXDR_PUT_U_LONG(buf, objp->vers);
29                         IXDR_PUT_U_LONG(buf, objp->prot);
30                         IXDR_PUT_U_LONG(buf, objp->port);
31                 }
32                 return TRUE;
33         } else if (xdrs->x_op == XDR_DECODE) {
34                 buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
35                 if (buf == NULL) {
36                          if (!xdr_u_int (xdrs, &objp->prog))
37                                  return FALSE;
38                          if (!xdr_u_int (xdrs, &objp->vers))
39                                  return FALSE;
40                          if (!xdr_u_int (xdrs, &objp->prot))
41                                  return FALSE;
42                          if (!xdr_u_int (xdrs, &objp->port))
43                                  return FALSE;
44                 } else {
45                         objp->prog = IXDR_GET_U_LONG(buf);
46                         objp->vers = IXDR_GET_U_LONG(buf);
47                         objp->prot = IXDR_GET_U_LONG(buf);
48                         objp->port = IXDR_GET_U_LONG(buf);
49                 }
50          return TRUE;
51         }
52
53          if (!xdr_u_int (xdrs, &objp->prog))
54                  return FALSE;
55          if (!xdr_u_int (xdrs, &objp->vers))
56                  return FALSE;
57          if (!xdr_u_int (xdrs, &objp->prot))
58                  return FALSE;
59          if (!xdr_u_int (xdrs, &objp->port))
60                  return FALSE;
61         return TRUE;
62 }
63
64 bool_t
65 xdr_call_args (XDR *xdrs, call_args *objp)
66 {
67         register int32_t *buf;
68
69
70         if (xdrs->x_op == XDR_ENCODE) {
71                 buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
72                 if (buf == NULL) {
73                          if (!xdr_u_int (xdrs, &objp->prog))
74                                  return FALSE;
75                          if (!xdr_u_int (xdrs, &objp->vers))
76                                  return FALSE;
77                          if (!xdr_u_int (xdrs, &objp->proc))
78                                  return FALSE;
79
80                 } else {
81                 IXDR_PUT_U_LONG(buf, objp->prog);
82                 IXDR_PUT_U_LONG(buf, objp->vers);
83                 IXDR_PUT_U_LONG(buf, objp->proc);
84                 }
85                  if (!xdr_bytes (xdrs, (char **)&objp->args.args_val, (u_int *) &objp->args.args_len, ~0))
86                          return FALSE;
87                 return TRUE;
88         } else if (xdrs->x_op == XDR_DECODE) {
89                 buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
90                 if (buf == NULL) {
91                          if (!xdr_u_int (xdrs, &objp->prog))
92                                  return FALSE;
93                          if (!xdr_u_int (xdrs, &objp->vers))
94                                  return FALSE;
95                          if (!xdr_u_int (xdrs, &objp->proc))
96                                  return FALSE;
97
98                 } else {
99                 objp->prog = IXDR_GET_U_LONG(buf);
100                 objp->vers = IXDR_GET_U_LONG(buf);
101                 objp->proc = IXDR_GET_U_LONG(buf);
102                 }
103                  if (!xdr_bytes (xdrs, (char **)&objp->args.args_val, (u_int *) &objp->args.args_len, ~0))
104                          return FALSE;
105          return TRUE;
106         }
107
108          if (!xdr_u_int (xdrs, &objp->prog))
109                  return FALSE;
110          if (!xdr_u_int (xdrs, &objp->vers))
111                  return FALSE;
112          if (!xdr_u_int (xdrs, &objp->proc))
113                  return FALSE;
114          if (!xdr_bytes (xdrs, (char **)&objp->args.args_val, (u_int *) &objp->args.args_len, ~0))
115                  return FALSE;
116         return TRUE;
117 }