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/struct/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, &ptr->{{ name }}.count) < 0)
 6		return false;
 7{% if maxsize != "0" %}
 8	if (ptr->{{ name }}.count > {{ maxsize }})
 9		return false;
10{% endif %}
11	for (u32 i = 0; i < ptr->{{ name }}.count; i++)
12		if (!xdrgen_decode_{{ type }}(xdr, &ptr->{{ name }}.element[i]))
13			return false;
~/ Read-only file preview.