Coding Style

codingstyle

Although FunnelWeb wasn't coded under any particular coding standard, it was coded in accordance with a fairly strict personal style of C which developed during the development of FunnelWeb. This style was subsequently embodied in a real C coding standard prepared for the SouthSouth Australian Government Department of Lands Australian Government Department of Lands.[*] Unfortunately, FunnelWeb was not formally developed under the standard and so some holes remain in FunnelWeb's coding style. This section aims to describe some of the more important aspects of the coding style.

Portability: Thisportability was a major goal of the FunnelWeb implementation. Two excellent books guided this move to portability. They were Rabinowitz90 (which deals with C code itself) and Horton90 (which deals with the portability of various library calls). Other works such as Kernighan88 and ANSI were also helpful.

Identifiers: Rabinowitz90identifierlength specifies that for wide portability, identifiers of block and file scope should be unique to eight characters, and identifiers of program scope should be unique to six characters. I have gone further in FunnelWeb and actually made these restrictions actual limits on identifier length.

Because names must be so short, a system of abbreviations was developed to organize the identifiers used within FunnelWeb. Each abbreviation consists of a letter pair. Here are ısome of the abbreviations used:identifierabbreviations

bp - Body Part.
cm - Compare. Used to prefix comparison routines that return [-1,0,1].
dc - Document component.
dm - Dump package.
el - Element.
eq - Equal. Used to prefix comparison routines that return a boolean.
ex - Expression.
f  - Global files.
ll - List of lists.
ln - Line record.
ls - List Package.
lr - Lister package.
ma - Macro.
mc - Macro Call.
mn - Macro Name.
op - Options package.
pr - Parser.
ps - Position record.
sc - Scrap record.
sn - Section.
tb - Table package.
ty - Typesetter directive.
wf - Write file package.
wl - Write with EOL (misc.c).
wr - Write          (misc.c).

Pointers: Variables or types denoting pointerspointersnaming start with p_.

Types: Names denoting types end in _t. Thus, a type for a pointer to a table would be named p_tb_t.typesnaming

File names: All filesfilenameslength used in FunnelWeb have file names that are from one to eight characters long and file extensions that are from one to three characters long. This ensures that the files can be portably moved to all kinds of machines, even MSDOS!MSDOS