#include <oskit/diskpart/diskpart.h>int diskpart_get_type(struct diskpart *array, char *buf, int start, void *driver_info, int (*diskpart_read_func)(), int max_part);
This function finds type type partitions if they are on the disk. These routines would not normally be invoked directly. However, the API is documented here so that diskpart_lookup can be extended easily for future or additional labeling schemes.Currently defined functions are: pcbios, disklabel, vtoc, dec, and omron.
They should return immediately if diskpart_read_func returns non-zero, and return that error code.
- array
- Pointer to the start of preallocated storage.
- buf
- Pointer to a sector-sized scratch area.
- start
- Offset from start of disk the partition starts.
- 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.
- max_part
- Maximum number of partition entries that can be filled. This will generally be equal to the number of pre-allocated entries that are available.
Returns the number of partition entries of that type found. If none were found, it returns 0.If the return value is equal to max_part then it is possible that there were more partitions than space for them. It is up to the user to ensure that adequate storage is passed to diskpart_get_partitions.
diskpart_read_func