Adelsbach/VSIPL
Core Light Programming Reference Guide
DD-00014-015
Core Light

5.4 vsip_blockrebind_p - Rebind existing block

vsip_scalar_f* vsip_blockrebind_f(vsip_block_f *p, vsip_scalar_f *d); 
vsip_scalar_i* vsip_blockrebind_i(vsip_block_i *p, vsip_scalar_i *d);
Description

These functions rebind an existing block p to a new user data array d. The new data array must have the same size as the originally bound data array.

The block must be in the released state to be rebound. After rebinding, the block must be admitted before it can be used.

A pointer to the previously bound user data array is returned. If an error occurs, NULL is returned.

Parameters
Return Value
Error Handling

If an error occurs, the function returns NULL.

Example

vsip_block_f *float_block; 
vsip_scalar_f *new_data; 
vsip_scalar_f *old_data; 
 
// Assuming float_block has been properly initialized and is in the released state 
old_data = vsip_blockrebind_f(float_block, new_data); 
 
if (old_data == NULL) { 
    // Handle error 
} 
 
// Admit the block before using it 
int result = vsip_blockadmit_f(float_block, VSIP_TRUE); 
if (result != 0) { 
    // Handle error 
} 
 
vsip_block_i *int_block; 
vsip_scalar_i *new_int_data; 
vsip_scalar_i *old_int_data; 
 
// Assuming int_block has been properly initialized and is in the released state 
old_int_data = vsip_blockrebind_i(int_block, new_int_data); 
 
if (old_int_data == NULL) { 
    // Handle error 
} 
 
// Admit the block before using it 
result = vsip_blockadmit_i(int_block, VSIP_TRUE); 
if (result != 0) { 
    // Handle error 
}