+static void fst_create_memory(wave_dumper_t *wd, fst_data_t *data, int *pos,
+ const fst_dim_t *dims, int ndims, int curdim,
+ enum fstVarDir vd, type_t type, text_buf_t *tb)
+{
+ if (curdim == ndims - 1) {
+ tb_printf(tb, "[%"PRIi64":%"PRIi64"]",
+ dims[curdim].msb, dims[curdim].lsb);
+
+ data->handle[(*pos)++] = fst_create_handle(wd, data, tb_get(tb),
+ vd, type, 0);
+ }
+ else {
+ const size_t pfxlen = tb_len(tb);
+ type_t elem = type_elem(type);
+
+ for (int i = 0; i < dims[curdim].length; i++) {
+ tb_trim(tb, pfxlen);
+ tb_printf(tb, "[%"PRIi64"]",
+ dims[curdim].msb + (dims[curdim].dir == RANGE_TO ? i : -i));
+ fst_create_memory(wd, data, pos, dims, ndims, curdim + 1,
+ vd, elem, tb);
+ }
+ }
+}
+