Instead of parsing the complete type on each iteration, move the code
to a helper function. This might be slightly faster, but most
importantly the main loop doesn't need the "structname" and
"separator"
variables after this change.
Signed-off-by: Petr Tesarik <ptesarik(a)suse.cz>