Next: Variable blocks
Up: interface.ccl
Previous: Include files
Contents
Function aliasing
If any aliased function is to be used or provided by the thorn then
the prototype must be declared with the form:
<return_type> FUNCTION <alias>(<arg1_type> <intent1> [ARRAY] <arg1>, ...)
The <return_type> must be either void, CCTK_INT
or CCTK_REAL. The keyword SUBROUTINE is equivalent to
void FUNCTION. The name of the aliased function <alias>
must contain at least one uppercase and one lowercase letter and
follow the C standard for function names. The type of each argument,
<arg*_type> must be a CCTK type in
INT,REAL,STRING,POINTER. The intent of each argument,
<intent*> must be either IN or OUT. An argument
should only be modified if it is declared to have intent
OUT. If the argument is an array then the prefix ARRAY
should also be given.
If the argument <arg*> is a function pointer then the argument
itself (which will preceded by the return type) should be
CCTK_FPOINTER <function_arg1>(<arg1_type> <intent1> <arg1>, ...)
Function pointers may not be nested.
If an aliased function is to be required then the block
REQUIRES FUNCTION <alias>
is required.
If an aliased function is to be (optionally) used then the block
USES FUNCTION <alias>
is required.
If a function is provided then the block
PROVIDES FUNCTION <alias> WITH <provider> LANGUAGE <providing_language>
is required. As with the alias name, <provider> must contain at
least one uppercase and one lowercase letter and follow the C standard
for function names. Currently the only supported values of
<providing_language> are C and Fortran.
Next: Variable blocks
Up: interface.ccl
Previous: Include files
Contents
|