summaryrefslogtreecommitdiff
path: root/hw/xfree86/doc
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-05-18 11:12:49 +1000
committerKeith Packard <keithp@keithp.com>2010-05-18 15:43:51 -0700
commitd88ba7721d2d3b58cdc664fd4c23a3c5e2a5f909 (patch)
tree80b64d2ed0c450d093156b1be4ca626228eeb78c /hw/xfree86/doc
parent673eb707ce6737284c4886265ba149c5587a74e2 (diff)
xfree86: Add option parsing for percent options.
In some cases, an option of "50%" would be preferable over fixed value configuration - especially if the actual values are autoprobed. Add a new set of functions to parse percent values from configurations. The percent value parsing differs slightly - if the option is not to marked as used (e.g. xf86CheckPercentOption()), no warning is emitted to the log file if the value is not a percent value. This allows double-options (either as % or as absolute number) without warnings. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xfree86/doc')
-rw-r--r--hw/xfree86/doc/sgml/DESIGN.sgml6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/xfree86/doc/sgml/DESIGN.sgml b/hw/xfree86/doc/sgml/DESIGN.sgml
index e95df7999..8999e0cb0 100644
--- a/hw/xfree86/doc/sgml/DESIGN.sgml
+++ b/hw/xfree86/doc/sgml/DESIGN.sgml
@@ -2528,6 +2528,7 @@ Next, the higher level functions that most drivers would use.
OPTV_ANYSTR, /* Any string, including an empty one */
OPTV_REAL,
OPTV_BOOLEAN,
+ OPTV_PERCENT,
OPTV_FREQ
} OptionValueType;
@@ -2555,6 +2556,11 @@ Next, the higher level functions that most drivers would use.
&s.code;freq.units&e.code; is set to &s.code;0&e.code;, and
&s.code;freq.freq&e.code; is unscaled.
+ &s.code;OPTV_PERCENT&e.code; can be used for option values that are
+ specified in percent (e.g. "20%"). These values are a floating point
+ number with a percent sign appended. If the percent sign is missing,
+ the parser will fail to match the value.
+
Typical usage is to setup an array of
&s.code;OptionInfoRecs&e.code; with all fields initialised.
The &s.code;value&e.code; and &s.code;found&e.code; fields get