Next: , Previous: bpipe_matrix_map_delete, Up: Internal Functions


A.5.23 bpipe_matrix_map_dup

duplicate an existing matrix map structure

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
BPMatrixMap *bpipe_matrix_map_dup( BPMatrix *src, BPMatrix *dst, BPMatrixMap *src_map, int create_empty );

Parameters

BPMatrix *src
source matrix spec
BPMatrix *dst
destination matrix spec
BPMatrixMap *src_map
the matrix map to be duplicated
int create_empty
if non zero, allocate and clear memory for NULL map structure entries

Description

this routine creates a new matrix map structure and duplicates all available data in the passed matrix map. if the flag create_empty is non-zero, memory will be allocated and cleared for the NULL entries in the source matrix map.

Returns

it returns a pointer to the new matrix structure upon success. if the passed matrix map pointer is NULL, it returns NULL. upon error bpipe_errno is set and NULL is returned.

Errors

upon error bpipe_errno is set to one of the following errors:

BPEBADARG
the passed argument is bogus or the matrix specification was illegal
BPENOMEM
a memory allocation failed