libfdisk: add struct fdisk_partition

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: improve conversion to string

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (bsd) use new get_part() API

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: add new list() columns, cleanup

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (dos) use new list() and get_part() API

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (sgi) use new list() and get_part() API

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (sun) use new list() and get_part() API

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (gpt) remove get_partition_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (bsd) remove get_partition_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (dos) remove get_partition_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (sgi) remove get_partition_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (sun) remove get_partition_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: remove fdisk_get_partition_type()

Let's use more generic:

	fdisk_get_partition()
        fdisk_partition_get_parttype()

rather than fdisk_get_partition_type().

The patch also improves fdisk_get_partition() semantic to allocate
a new partition struct if the argument is NULL.

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: use partition template

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: add support to list free space

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: add reference counting to fdisk_partition

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: add table container

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: move partition stuff to partition.c

Signed-off-by: Karel Zak <kzak@redhat.com>
include/tt: add function to convert table to string

Note that open_memstream() is POSIX-1.2008, so it's possible than not
all libc have already implemented this function.

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: use fdisk_table to generate output

 * add generic fdisk_iter iterator
 * use fdisk_table to convert partition table to human readable output
 * clean up partition.c API (don't use reference to fdisk_context in
   fdisk_partition struct)
 * extern table.c API to use fdisk_iter iterator
 * remove old fdisk_list_partitions()

Signed-off-by: Karel Zak <kzak@redhat.com>