2005-02-08 12:05:14 +03:00
|
|
|
This file documents some conventions for sorting system header files in
|
|
|
|
the #include section.
|
|
|
|
|
|
|
|
1. #include <config.h> unconditionally
|
|
|
|
|
|
|
|
2. if there are any headers containing "alloca" in the name, include
|
|
|
|
them here. Some systems need them as the first header.
|
|
|
|
|
|
|
|
3. #include the Standard C Library headers, sorted alphabetically
|
|
|
|
|
|
|
|
(assert, ctype, errno, float, limits, locale, math, setjmp, signal,
|
|
|
|
stdarg, stddef, stdio, stdlib, string, time)
|
|
|
|
|
|
|
|
4. #include the POSIX headers, in the following order
|
|
|
|
|
|
|
|
<sys/types.h> Needed by many other headers.
|
|
|
|
<sys/*.h>
|
|
|
|
<*.h>
|
|
|
|
|
|
|
|
For every POSIX function you use, make sure that the order of the
|
|
|
|
headers is the same as in the according manpage.
|
|
|
|
|
|
|
|
5. #include other external headers
|
|
|
|
|
|
|
|
6. #include "../src/global.h"
|
|
|
|
|
2005-07-18 15:33:36 +04:00
|
|
|
This file contains lots of compatibility stuff that is used
|
|
|
|
throughout the whole mc. All mc header files rely on this file to be
|
|
|
|
included before them.
|
|
|
|
|
2005-02-08 12:05:14 +03:00
|
|
|
7. #include Midnight Commander headers
|
|
|
|
|
|
|
|
Currently, not all headers can be ordered arbitrarily, so try it out.
|
|
|
|
|
|
|
|
|
|
|
|
==== Headers that may be included unconditionally ====
|
|
|
|
|
2005-07-20 17:14:30 +04:00
|
|
|
All ISO C90 headers.
|
|
|
|
|
2005-02-08 12:05:14 +03:00
|
|
|
<sys/types.h>
|
|
|
|
<sys/stat.h>
|
|
|
|
<unistd.h>
|
|
|
|
<fcntl.h>
|
|
|
|
|
|
|
|
==== Headers that need autoconf guards ====
|
|
|
|
|
|
|
|
<termios.h>
|
|
|
|
<sys/ioctl.h>
|