next up previous contents
Next: Example Up: Advanced Thorn Writing Previous: How to Insert Timers   Contents


Include Files

Cactus provides a mechanism for thorns to add code to include files which can be used by any other thorn. Such include files can contain executable source code, or header/declaration information. A distinction is made between these two cases, since included executable code is protected from being run if a thorn is compiled, but not active by being wrapped by a call to CCTK_IsThornActive.

Any thorn which uses the include file must declare this in its interface.ccl with the line

USES INCLUDE [SOURCE|HEADER]: <file_name>

(If the optional [SOURCE|HEADER] is omitted, HEADER is assumed. Note that this can be dangerous, as included source code, which is incorrectly assumed to be header code, will be executed in another thorn even if the providing thorn is inactive. Thus, it is recommended to always include the optional [SOURCE|HEADER] specification.) Any thorn that wishes to add to this include file, declares in its own interface.ccl

INCLUDE [SOURCE|HEADER]: <file_to_include> in <file_name>



Subsections
next up previous contents
Next: Example Up: Advanced Thorn Writing Previous: How to Insert Timers   Contents