getopt: remove function prototypes

Functions are in right order so they do not need prototypes, with effect
of not needing to keep function argument changes in sync in two locations.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
getopt: add struct getopt_control and remove global variables

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
getopt: use xstrdup rather than malloc + strcpy

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
getopt: make normalize() print strings

A change towards less indirection, and a change to free allocated memory.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
getopt: remove unnecessary code

The control structure is initialized in main().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>