Using #include
Theory
#include in C has two forms.
Quoting the first edition of K&R.
| #include "filename" | Causes the replacement of that line by the entire contents of filename. The named file is searched for first in the directory of the original source file, and then in a sequence of standard places. |
| #include <filename> | Searches the standard places, and not the directory of the source file. |
9.1.2 C Header Files (was 7.1.2 in the printed book) of The Goat Book (a.k.a. Autoconf, Automake, and Libtool) advises:
If a header is designed to be installed, it must #include other installed project headers from the local tree using angle-brackets.
Practice
.h files
Header files, whether or not they're currently meant to be installed, use the form '#include <libfo/filename>' for all libfo headers. For example, from the current fo-layout_master_set.h:
#include <libfo/fo-utils.h> #include <libfo/property/fo-property.h>
.c files
C source code files use the form '#include filename"' for all libfo headers, i.e., without the leading 'libfo/', since using 'libfo/' is verbose and does not add any extra information.
Including header files in a different subdirectory of the libfo source code directory need to be prefixed by the subdirectory name, for example:
#include "fo/fo-simple-page-master.h"
There is currently no policy on whether or not to include the subdirectory name when including headers in the same source code subdirectory.
