Next: , Previous: write_hdrf_def, Up: Internal Functions


A.5.59 xmap_compact

Compact a list of transformation maps

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
static Xmap *xmap_compact(size_t *nmap);

Parameters

size_t *nmap
the number of elements in the resultant Xmap array

Description

xmap_compact operates on the file global linked list xmap_ll. This list consists of Xmap structures which specify the copy operations required to map between two data packet images. xmap_compact combines contigous copy operations. xmap_ll must contain at least one element.

xmap_ll is deleted after it is processed, even upon error.

Returns

On error it returns NULL and sets bpipe_errno, else it returns a pointer to an array of Xmap structures which define the transformations. It returns the length of the array via the parameter nmap.

Errors

Upon error bpipe_errno is set to one of the following:

BPEBADARG
the list had no entries.
BPENOMEM
a memory allocation failed