Naming Conventions for Functions and Files
While file-naming conventions are not always practical, they can be very
useful. The most important naming convention used by the client source
is prefixing a function name with an abbreviation of the module in which
the function resides. For example, all public functions in the networking
library have names that begin with NET_. Typically, functions
private to a module have the same prefix, but the characters in the abbreviation
are all lowercase, as opposed to all uppercase for exported functions.
Here is a list of common prefixes:
|"front end" (platform specific)
|connection to java layer
|OS level utilites
The use of prefixes offers two main advantages:
Here are two examples of file naming conventions currently in use:
libmocha filenames begin with lm_*.c, and layout filenames
begin with lay*.c.
Module-specific prefixes before function names prevents name collisions
between functions in different modules.
When looking at a stack trace, programmers can quickly tell where to begin
Copyright © 1998