source: branches/ithildin-1.1/doc/conf.txt @ 490

Revision 490, 2.5 KB checked in by wd, 8 years ago (diff)

Add Id/Rev? keywords.

  • Property svn:keywords set to Id Rev
Line 
1###############################################################################
2#
3# conf.txt: documentation on the configuration file format
4#
5# Copyright 2002 the Ithildin Project.
6# See the COPYING file for more information on licensing and use.
7#
8# $Id$
9#
10###############################################################################
11
12The conf parser:
13The format for configuration files for this daemon has been popularized by
14bind8, and is looks somewhat like C or perl.  Format specs are as follows:
15
16the most basic unit is a single element, which looks like this:
17element "data";
18
19The quotes are optional.  Double quotes (") cause 'expansion' which
20currently works only for backquoting (i.e. "\"foo\"" produces an entry which
21is literally "foo").  No other quoting is supported.  Data does not
22necessarily need to be quoted, but it is both safer and more readable to
23quote.  All 'statements' must end in a semicolon (;) to be valid.
24
25the other supported unit is a list, which looks like this:
26list {
27  element1 "an element";
28  element2 "another element";
29};
30
31lists are groups for elements.  additionally, lists may contain sub-lists
32(this is recursive, there may be any depth of sub-lists desired.).  Lists
33are always delimited by curly brackets ({}).  Lists must end in a semicolon
34(;) to be valid.
35
36Additionally, other files may be included using a C-style include directive
37such as this:
38$INCLUDE "otherfile"
39Other functionality using $... directives may be added later.  Do not use
40anything but the '$INCLUDE' directive.
41
42To be processed an include directive must be the first non-whitespace data
43on a line.  the file may either be quoted or unquoqted.  C-style triangle
44braces (<>) are not supported.
45
46Comments may be either C++ // style comments or C /* */ style comments.  //
47comments last until the end of the line. /* */ comments encapsulate all data
48between the /* and */. additional /* markers inside a C style comment are
49ignored.  The # character may also be used as a comment character.
50
51For an example of a configuration file, see the file 'example.conf' in this
52directory.
53
54
55Accessing configuration data within the code:
56Upon startup the global configuration file (typically
57/usr/local/etc/ithildin/ircd.conf) is read in.  The global tree is placed in
58a pointer to a conf_list structure (see conf.h) called config_head.
59Sub-lists can be searched for using the conf_find_list function, similarly
60individual entries can be searched for using conf_find_entry.  Recursion may
61be specified to make searches more likely to return the correct result.
Note: See TracBrowser for help on using the repository browser.