The Semantics of *

The semantics of * can be targeted to allow type patterns that implement C unions.

The cmds_scanf pattern infrastructure understands * to mean "the rest of the data" and has specific behavior to calculate the length of that remaining data. It can only be used as the last sub-pattern within the outer pattern.

The cmd struct pattern can include an integer that acts as a descriminator. This discriminator determines what 'sub' structure is encoded in the * semantics.

Code could be autogenerated to populate the necessary values (discriminator, final field) in the primary cmd data based on values in the host class, and additionally 'stack' the underlying `cmds_scanf()` calls in the external function call.