diff options
author | Keith Packard <keithp@keithp.com> | 2009-12-30 09:28:19 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-12-30 09:28:19 -0800 |
commit | 9fad8f06fb89ac2ae05bea0fa24cab3df7677297 (patch) | |
tree | 8d231f684ded8cc9a92c8133d37cf1ee421d6f6e /hw/xfree86/parser/scan.c | |
parent | 871bbe1d87fa3c7ebd075e1d1eec33e45b08493d (diff) | |
parent | 42e8c9224e6c54655c45f87999d37d0d67b3f7f5 (diff) |
Merge remote branch 'dbn/inputclass'
Diffstat (limited to 'hw/xfree86/parser/scan.c')
-rw-r--r-- | hw/xfree86/parser/scan.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index 9f1835085..b80fbfb8f 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -1186,3 +1186,33 @@ xf86addComment(char *cur, char *add) return (cur); } + +Bool +xf86getBoolValue(Bool *val, const char *str) +{ + if (!val || !str) + return FALSE; + if (*str == '\0') { + *val = TRUE; + } else { + if (strcmp(str, "1") == 0) + *val = TRUE; + else if (strcmp(str, "on") == 0) + *val = TRUE; + else if (strcmp(str, "true") == 0) + *val = TRUE; + else if (strcmp(str, "yes") == 0) + *val = TRUE; + else if (strcmp(str, "0") == 0) + *val = FALSE; + else if (strcmp(str, "off") == 0) + *val = FALSE; + else if (strcmp(str, "false") == 0) + *val = FALSE; + else if (strcmp(str, "no") == 0) + *val = FALSE; + else + return FALSE; + } + return TRUE; +} |