X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ucw%2Fdoc%2Fconfig.txt;h=4e036cad147a26ce7e755e32ed99602c5f9ab4a3;hb=d84b9fd101d2bf3a72b9dc1d603c9b3960e8cb17;hp=5d655d7b6cb7bfac6c4e371dfd6f58ce17fd1616;hpb=7f0e96d24f19acb432de130b172e1fd65d475e3b;p=libucw.git diff --git a/ucw/doc/config.txt b/ucw/doc/config.txt index 5d655d7b..4e036cad 100644 --- a/ucw/doc/config.txt +++ b/ucw/doc/config.txt @@ -5,6 +5,7 @@ This document describes run-time configuration of libucw-based programs using config files. For compile-time configuration, see <>. +[[terminology]] Terminology ----------- @@ -35,6 +36,7 @@ type. The basic types supported by the configuration mechanism are: Program modules can define their own special types (such as network masks or attribute names) and decide how are they parsed. +[[format]] Format of configuration files ----------------------------- @@ -65,6 +67,8 @@ assignment commands: Numerical values can be succeeded by a unit. The following units are supported: +[[units]] + d=86400 k=1000 K=1024 h=3600 m=1000000 M=1048576 %=0.01 g=1000000000 G=1073741824 @@ -106,6 +110,8 @@ Lists support several operations besides adding a new node. You just have to write a colon immediately after the attribute name, followed by the name of the operation. The following operations are supported: +[[operations]] + List:clear # removes all nodes List:append { attr1=value1; ... } # adds a new node at the end List:prepend { attr1=value1; ... } # adds a new node at the beginning @@ -125,6 +131,7 @@ The commands :clear, :append, and :prepend are also supported by var-length arrays. The command :clear can also be used on string values. The following operations can be used on bitmaps: :set, :remove, :clear, and :all. +[[include]] Including other files --------------------- @@ -134,6 +141,7 @@ To include another file, use the command (Beware that this command has to be the last one on the line.) +[[command_line]] Command-line parameters ----------------------- @@ -154,19 +162,22 @@ items and exits. All these switches must be used before any other parameters of the program. +[[preprocess]] Preprocessing ------------- During compilation, all configuration files are pre-processed by a simple C-like preprocessor, which supports `#ifdef`, `#ifndef`, `#if`, `#elsif`, `#else` and `#endif` directives referring to compile-time -configuration variables. `#if` and `#elsif` can contain any Perl expression -where each `CONFIG_xyz` configuration variable is substituted to 0 or 1 -depending on its value. +configuration variables (the ones detected by `configure` script, you +can see list of them in `obj/autoconf.h`). `#if` and `#elsif` can contain +any Perl expression where each `CONFIG_xyz` configuration variable is +substituted to 0 or 1 depending on its value. The preprocessor also substitutes `@VARIABLE@` by the value of the variable, which must be defined. +[[caveats]] Caveats -------