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 , CCTK_REAL , CCTK_COMPLEX ,
CCTK_POINTER , or CCTK_POINTER_TO_CONST . 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 either CCTK_INT ,
CCTK_REAL , CCTK_COMPLEX , CCTK_POINTER ,
CCTK_POINTER_TO_CONST , or STRING . All string arguments
must be the last arguments in the list. The intent of each argument,
<intent*>, must be either IN , OUT , or
INOUT . An argument may only be modified if it is declared to
have intent OUT or INOUT . If the argument is an array
then the prefix ARRAY must 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
|