Next: , Previous: bpipe_matrix_override_delete, Up: Internal Functions


A.5.27 bpipe_matrix_override_new

Create a matrix override structure.

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
BPMatrixOverride *bpipe_matrix_override_new( DpktField *dpktf, BPMatrix *src, size_t src_off[], BPMatrix *dst, size_t dst_off[], size_t extent[] );

Parameters

DpktField *dpktf
data packet field to which matrix descriptor belongs
BPMatrix *src
src matrix
size_t src_off[]
offset of source submatrix to copy to destination. extent is equal to the dimensions of the source matrix.
BPMatrix *dst
destination matrix spec
size_t dst_off[]
offset of destination submatrix. extent is equal to the dimensions of the destination matrix.
size_t extent[]
the extents of the submatrix to copy. the extent of this array is equal to the dimensions of the source matrix.

Description

This routine allocates memory for an output channel matrix override structure. It uses the passed matrix description and offset and extent arrays and directs the BPipe cleanup code to take responsibility for freeing them. The calling procedure should not free them, nor should it pass them to any other BPipe routine which takes responsibility for freeing them. It assumes that the matrix description is legit.

Returns

Upon success it returns a pointer to the newly allocated override structure, else it returns NULL and sets bpipe_errno.

Errors

Upon error bpipe_errno is set to one of the following:

BPENOMEM
a memory allocation failed