Next: , Previous: , Up: syntax   [Contents][Index]

5.1.2 Pragmatic Comments

Pragmatic comments are similar to usual single-line comments, except that they cause some changes in the way the configuration is parsed. Pragmatic comments begin with a ‘#’ sign and end with the next physical newline character.

#include <file>
#include "file"

Include the contents of the file file. If file is an absolute file name, the named file is included. An error message will be issued if it does not exist.

If file contains wildcard characters (‘*’, ‘[’, ‘]’ or ‘?’), it is interpreted as a shell globbing pattern and all files matching that pattern are included, in lexicographical order. If no matching files are found, the directive is replaced with an empty line.

Otherwise, the form with angle brackets searches for file in the include search path, while the second one looks for it in the current working directory first, and, if not found there, in the include search path. If the file is not found, an error message will be issued.

Include search path is formed by two directory sets: the user-defined search path, as defined by eventual -I (see include option) command line options, and the standard include search path, defined at compile time. The latter can be inspected using the --help option.

The order of directories is as follows. First, direvent scans any directories given with -I options, in the same order as given on the command line. If file is not found in any of them, the standard include search path is scanned. It is defined at the compile time and by default consists of two directories:

where prefix is the installation prefix. The default can be changed when configuring the package. To inspect the actual standard include search path at the runtime, run direvent --help, and look for the string ‘Include search path:’ in its output.

#include_once <file>
#include_once file

Same as #include, except that, if the file has already been included, it will not be included again.

#line num
#line num "file"

This line causes the parser to believe, for purposes of error diagnostics, that the line number of the next source line is given by num and the current input file is named by file. If the latter is absent, the remembered file name does not change.

# num "file"

This is a special form of #line statement, understood for compatibility with the C preprocessor.

Next: , Previous: , Up: syntax   [Contents][Index]