Type definitions and structures

The ISO_Fortran_binding.h header file provides the following C type definitions and structures.

CFI_attribute_t

A type that describes the attribute code of a C descriptor. The valid values are as follows:
Table 1. Valid values for CFI_attribute_t
CFI_attribute_pointer CFI_attribute_allocatable CFI_attribute_other

CFI_index_t

A signed long integer type that can describe array subscripts.

CFI_rank_t

An unsigned integer type that can represent values in the range 0 to CFI_MAX_RANK inclusive.

CFI_type_t

A type that describes the type of the object that is described by a C descriptor.

The valid values are as follows:
Table 2. Valid values for CFI_type_t

CFI_type_signed_char
CFI_type_short
CFI_type_int
CFI_type_long
CFI_type_long_long
CFI_type_float
CFI_type_double
CFI_type_long_double
CFI_type_float_Complex
CFI_type_double_Complex
CFI_type_long_double_Complex
CFI_type_Bool
CFI_type_char
CFI_type_cptr
CFI_type_struct
CFI_type_other

CFI_type_size_t
CFI_type_int8_t
CFI_type_int16_t
CFI_type_int32_t
CFI_type_int64_t
CFI_type_int_least8_t
CFI_type_int_least16_t
CFI_type_int_least32_t
CFI_type_int_least64_t
CFI_type_int_fast8_t
CFI_type_int_fast16_t
CFI_type_int_fast32_t
CFI_type_int_fast64_t
CFI_type_intmax_t
CFI_type_intptr_t
CFI_type_ptrdiff_t

CFI_dim_t

A type definition that describes the lower bound, extent, and stride of an array dimension. It contains the following structure members:
CFI_index_t lower_bound
The lower bound of the dimension that is described.
CFI_index_t extent
The number of elements in the dimension that is described.
CFI_index_t sm
The stride of the dimension that is described. The stride is the number of bytes between the beginnings of successive elements along a dimension.

CFI_cdesc_t

A type definition that describes a C descriptor. It contains the following structure members:
void *base_addr
The base address of the data object that is described. For deallocated allocatable objects, base_addr is NULL.
size_t elem_len
  • For scalars: The size in bytes of the data object that is described.
  • For arrays: The size in bytes of one element of the array.
int version
The version number of the C descriptor. Currently, the only valid value is available by using the CFI_VERSION macro.
CFI_attribute_t attribute
The attribute code of the C descriptor. For the valid values for attribute, see Table 1.
CFI_type_t type
The type code of the C descriptor. Describes the type of the object that is described by the C descriptor. For the valid values for type, see Table 2.
CFI_rank_t rank
The rank of the object that is described by the C descriptor. Its value must be in the range 0 ≤ rankCFI_MAX_RANK. A value of 0 indicates that the object is a scalar. Otherwise, the object is an array.
CFI_dim_t dim[]
An array of size rank that describes the lower bound, extent, and stride of each dimension.
There is a reserved area between rank and dim. The size of the reserved area is 12 words in 32-bit mode and 9 words in 64-bit mode.