Tom Lord's Hackery

The .c File Template

Note:

Substrings of the form "@NAME@" should be replaced by a module-specific string.

    /* @THISFILE@: 
     *
     ****************************************************************
     * Copyright (C) @YEAR@ @NAME@
     * 
     * See the file "COPYING" for further information about
     * the copyright and warranty status of this work.
     */
    
    /* Includes
     * 
     * This section should contain exactly (a) those `#include' directives
     * needed to make this file compilable plus (b) an include
     * directive which includes the `.h' file corresponding to this
     * `.c' file.
     * 
     * (Including the `.h' file, while not always strictly necessary,
     * helps to ensure that the definitions in this file agree with
     * the declarations in that file.)
     * 
     * Consequently, there must always be at least one `#include' 
     * directive:
     */

    #include "@HFILE@"

    
    /* Typedefs
     * 
     * Declare structure, union, and enum tags and file-specific
     * `typedef'-s here.   Do /not/ declare structure, union, or 
     * enum types here (only their tags).
     */


    
    /* __STDC__ prototypes for static functions */

    /* This section must contain static declarations for all functions
     * defined as `static' in this file.
     * 
     * \\/NOTE/\\ This section is often deleted and replaced by
     * automatically calculated declarations.  It is therefore vital
     * that this section contain nothing other than such declarations.
     */

    
    /* Type and Global Declarations
     *
     * Declare all types declared in this file and define all
     * global variables used in this file in this section.
     * 
     * Macros used in more than one function should be defined here
     * as well.
     */

    
    /* Code */

    /* This section may be expanded into several pages.
     *
     * Almost always, each page should contain exactly one 
     * function definition.   In exceptional cases, if 
     * a static one or two line "helper function" is needed by only
     * one function in the file, it may be included on the same
     * page as that function, after that function's definition.
     * 
     * (The one-function-per-page rule make the file easier
     * to navigate using the paging commands found in most editors.
     * The rule to put helper functions *after* the function that
     * needs them preserves the property that if the cursor is
     * located near a page separator character, you can probably see the 
     * name of the function defined on the page following that
     * character.)
     * 
     * All but the most trivial functions must use the standard
     * template for `libarch' functions.  That template is separate
     * from this one which is for the overall structure of a `.c'
     * file.
     */

    
    /* arch-tag: @NAME@ @DATE@ (@THISFILE@)
     */

Copyright

Copyright (C) 2004 Tom Lord

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, 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.

See the file COPYING for further information about the copyright and warranty status of this work.