File Index
Files and directories
Sign in
FILE

variable_length_array.j2

File preview with syntax highlighting.

linux-6.19.14/tools/net/sunrpc/xdrgen/templates/C/union/decoder/variable_length_array.j2 PLAIN TEXT
 1{# SPDX-License-Identifier: GPL-2.0 #}
 2{% if annotate %}
 3		/* member {{ name }} (variable-length array) */
 4{% endif %}
 5		if (xdr_stream_decode_u32(xdr, &count) < 0)
 6			return false;
 7{% if maxsize != "0" %}
 8		if (count > {{ maxsize }})
 9			return false;
10{% endif %}
11		for (u32 i = 0; i < count; i++) {
12			if (xdrgen_decode_{{ type }}(xdr, &ptr->{{ name }}.items[i]) < 0)
13				return false;
14		}
15		ptr->{{ name }}.len = count;
~/ Read-only file preview.