{# SPDX-License-Identifier: GPL-2.0 #}
{% if annotate %}
	/* member {{ name }} (aggregate array) */
{% endif %}
	{
		struct xdrgen_aggregate_cursor cursor = {
			.xdr = xdr,
			.member_id = {{ member_sym }},
			.ctx = xdr->xdrgen_ctx,
		};
		bool ok = true;

		if (xdr_stream_decode_u32(xdr, &cursor.count) < 0)
			return false;
		if (cursor.count > {{ maxsize }})
			return false;
		if (!{{ hook }}_decode_begin(&cursor))
			return false;
		for (cursor.index = 0; cursor.index < cursor.count; cursor.index++) {
			{{ classifier }}{{ c_type }} element = {};

			if (!xdrgen_decode_{{ type }}(xdr, &element)) {
				ok = false;
				break;
			}
			if (!{{ hook }}_decode(&cursor, &element)) {
				ok = false;
				break;
			}
		}
		if (!{{ hook }}_decode_end(&cursor, ok) || !ok)
			return false;
	}