Prev: Next: , Up: Configuration[Contents][Index]


9.1 Lexical structure

Lexically, the file contains tokens of three types: keywords, values, and separators. Blanks, tabs, newlines and comments, collectively called white space are ignored except as they serve to separate tokens. Some white space is required to separate otherwise adjacent keywords and values.

Comments may appear anywhere where white space may appear in the configuration file. A comment begins with a hash sign (‘#’) and continues to the end of the line.

A keyword is a sequence of ASCII letters, digits and underscores that begins with an ASCII letter or underscore. Keywords are always case-insensitive.

There are three kinds of values: numeric values (or numbers), boolean values, quoted strings, and IP addresses.

Numbers

A numeric value is a sequence of decimal digits.

Booleans

A boolean is one of the following: ‘yes’, ‘true’, ‘on’ or ‘1’, meaning true, and ‘no’, ‘false’, ‘off’, ‘0’ meaning false.

Strings

A quoted string or string, for short, is a sequence of characters enclosed in a pair of double quotes. A backslash (‘\’) appearing within a string acts as an escape character: if it is followed by a double-quote or another backslash, it forces the character that follows it to be treated as an ordinary one. For example:

"string with \" character"

A backslash followed by any character other than ‘"’ or ‘\’ is removed and a warning to that effect is output. For example, the following statement:

user "r\oot"

appearing at line 1 of file pound.cfg will result in the following message:

pound.cfg:1.8: unrecognized escape character

and will be treated as

user "root"
IP addresses

IP addresses are IPv4 or IPv6 addresses in numeric form, or hostnames.


Prev: Next: , Up: Configuration[Contents][Index]