FX-ALPHA C and C++ Header Templates

3/3/98

David H. Leserman


Introduction

Header comment templates are provided for

In the following templates, instructions to the coder are enclosed in angle brackets (<>). You are expected to replace the string <filename> with the name of the file and to delete other <instructions>, replacing them with comments or code as appropriate.

Many templates include labelled documentation sections. These labelled sections allow for automated extraction of documentation for inclusion in FrameMaker documents. Each labelled section is introduced by one or more label lines. For example, in the partial template for function.c (below), the first two lines are label lines:

Where there are multiple label lines, you are expected to delete all but the most appropriate one.

The following line places an RCS identification string into the file and assigns that string into a variable with a unique name.

static const char* const <filename>_h_Id =
  "$Id$";

This technique identifies the source file and all files which contain the code. Use the ident command. For example, if <filename> is replaced by demonstrateId and we use this file in building an executable named demonstrateId,

ident demonstrateId

will produce output including the following line.


file.h

The template for a C include file follows. A carriage return and nothing else must follow the #endif.


file.c

The template for a C implementation file follows.


function.c

The template for a C function follows. Choose one label line.


File.H

The template for a C++ include file follows. A C++ include file generally contains the declaration of one class.

A carriage return and nothing else must follow the #endif.


File.C

The template for a C++ implementation file follows. A C++ implementation file generally contains the member functions for one class.


function.C

The template for a C++ member function follows. Choose one label line.