| ConfigFile is used to manipulate Multiserver configuration (*.conf) files.
Presents all configuration elements in the form of a keyed
table. Configuration elements are grouped by string "keys" according
to the function they configure. The syntax is described more formally
below.
stream ::= entry | stream entry
entry ::= key "=" value_list | comment | blank
value_list ::= value | value_list "," value
value ::= fragment | value "+" fragment
fragment ::= key | quoted_string
quoted_string ::= (C/C++ style quoted string)
key ::= (A string matching [A-Za-z_\./][A-Za-z0-9_-\./]*)
comment ::= "#" (any text up to a newline)
blank ::= (A line containing only white space)
In addition to the above syntax, some additional semantic rules apply.
The operator "+" concatenates the fragment immediately to the left
and to the right of it. Thus ab + cd results in
abcd . The operator "," terminates one element and begins
the next element. Thus, the line val = hello, world
creates a configuration entry with the key "val" and the two elements
"hello", and "world". If the characters "+", ",", or "\" occur at
the end of a line, then the entry is continued on the next line.
Trailing and leading whitespaces are ignored, and multiple whitespace
characters are converted by default into a single space. The "+"
operator leaves no whitespace between operands.
Finally, within quoted strings, C-style backslash escapes are
recognized. These include "\n" for newline, "\t" for tab, etc.
An example configuration input file is given below.
#==============================================================
# Sample.config
#==============================================================
LDAP_SERVERS[] = "server1.ldap.gov:338",
"server2.ldap.gov:1000"
USER_TIMEOUT = 3600 # seconds. Comments can follow on same line.
STRANGE_ENTRY = "This is a long long long long long " +
"long long line. Notice how the \"+\" " +
"operator is used to break this line up " +
"into more than one line in the config file." ,
"And this is the second element."
# etc.
See Also: Config author: Shawn McMurdo version: $Revision: 1.2 $ |