#include <oskit/diskpart/diskpart.h>int diskpart_get_partition(void *driver_info, int (*diskpart_read_func)(), struct diskpart *array, int array_size, int disk_size);
This function initializes an array of struct diskpart entries. The caller must provide a pointer to a struct diskpart array, and a function to read the disk.
- driver_info
- A pointer to an initialized structure of user-defined type which is passed unmodified to diskpart_read_func.
- diskpart_read_func
- A function pointer provided by the user which can read a sector given driver_info.
- array
- Array of struct diskpart.
- array_size
- integer containing the number of allocated entries in the array.
- disk_size
- Size of the whole disk, in sectors.
Returns an integer count of the number of partition entries that were filled by the library. If there were more partitions found than space available, this will be array_size. Empty partitions (unused entries in a BSD disklabel, for example) occupy an entry the same as `used' entries.For example, a PC-DOS partition with a single filled entry would still report 4 partitions, as that is the size of the DOS partition table.
diskpart_read_func