next up previous contents
Next: Source Files Up: Coding Style Previous: GRDOC   Contents

Header Files

Header files should not include any system header file, but should contain in the initial comment a list of system header files which are assumed to have been included before this file is included.

The body of a header should be protected against multiple inclusion by lines of the form

#ifndef _NAMEOFHEADERFILEINCAPITALS_H_
#define _NAMEOFHEADERFILEINCAPITALS_H_ 1

...body of header file...

#endif /* _NAMEOFHEADERFILEINCAPITALS_H_ */

Function prototypes in header files should be protected against C++ linkage by

#ifdef __cplusplus
extern "C" 
{
#endif

...prototypes...

#ifdef __cplusplus
}
#endif

The Cactus header files (cctk_<name>) should only include information relevant for thorn programmers.

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