[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] [ Search: ]

4.5.2 Configuration File

Many applications have an accompanying configuration file which describes configuration options specific to that application. Similarly, plug-in modules can have configuration files. Configuration files are named with the file extension ‘.cfg’ and are typically located within the VFS virtual directory ‘/config/’ (see section Virtual File System (VFS)) which is often mounted at the physical location ‘CS/data/config’ for Crystal Space sample applications.

The format of these files is simple. They consist of a number of keys, each of which consists of a name, a value and an optional comment. Key names contain dots to create a pseudo-hierarchy, similar to a file system; for example: ‘Video.OpenGL.EnableDither’. This should be interpreted as the ‘EnableDither’ option in the sub-section ‘OpenGL.’, which resides in section ‘Video.’ (note that the dots are part of the key name).

The file itself looks something like this:

 
; This is the comment for the first batch of keys.
Section.Keyname = Value
; Comments may be
; several lines long
; The option 'Section.TestOption' (below) has no attached comment.
Video.OpenGL.EnableDither = true
Section.TestOption = false
; Comments at the end of the file do not belong to any configuration
; key. When a config file is loaded and saved again later this
; end-of-file comment is retained at the end of the file.

This document was generated using texi2html 1.76.