| 1 |
#include <stdlib.h> |
| 2 |
#include <stdio.h> |
| 3 |
#include <inttypes.h> |
| 4 |
#include <ISO_Fortran_binding.h> |
| 5 |
|
| 6 |
extern void fsub(CFI_cdesc_t *); |
| 7 |
|
| 8 |
int main(void) |
| 9 |
{ |
| 10 |
int8_t x[] = {1,2,3,4}; |
| 11 |
int N = sizeof(x)/sizeof(x[0]); |
| 12 |
|
| 13 |
CFI_CDESC_T(1) dat; |
| 14 |
CFI_index_t ext[1]; |
| 15 |
ext[0] = (CFI_index_t)N; |
| 16 |
int rc = CFI_establish((CFI_cdesc_t *)&dat, &x, CFI_attribute_other, |
| 17 |
CFI_type_int8_t, 0, (CFI_rank_t)1, ext); |
| 18 |
printf("CFI_establish call returned: %d\n", rc); |
| 19 |
|
| 20 |
fsub((CFI_cdesc_t *)&dat ); |
| 21 |
|
| 22 |
for (int i=0; i<N; i++) |
| 23 |
printf("%"PRId8"\n", x[i]); |
| 24 |
return 0; |
| 25 |
} |