qvm_slice()

Given a starting offset and length, calculate the resulting slice array according to a descriptor array

Synopsis:

#include <qvm/utils.h>
unsigned qvm_slice(unsigned offset,
                   unsigned len,
                   const struct qvm_slice_descriptor *desc,
                   struct qvm_slice_result *slices)

Arguments:

offset
The starting offset.
len
The length, in bytes.
desc
A pointer to a descriptor array that specifies how to slice the data at offset for len.
slices
A pointer to where to store the slice result entries.

Library:

Provided by qvm; no external library is required.

Description:

For more information, see the Virtual Device Developer's Guide.

Returns:

The number of slice result entries that were generated.