cnfRegp

Register a pointer for use from both C and FORTRAN

Description:

This is a low-level function which will normally only be required if you are implementing your own memory allocation facilities (all memory allocated by cnfCalloc and cnfMalloc is automatically registered using this function).

The function attempts to register a C pointer so that it may be used from both C and FORTRAN. If successful, registration subsequently allows the pointer to be converted into a FORTRAN pointer of type F77_POINTER_TYPE (using cnfFptr), and then back into a C pointer (using cnfCptr). These conversions are possible even if the FORTRAN pointer is stored in a shorter data type than the C pointer.

Not all C pointers may be registered, and registration may fail if the FORTRAN version of the pointer is indistinguishable from that of a pointer which has already been registered. In such a case, a new C pointer must be obtained (e.g. by allocating a different region of memory).

Invocation

result = cnfRegp( cpointer )

Arguments

void cpointer (Given)
The C pointer to be registered.

Returned Value

int cnfRegp
If registration was successful, the function returns 1. If registration was unsuccessful, it returns zero.

Notes: