C Style

Leo de Wit leo at philmds.UUCP
Thu Jan 19 21:48:48 AEST 1989


In article <9361 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
|I assumed that the available name space had already been divided
|among "packages" using some general guideline, such as package
|prefixes (explained in a previous posting).  You need to take
|care of this anyway.  It is easier to cooperate with general
|name space partitioning guidelines than to remember specific
|symbols.

We use that strategy here too, and it is easy to extend the
guideline to include the preprocessor token:

Global functions are prefixed with a 3 letter & underscore prefix, the
3 letters identifying the module. For instance, if you have a queue
handling module, you would name the functions que_.... . The header
file that exports the module's global functions, variables, types &
macros (and is included by the module itself and all others that use
the module) defines the symbol QUE to prevent multiple inclusion.

Never noticed any problems remembering this scheme ...

  Leo.



More information about the Comp.lang.c mailing list