How to represent structs in text

Henry Spencer henry at utzoo.uucp
Sat Jul 23 03:14:22 AEST 1988


In article <759 at vsi.UUCP> friedl at vsi.UUCP (Stephen J. Friedl) writes:
>     I am looking for opinions on how to represent structs in text.
>The two schools of thought are (a) show the full struct declaration
>and (b) show just the members...

By far the best way is to show just the members, introduced by text that
says something like "this struct includes at least the following members,
not necessarily in this order".  The point here is that you may want to
add more members, or rearrange existing ones, later.  This usage puts
people on notice that no silly tricks are allowed.  (As a useful side
effect, it also makes it even more likely that they will #include the
header file rather than typing the structure in themselves.)  Look at
the wording in X3J11 or POSIX -- they do it this way.
-- 
Anyone who buys Wisconsin cheese is|  Henry Spencer at U of Toronto Zoology
a traitor to mankind.  --Pournelle |uunet!mnetor!utzoo! henry @zoo.toronto.edu



More information about the Comp.lang.c mailing list