diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2009-10-02 06:28:03 -0700 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2009-12-22 23:24:02 -0800 |
commit | c6e8637e29e0ca11dfb35c02da7ca6002ac8c597 (patch) | |
tree | 3b47a975af96fac80cac15570cd2eba0a5defa97 /hw/xfree86/parser/xf86Parser.h | |
parent | 90e6d93cf9bfafd63d7849dc16ce194d6f9c9d5f (diff) |
xfree86: Support non-Option boolean entries in configuration
Refactored code into the parser to allow the freeform boolean types used
in Option entries to be used in other configuration entries. This isn't
as powerful as allowing "No" to precede the option names, but it atleast
gives a common handling of "yes", "no", etc.
A type xf86TriState has been added to support an optional boolean. This
allows the boolean sense of the value to be kept while providing a means
to signal that it is unset.
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Diffstat (limited to 'hw/xfree86/parser/xf86Parser.h')
-rw-r--r-- | hw/xfree86/parser/xf86Parser.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index 603080066..72beb5fa0 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/hw/xfree86/parser/xf86Parser.h @@ -64,6 +64,7 @@ #ifndef _xf86Parser_h_ #define _xf86Parser_h_ +#include <X11/Xdefs.h> #include "xf86Optrec.h" #define HAVE_PARSER_DECLS @@ -330,6 +331,13 @@ typedef struct } XF86ConfInputrefRec, *XF86ConfInputrefPtr; +typedef struct +{ + Bool set; + Bool val; +} +xf86TriState; + /* Values for adj_where */ #define CONF_ADJ_OBSOLETE -1 #define CONF_ADJ_ABSOLUTE 0 @@ -480,5 +488,6 @@ extern _X_EXPORT int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr li extern _X_EXPORT int xf86pathIsAbsolute(const char *path); extern _X_EXPORT int xf86pathIsSafe(const char *path); extern _X_EXPORT char *xf86addComment(char *cur, char *add); +extern _X_EXPORT Bool xf86getBoolValue(Bool *val, const char *str); #endif /* _xf86Parser_h_ */ |