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 South Australian Government Department of Lands.2.1 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: This
was a major goal of the FunnelWeb implementation.
Two excellent books guided this move to portability.
They were [Rabinowitz90]
[1] (which deals with C code itself)
and [Horton90]
[1] (which deals with the portability of various library
calls). Other works such as [Kernighan88]
[1] and
[ANSI]
[1] were also helpful.
Identifiers: [Rabinowitz90]
[1]length
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:
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 pointers 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.
File names: All files 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!