The libfdisk library is used for manipulating with partition tables.
The library is part of the util-linux package since version 2.26 and is available from https://www.kernel.org/pub/linux/utils/util-linux/.