next up previous 252
Next: cnfCopyf - Copy one FORTRAN string to another FORTRAN string
Up: CNF C Routine Descriptions
Previous: CNF C Routine Descriptions


cnfCalloc - Allocate space that may be accessed from C and FORTRAN

Description:
This function allocates space in the same way as the standard C calloc() function, except that the pointer to the space allocated is automatically registered (using cnfRegp) for use from both C and FORTRAN. This means that the returned pointer may subsequently be converted into a FORTRAN pointer of type F77_POINTER_TYPE (using cnfFptr) and back into a C pointer (using cnfCptr). The contents of the space may therefore be accessed from both languages.

Invocation:
cpointer = cnfCalloc( nobj, size );

Arguments:

size_t nobj (Given)
The number of objects for which space is required.
size_t size (Given)
The size of each object.

Returned Value:

void *cnfCalloc
A registered pointer to the allocated space, or NULL if the space could not be allocated.

Notes:



next up previous 252
Next: cnfCopyf - Copy one FORTRAN string to another FORTRAN string
Up: CNF C Routine Descriptions
Previous: CNF C Routine Descriptions

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