getconfig(__filemansuffix__)

NAME
getconfig - meta configuration files for getconfig(1)

SYNOPSIS
*.cfg

DESCRIPTION
getconfig is a programatic interface that is used by the __xservername__ server to get configuration information about video hardware when operating without an __xconfigfile__ file.

This implementation of getconfig is written in perl. It processes rules from meta-configuration files. All meta-configuration files have a .cfg suffix.

Lines starting with a pound-sign (#) are comments, and are ignored. Blank lines that consist only of white space are also treated as comments and ignored.

The first non-comment line must be a signature string followed by the file format version number. The signature string is

    "Xorg getconfig rules file.  Version: "

The currently defined version is "1.0". Files that do not have the correct signature string are ignored.

The remaining non-comment lines define rules. The start of a new rule is indicated by a line with no leading white space. Subsequent lines making up a rule must be indented with white space. Logical lines within a rule may be split over multiple physical lines by using the usual continuation convention ('\' at the end of the line). The first logical line of each rule is a perl expression. It may be any valid perl expression whose evaluated (with 'eval') result may be used as the argument to a perl 'if' statement. The second logical line should be the name of the __xservername__ video driver to use when the rule is true, and subsequent logical lines of each rule, if present, are additional configuration output for the video device's __xconfigfile__ Device section. The driver name and additional lines of configuration information are written to standard output when the rule is chosen as the successful rule.

Pseudo rules consisting of perl expressions may be present in the file for the purpose of defining custom perl variables or setting the weight to use for the following rules. Pseudo rules are rules that consist of a single logical line only, and the are never candidates themselves for the successful rule.

Several perl variables are pre-defined, and may be used within rules. They include:

    $vendor                 PCI vendor ID
    $device                 PCI device ID
    $revision               PCI revision ID
    $subsys                 PCI subsystem ID
    $subsysVendor           PCI subsystem vendor ID
    $class                  PCI class
    $XorgVersion         Xorg version, as a 'v' string
    $XorgVersionNumeric  Xorg numeric version
    $XorgVersionMajor    Xorg major version
    $XorgVersionMinor    Xorg minor version
    $XorgVersionPatch    Xorg patch version
    $XorgVersionSnap     Xorg snap version
    $weight                 current rule weight

The $weight variable deterines the weight of the rules as they are processed. The weight for subsequent rules may be set with a pseudo rule that sets or changes the value of $weight. The default weight, and the weight used for built-in rules is 500. The meta-configuration files are processed in an unpredictable order. The weighting of the rules is used to determine their relative priority

After processing all of the rules, both built-in and those read from the meta-configration files, the getconfig program chooses as the successful rule the last and highest weighted rule that evaluates to true.

FILES
.cfg files located in the search path. The search path typically specified by the __xservername__ server is:

    /etc/X11
    __projectroot__/etc/X11
    <modulepath>
    __projectroot__/lib/X11/getconfig

where <modulepath> is the __xservername__ server's module search path.

__projectroot__/lib/X11/getconfig/xorg.cfg
    Default rules file that gets installed. This file doesn't contain any rules by default.

__projectroot__/lib/X11/getconfig/cfg.sample
    A sample rules file that gives some examples of what types of rules can appear in rules files.

SEE ALSO
getconfig(1), __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__).

AUTHORS
The __xservername__ automatic configuration support and the getconfig interface was written by David H. Dawes, with the support of X-Oz Technologies for XFree86.