getent: Minor code cleanup

Moved a typedef to the top of the C file, where it belongs.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
getent: Add support for returning a selected member

When using $(getent passwd), we can now return a selected member of the
structure. Without a third argument, we continue working as we did
before, but if a third argument is present, we'll pick out the specified
field.

Requested-by: Fabien Wernli
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
getent: Code cleanup

All the lookup functions were using key->str, so lets pass that alone,
not the whole of key.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
getent: Split into multiple files

For easier maintenance, split tfgetent.c into smaller files.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>