s_
, typedefs with t_
, union names with
u_
, enumeration names with e_
. Beware, the prefix is
not part of the identifier, thus "anonymous typedefs" of
the form typedef int t_;
are PROHIBITED.
typedef unsigned char t_cmap[COLOR_WIDTH * NCOLORS]; typedef unsigned char t_pixel; struct s_picture { int width; int height; t_cmap cmap; t_pixel *picture; };
Rationale: for not
using suffixes instead: identifiers ending with _t
are reserved by POSIX (beside others).
Rationale: for using prefixes: they are the first characters read while the eye is parsing, and allow to tag the identifier without need to read it entirely.
typedef
. It
is therefore not correct to defined shortcut names to structures and
unions prefixed with t_
.
Rationale: typedef
hides the compound nature of structures and
unions.
Global variable identifiers (variables names in the global scope),
when allowed/used, MUST start with gl_
.