Subject: Re: Doxygen generated documentation
To: Roland Illig <roland.illig@gmx.de>
From: Rhialto <rhialto@azenomei.knuffel.net>
List: tech-kern
Date: 05/24/2005 18:08:37
On Tue 24 May 2005 at 17:23:58 +0200, Roland Illig wrote:
> Rhialto wrote:
> >On the order of the #inludes, my rule is to go from general to specific,
> >i.e. include standard C headers first, then Unix headers, then project
> >headers. Within each category I also prefer a sort of bottom-up order,
> 
> What do you mean by "bottom-up"?

Bottom up is that you strictly define before use (as the opposite of
top-down where you use before you define; as in the two programming
methodologies).

For instance, if you use stuff from some header that defines linked
lists "list.h", and some header that defines linked FooBars "foobar.h",
then you include them in that order. In this case you can assume that
"foobar.h" probably includes "list.h", and this defines the order, but
there are cases where some intuition is needed; for instance I would
include a "long-integers.h" before a "complex-gui.h".

> >so <unistd.h> seems to go before <stdio.h>.
> 
> The other way round. <stdio.h> is from the C Standard Library, whereas 
> <unistd.h> is a Unix header. They just aren't in the same category.

Ehm yes, you are right. I was concentrating on thinking the former is
more general than the latter, in the sense that one is about the whole
OS and the other only about I/O. Now if both were actually in the same
category they would go in that order :-)

> Roland
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert                            --  rhialto/at/falu.nl
\X/ Hi! I'm a signature virus! Copy me to your .signature to help me spread!