Modelled from what the C runtime emits for INPUT BY NAME, not from the
source. Three details that only show up in the real output: Fields is
not null-terminated while Events is, event entries use a lowercase
"event" key rather than "type", and event ids are 1-based.
The dialog is declared once - fields, then the events wanted - and the
client drives it, reporting each event by id. Field values arrive with
the events (the reply's SVS array of FN/FT/T/Value) and accumulate, so
a program reads them by name and field_touched() works.
Nested arrays now carry their own null-termination flag, since MENU and
INPUT disagree about it.