xref: /linux/tools/net/sunrpc/xdrgen/templates/C/program/encoder/result.j2 (revision 55d0969c451159cff86949b38c39171cab962069)
1{# SPDX-License-Identifier: GPL-2.0 #}
2
3/**
4 * {{ program }}_svc_encode_{{ result }} - Encode a {{ result }} result
5 * @rqstp: RPC transaction context
6 * @xdr: target XDR data stream
7 *
8 * Return values:
9 *   %true: procedure results encoded successfully
10 *   %false: encode failed
11 */
12bool {{ program }}_svc_encode_{{ result }}(struct svc_rqst *rqstp, struct xdr_stream *xdr)
13{
14{% if result == 'void' %}
15	return xdrgen_encode_void(xdr);
16{% else %}
17	struct {{ result }} *resp = rqstp->rq_resp;
18
19	return xdrgen_encode_{{ result }}(xdr, resp);
20{% endif %}
21}
22