Scope

Identification

This configuration management plan document provides the guidelines for development and maintenance of the Common UNIX Printing System ("CUPS") Version 1.1 software.

Document Overview

This configuration management document is organized into the following sections:

File Management

Directory Structure

Each source file shall be placed a sub-directory corresponding to the software sub-system it belongs to ("scheduler", "cups", etc.) To remain compatible with older UNIX filesystems, directory names shall not exceed 16 characters in length.

Source Files

Source files shall be documented and formatted as described in Appendix B, Coding Requirements.

Configuration Management

Source files shall be placed under the control of the Concurrent Versions System ("CVS") software. Source files shall be "checked in" with each change so that modifications can be tracked.

Documentation on the CVS software is included with the whitepaper, "CVS II: Parallelizing Software Development".

Trouble Report Processing

A Software Trouble Report ("STR") shall be submitted every time a user or vendor experiences a problem with the CUPS software. Trouble reports are maintained in a database with one of the following states:
  1. STR is closed with complete resolution
  2. STR is closed without resolution
  3. STR is active
  4. STR is pending (new STR or additional information available)
Trouble reports shall be processed using the following steps.

Classification

When a trouble report is received it must be classified at one of the following levels:
  1. Request for enhancement
  2. Documentation error
  3. Unable to print a file
  4. Unable to print to a printer
  5. Unable to print at all
The scope of the problem should also be determined as:
  1. Specific to a machine
  2. Specific to an operating system
  3. Applies to all machines and operating systems

Identification

Once the level and scope of the trouble report is determined the software sub-system(s) involved with the problem are determined. This may involve additional communication with the user or vendor to isolate the problem to a specific cause.

When the sub-system(s) involved have been identified, an engineer will then determine the change(s) needed and estimate the time required for the change(s).

Correction

Corrections are scheduled based upon the severity and complexity of the problem. Once all changes have been made, documented, and tested successfully a new software release snapshot is generated. Additional tests are added as necessary for proper testing of the changes.

Notification

The user or vendor is notified when the fix is available or if the problem was caused by user error.

Software Releases

Version Numbering

CUPS uses a three-part version number separated by periods to represent the major, minor, and patch release numbers: Beta-test releases are indentified by appending the letter B followed by the build number: A CVS snapshot is generated for every beta and final release and uses the version number preceded by the letter "v" and with the decimal points replaced by underscores: Each change that corrects a fault in a software sub-system increments the patch release number. If a change affects the software design of CUPS then the minor release number will be incremented and the patch release number reset to 0. If CUPS is completely redesigned the major release number will be incremented and the minor and patch release numbers reset to 0:

Generation

Software releases shall be generated for each successfully completed software trouble report. All object and executable files shall be deleted prior to performing a full build to ensure that source files are recompiled.

Testing

Software testing shall be conducted according to the CUPS Software Test Plan, CUPS-STP-1.1. Failed tests cause STRs to be generated to correct the problems found.

Release

When testing has been completed successfully a new distribution image is created from the current CVS code "snapshot". No production release shall contain software that has not passed the appropriate software tests.

Coding Requirements

These coding requirements provide detailed information on source file formatting and documentation content. These guidelines shall be applied to all C and C++ source files provided with CUPS.

Source Files

Naming

All source files names shall be 16 characters or less in length to ensure compatibility with older UNIX filesystems. Source files containing functions shall have an extension of ".c" for ANSI C and ".cxx" for C++ source files. All other "include" files shall have an extension of ".h".

Documentation

The top of each source file shall contain a header giving the name of the file, the purpose or nature of the source file, the copyright and licensing notice, and the functions contained in the file. The file name and revision information is provided by the CVS "$Id$" tag: The bottom of each source file shall contain a trailer giving the name of the file using the CVS "$Id$" tag. The primary purpose of this is to mark the end of a source file; if the trailer is missing it is possible that code has been lost near the end of the file:

Functions

Naming

Functions with a global scope shall be capitalized ("DoThis", "DoThat", "DoSomethingElse", etc.) The only exception to this rule shall be the CUPS interface library functions which may begin with a prefix word in lowercase ("cupsDoThis", "cupsDoThat", etc.)

Functions with a local scope shall be declared "static" and be lowercase with underscores between words ("do_this", "do_that", "do_something_else", etc.)

Documentation

Each function shall begin with a comment header describing what the function does, the possible input limits (if any), and the possible output values (if any), and any special information needed:

Methods

Naming

Methods shall be in lowercase with underscores between words ("do_this", "do_that", "do_something_else", etc.)

Documentation

Each method shall begin with a comment header describing what the method does, the possible input limits (if any), and the possible output values (if any), and any special information needed:

Variables

Naming

Variables with a global scope shall be capitalized ("ThisVariable", "ThatVariable", "ThisStateVariable", etc.) The only exception to this rule shall be the CUPS interface library global variables which must begin with the prefix "cups" ("cupsThisVariable", "cupsThatVariable", etc.) Global variables shall be replaced by function arguments whenever possible.

Variables with a local scope shall be lowercase with underscores between words ("this_variable", "that_variable", etc.) Any local variables shared by functions within a source file shall be declared "static".

Documentation

Each variable shall be declared on a separate line and shall be immediately followed by a comment block describing the variable:

Types

Naming

All type names shall be lowercase with underscores between words and "_t" appended to the end of the name ("this_type_t", "that_type_t", etc.)

Documentation

Each type shall have a comment block immediately before the typedef:

Structures

Naming

All structure names shall be lowercase with underscores between words and "_str" appended to the end of the name ("this_struct_str", "that_struct_str", etc.)

Documentation

Each structure shall have a comment block immediately before the struct and each member shall be documented in accordance with the variable naming policy above:

Classes

Naming

All class names shall be lowercase with underscores between words ("this_class", "that_class", etc.)

Documentation

Each class shall have a comment block immediately before the class and each member shall be documented in accordance with the variable naming policy above:

Constants

Naming

All constant names shall be uppercase with underscored between words ("THIS_CONSTANT", "THAT_CONSTANT", etc.) Constants defined for the CUPS interface library must begin with an uppercase prefix ("CUPS_THIS_CONSTANT", "CUPS_THAT_CONSTANT", etc.)

Typed enumerations shall be used whenever possible to allow for type checking by the compiler.

Documentation

Comment blocks shall immediately follow each constant:

Code

Documentation

All source code shall utilize block comments within functions to describe the operations being performed by a group of statements:

Style

Indentation

All code blocks enclosed by brackets shall begin with the opening brace on a new line. The code then follows starting on a new line after the brace and is indented 2 spaces. The closing brace is then placed on a new line following the code at the original indentation: Single-line statements following "do", "else", "for", "if", and "while" shall be indented 2 spaces as well. Blocks of code in a "switch" block shall be indented 4 spaces after each "case" and "default" case:

Spacing

A space shall follow each reserved word ("if", "while", etc.) Spaces shall not be inserted between a function name and the arguments in parenthesis.

Return Values

Parenthesis shall surround values returned from a function using "return":

Loops

Whenever convenient loops should count downward to zero to improve program performance:

Software Trouble Report Form

Summary of Problem: ________________________________________
Problem Severity: __1=RFE
__2=Documentation-Error
__3=Unable-to-Print-a-File
__4=Unable-to-Print-to-a-Printer
__5=Unable-to-Print-at-All
Problem Scope: __1=Machine __2=Operating-System __3=All
Detailed Description of Problem: ________________________________________
________________________________________
________________________________________
________________________________________
________________________________________
________________________________________