#include <oskit/diskpart/diskpart.h>struct diskpart *diskpart_lookup_bsd_compat(struct diskpart *array, short slice, short part);
This function is a sample lookup routine which finds a partition given a slice number and partition number.This demonstrates how a two-level naming scheme can be implemented using integers. This was first used in Mach 4 (UK22) to provide support for FreeBSD slices as well as backwards-compatibility with previous naming methods.
- array
- This should be the pointer to the start of the array.
- slice
- Slice 0 is used as a `compatibility slice', in that it is aliased to a BSD partition, if it exists. This allows users to not specify the slice for compatibility.
- part
- Partition 0 is used to represent the whole slice, and Partition 0, Slice 0 is the whole drive.
Returns a pointer to the corresponding partition entry, or zero if it is invalid.