11-18-05 12:50 PM
Thu, Nov 17, 2005 at 16:41:25, fcusack (Frank Cusack) wrote about "structure
member prefixes":
FC> The members of 'struct stat' begin with st_. The members of 'struct tim
eval'
FC> begin with tv_.
FC> What is the reason for this?
First, it is because early K&R C hadn't separate field name namespaces
for each structure; this was global namespace.
Second, it is often kept now because it is very convenient in some
cases. E.g. if different structures has tv_flags, st_flags, ic_flags
and so on, one can find all places where such field is used using
simple grep. In text where all such fields are named simply `flags',
smart code browser is required.
-netch-
[ Post a follow-up to this message ]
|