|
Table 1
SERTS naming conventions to improve software maintainability for C-language programs
|
|
Symbol
|
Description
|
|
xyc.c
|
File that contains code for module 'xyz'
|
|
xyz.h
|
File that contains header info for module 'xyz'. Anything
defined in this file MUST have an xyz or XYZ prefix, and must
be something that is exported by the module.
|
|
xyz_t
|
Primary data type for module xyz. Defined in xyz.h
|
|
xyzAbcde_t
|
Secondary type "Abcde" for module xyz. Defined in xyz.h.
|
|
xyzAbcde()
|
Function "Abcde" that applies to items of type xyz_t.
|
|
XYZ_ABCDE
|
Constant for module XYZ. Must be defined in xyz.h.
|
|
XYZ_ABCDE()
|
#define'd macro for module XYZ. Must be defined in xyz.h.
|
|
xyz_abcde
|
Exported global variable defined in module xyz. Must be
defined in xyz.c, and declared as extern in xyz.h. Global
variables should be avoided!
|
_ABCDE
_ABCDE_FGH
|
Local constant internal to module. Must be defined at top of
xyz.c. The third version allows the use of multiple words. For
example, _ABCDE_FGH. If just "ABCDE_FGH", is used, it
implies module "abcde"
|
|
abcde
|
Local variable. Must be defined inside a function.Fields within
a structure are also defined using this convention.
|
|
_abcde
|
Internal global variable. Must be defined as "static" at top of
xyz.c.
|
|
_abcde()
|
Internal function. Must be defined as static. Prototype at top
of xyz.c. Function declared at bottom of xyz.c, after all the
exported functions have been declared.
|
|
_abcde_t
|
Internally-defined type. Must be defined at top of xyz.c.
|
|
abc_e
|
An exported enumerated type for module abc. Each entry of
the enumerated type should defined using the same
conventions as a constant.
|
|
Back
|