Intel® Fortran Compiler 16.0 User and Reference Guide

CFI_setpointer

C function prototype: Updates a C descriptor for a Fortran pointer to be associated with the whole of a given object or to be disassociated.

int CFI_setpointer(CFI_cdesc_t *result, CFI_cdesc_t *source,
                   const CFI_index_t lower_bounds[]);

Formal Parameters:

result

The address of a C descriptor for a Fortran pointer. It is updated using information from the source and lower_bounds arguments.

source

A null pointer or the address of a C descriptor for a nonallocatable nonpointer data object, an allocated allocatable object, or a data pointer object. If source is not a null pointer, the corresponding values of the elem_len, rank, and type members must be the same in the C descriptors with the addresses source and result.

lower_bounds

If source is not a null pointer and source->rank is nonzero, lower_bounds must be a null pointer or the address of an array with at least source->rank elements.

Description

Successful execution of CFI_setpointer updates the base_addr and dim members of the C descriptor with the address result as follows:

Result Value

The result is an error indicator.

Example

If ptr is already the address of a C descriptor for an array pointer of rank 1, the following code updates it to be a C descriptor for a pointer to the same array with lower bound 0:

CFI_index_t lower_bounds[1];
int ind;
lower_bounds[0] = 0;
ind = CFI_setpointer(ptr, ptr, lower_bounds);

See Also