D.3. Application Code Documentation

The application code documentation includes:

D.3.1. Standard Header

The application source file must begin with a standard header that includes the General Public License (GPL) statement, which should be used where possible (see Section 1.1, “Licence Information”). The header is shown below. The first few lines are specific to each source file, the remainder are constant:

/********************************************************************
** @source ApplicationName
**
** ShortDescription
**
** @author Copyright (C) Year AuthorName
** @version VersionNumber  description of version
** @modified EditDate  EditorName  description of edit
** @@
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
** 
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
** 
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
********************************************************************/

Where:

  • ApplicationName is the name of the application.

  • ShortDescription is a short description of the application, which should be identical to the text given after the documentation: attribute in the application ACD file and in the main() function documentation (see below).

  • Year is the year of first release and AuthorName is the original author.

  • VersionNumber is the version number and may be followed by an optional description.

  • EditDate and EditorName are the date and author of the last significant edit and may be followed by an optional description of the revision. The header may contain as many of these lines as required.

For example:

/* @source water 
**
** Smith-Waterman local alignment
** 
** @author: Copyright (C) Alan Bleasby
** @@
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
******************************************************************************

D.3.2. main() Function

This should be preceded by a header block matching the following format:

/* @prog  ApplicationName ****************************************************************
**
** ShortDescription
**
******************************************************************************/

Where

  • ApplicationName is the name of the application.

  • ShortDescription is a short description of the application, which should be identical to the text given after the documentation: attribute in the application ACD file and in the application code standard header (see above).

For example:

/* @prog water ****************************************************************
**
** Smith-Waterman local alignment
**
******************************************************************************/

D.3.3. Application Datatypes and Functions

Application functions and datatypes are documented in exactly the same way as library code (see below). Structured comments should (ideally) be used but are not strictly required. Otherwise, use general C-style comments.