next up previous contents
Next: Providing a Function Up: Function aliasing Previous: Function aliasing   Contents

Using an Aliased Function

To use an aliased function you must first declare it in your interface.ccl file. Declare the prototype as, for example,

CCTK_REAL FUNCTION SumStuff(CCTK_REAL IN x, CCTK_REAL IN y)
and that this function will be either required in your thorn by
REQUIRES FUNCTION SumStuff
or optionally used in your thorn by
USES FUNCTION SumStuff
A prototype of this function will be available to any C routine that includes the cctk.h header file. In a Fortran file, the declaration of the function will be included in the DECLARE_CCTK_FUNCTIONS macro, which is available after the statement #include "cctk_Functions.h". The keywords IN, OUT, and INOUT work in the same fashion as INTENT statements in Fortran 90. That is, the C prototype will expect an argument with intent IN to be a value and one with intent OUT or INOUT to be a pointer. There also exists the ARRAY keyword for passing arrays of any dimension. Functions which are required by some thorn (which doesn't provide it itself) are checked at startup to be provided by some other thorn.


next up previous contents
Next: Providing a Function Up: Function aliasing Previous: Function aliasing   Contents