next up previous 252
Next: cnfFptr - Convert a C pointer to a FORTRAN pointer
Up: CNF C Routine Descriptions
Previous: cnfExprta - Export a C string array to a FORTRAN CHARACTER array


cnfExprtap - Export a C array of pointers to char, to a FORTRAN CHARACTER array

Description:
Export a C array of pointers to char to a FORTRAN CHARACTER array. A null character is assumed to terminate each C string - it will not be copied. If the C string is shorter than the space allocated to the FORTRAN string, then pad it with blanks. No more than `dest_len' characters will be copied for each string.

Invocation:
cnfExprtap( source_c, dest_f, dest_len, ndims, dims )

Arguments:

char *const *source_c (Given)
A pointer to the input C array of pointers to char
char *dest_f
A pointer to the output FORTRAN array
int dest_len (Given)
The declared maximum number of characters in a element of the FORTRAN array
int ndims (Given)
The number of dimensions of the arrays
const int *dims (Given)
A pointer to a 1-D array specifying the dimensions of the arrays.

Notes:
The array of pointers to char is assumed to point to null-terminated strings. The dimensions of the array of pointers and the FORTRAN character array must be the same.

Strictly, the input array should be declared as `const char *const *source_c', but this would not allow non-constant char to be given.



next up previous 252
Next: cnfFptr - Convert a C pointer to a FORTRAN pointer
Up: CNF C Routine Descriptions
Previous: cnfExprta - Export a C string array to a FORTRAN CHARACTER array

CNF and F77 Mixed Language Programming -- FORTRAN and C
Starlink User Note 209
P.M. Allan
A.J. Chipperfield
R.F. Warren-Smith
19 January 2000
E-mail:ussc@star.rl.ac.uk