next up previous contents
Next: Naming Conventions Up: Coding Style Previous: Header Files   Contents

Source Files

Source files should have as their first lines after all the include files:

static const char 6#6 const rcsid = "$Header$";
CCTK_FILEVERSION(7#7source file8#8); or the expanded rcs version of this. The macro CCTK_FILEVERSION is simply there to prevent compiler warnings, and 7#7source file8#8 should be replaced by

  • Flesh: 7#7directory8#8_7#7core filename8#8_7#7extension8#8 (e.g. main_Groups_c)

  • Thorn: 7#7arrangement8#8_7#7thorn8#8_7#7core filename8#8_7#7extension8#8
    (e.g. CactusBase_CartGrid3D_CartGrid3D_c)

Globally visable functions should appear before local functions.

(NOTE: currently the schedule stuff is a good example of what I'm coming to like as a style, e.g. src/main/ScheduleInterface.c )

There is a template file in the doc/MaintGuide directory.