2 *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
4 *Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 *"Software"), to deal in the Software without restriction, including
7 *without limitation the rights to use, copy, modify, merge, publish,
8 *distribute, sublicense, and/or sell copies of the Software, and to
9 *permit persons to whom the Software is furnished to do so, subject to
10 *the following conditions:
12 *The above copyright notice and this permission notice shall be
13 *included in all copies or substantial portions of the Software.
15 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
19 *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20 *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *Except as contained in this notice, the name of the XFree86 Project
24 *shall not be used in advertising or otherwise to promote the sale, use
25 *or other dealings in this Software without prior written authorization
26 *from the XFree86 Project.
28 * Authors: Alexander Gottwald
31 #ifdef HAVE_XWIN_CONFIG_H
32 #include <xwin-config.h>
35 #include "winconfig.h"
41 #ifdef XWIN_XF86CONFIG
43 #define CONFIGPATH "%A," "%R," \
44 "/etc/X11/%R," "%P/etc/X11/%R," \
46 "/etc/X11/%F," "%P/etc/X11/%F," \
47 "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
48 "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
50 "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
54 #define CONFIGDIRPATH "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
55 "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
57 "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
61 XF86ConfigPtr g_xf86configptr
= NULL
;
64 WinCmdlineRec g_cmdline
= {
65 #ifdef XWIN_XF86CONFIG
66 NULL
, /* configFile */
70 #ifdef XWIN_XF86CONFIG
76 NULL
, /* xkbVariant */
77 NULL
, /* xkbOptions */
78 NULL
, /* screenname */
80 FALSE
, /* emulate3Buttons */
81 0 /* emulate3Timeout */
84 winInfoRec g_winInfo
= {
104 #define NULL_IF_EMPTY(x) (winNameCompare(x,"")?x:NULL)
106 #ifdef XWIN_XF86CONFIG
107 serverLayoutRec g_winConfigLayout
;
109 static Bool
ParseOptionValue(int scrnIndex
, void *options
, OptionInfoPtr p
);
110 static Bool
configLayout(serverLayoutPtr
, XF86ConfLayoutPtr
, char *);
111 static Bool
configImpliedLayout(serverLayoutPtr
, XF86ConfScreenPtr
);
112 static Bool
GetBoolValue(OptionInfoPtr p
, const char *s
);
118 char *filename
, *dirname
;
119 MessageType filefrom
= X_DEFAULT
;
120 MessageType dirfrom
= X_DEFAULT
;
121 char *xf86ConfigFile
= NULL
;
122 char *xf86ConfigDir
= NULL
;
124 if (g_cmdline
.configFile
) {
125 filefrom
= X_CMDLINE
;
126 xf86ConfigFile
= g_cmdline
.configFile
;
128 if (g_cmdline
.configDir
) {
130 xf86ConfigDir
= g_cmdline
.configDir
;
133 /* Parse config file into data structure */
134 xf86initConfigFiles();
135 dirname
= xf86openConfigDirFiles(CONFIGDIRPATH
, xf86ConfigDir
, PROJECTROOT
);
136 filename
= xf86openConfigFile(CONFIGPATH
, xf86ConfigFile
, PROJECTROOT
);
138 /* Hack for backward compatibility */
139 if (!filename
&& from
== X_DEFAULT
)
140 filename
= xf86openConfigFile(CONFIGPATH
, "XF86Config", PROJECTROOT
);
143 winMsg(from
, "Using config file: \"%s\"\n", filename
);
146 winMsg(X_ERROR
, "Unable to locate/open config file");
148 ErrorF(": \"%s\"", xf86ConfigFile
);
152 winMsg(from
, "Using config directory: \"%s\"\n", dirname
);
155 winMsg(X_ERROR
, "Unable to locate/open config directory");
157 ErrorF(": \"%s\"", xf86ConfigDir
);
160 if (!filename
&& !dirname
) {
165 if ((g_xf86configptr
= xf86readConfigFile()) == NULL
) {
166 winMsg(X_ERROR
, "Problem parsing the config file\n");
169 xf86closeConfigFile();
173 /* set options from data structure */
175 if (g_xf86configptr
->conf_layout_lst
== NULL
||
176 g_cmdline
.screenname
!= NULL
) {
177 if (g_cmdline
.screenname
== NULL
) {
179 "No Layout section. Using the first Screen section.\n");
181 if (!configImpliedLayout(&g_winConfigLayout
,
182 g_xf86configptr
->conf_screen_lst
)) {
183 winMsg(X_ERROR
, "Unable to determine the screen layout\n");
188 /* Check if layout is given in the config file */
189 if (g_xf86configptr
->conf_flags
!= NULL
) {
190 char *dfltlayout
= NULL
;
191 void *optlist
= g_xf86configptr
->conf_flags
->flg_option_lst
;
193 if (optlist
&& winFindOption(optlist
, "defaultserverlayout"))
195 winSetStrOption(optlist
, "defaultserverlayout", NULL
);
197 if (!configLayout(&g_winConfigLayout
,
198 g_xf86configptr
->conf_layout_lst
, dfltlayout
)) {
199 winMsg(X_ERROR
, "Unable to determine the screen layout\n");
204 if (!configLayout(&g_winConfigLayout
,
205 g_xf86configptr
->conf_layout_lst
, NULL
)) {
206 winMsg(X_ERROR
, "Unable to determine the screen layout\n");
212 /* setup special config files */
218 /* load layout definitions */
219 #include "winlayouts.h"
221 /* Set the keyboard configuration */
223 winConfigKeyboard(DeviceIntPtr pDevice
)
225 char layoutName
[KL_NAMELENGTH
];
226 unsigned char layoutFriendlyName
[256];
227 unsigned int layoutNum
= 0;
228 unsigned int deviceIdentifier
= 0;
231 #ifdef XWIN_XF86CONFIG
232 XF86ConfInputPtr kbd
= NULL
;
233 XF86ConfInputPtr input_list
= NULL
;
234 MessageType kbdfrom
= X_CONFIG
;
236 MessageType from
= X_DEFAULT
;
240 XkbGetRulesDflts(&g_winInfo
.xkb
);
243 * Query the windows autorepeat settings and change the xserver defaults.
249 if (SystemParametersInfo(SPI_GETKEYBOARDDELAY
, 0, &kbd_delay
, 0) &&
250 SystemParametersInfo(SPI_GETKEYBOARDSPEED
, 0, &kbd_speed
, 0)) {
253 g_winInfo
.keyboard
.delay
= 250;
256 g_winInfo
.keyboard
.delay
= 500;
259 g_winInfo
.keyboard
.delay
= 750;
263 g_winInfo
.keyboard
.delay
= 1000;
266 g_winInfo
.keyboard
.rate
= (kbd_speed
> 0) ? kbd_speed
: 1;
267 winMsg(X_PROBED
, "Setting autorepeat to delay=%ld, rate=%ld\n",
268 g_winInfo
.keyboard
.delay
, g_winInfo
.keyboard
.rate
);
273 keyboardType
= GetKeyboardType(0);
274 if (keyboardType
> 0 && GetKeyboardLayoutName(layoutName
)) {
275 WinKBLayoutPtr pLayout
;
279 layoutNum
= strtoul(layoutName
, (char **) NULL
, 16);
280 if ((layoutNum
& 0xffff) == 0x411) {
281 if (keyboardType
== 7) {
282 /* Japanese layouts have problems with key event messages
283 such as the lack of WM_KEYUP for Caps Lock key.
284 Loading US layout fixes this problem. */
285 if (LoadKeyboardLayout("00000409", KLF_ACTIVATE
) != NULL
)
286 winMsg(X_INFO
, "Loading US keyboard layout.\n");
288 winMsg(X_ERROR
, "LoadKeyboardLayout failed.\n");
292 /* Discover the friendly name of the current layout */
295 const char regtempl
[] =
296 "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
298 DWORD namesize
= sizeof(layoutFriendlyName
);
300 regpath
= malloc(sizeof(regtempl
) + KL_NAMELENGTH
+ 1);
301 strcpy(regpath
, regtempl
);
302 strcat(regpath
, layoutName
);
304 if (!RegOpenKey(HKEY_LOCAL_MACHINE
, regpath
, ®key
))
305 RegQueryValueEx(regkey
, "Layout Text", 0, NULL
,
306 layoutFriendlyName
, &namesize
);
308 /* Close registry key */
315 "Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n",
316 layoutName
, layoutNum
, layoutFriendlyName
, keyboardType
);
318 deviceIdentifier
= layoutNum
>> 16;
319 for (pass
= 0; pass
< 2; pass
++) {
320 /* If we didn't find an exact match for the input locale identifier,
321 try to find an match on the language identifier part only */
323 layoutNum
= (layoutNum
& 0xffff);
325 for (pLayout
= winKBLayouts
; pLayout
->winlayout
!= -1; pLayout
++) {
326 if (pLayout
->winlayout
!= layoutNum
)
328 if (pLayout
->winkbtype
> 0 && pLayout
->winkbtype
!= keyboardType
)
333 "Found matching XKB configuration \"%s\"\n",
334 pLayout
->layoutname
);
337 "Model = \"%s\" Layout = \"%s\""
338 " Variant = \"%s\" Options = \"%s\"\n",
339 pLayout
->xkbmodel
? pLayout
->xkbmodel
: "none",
340 pLayout
->xkblayout
? pLayout
->xkblayout
: "none",
341 pLayout
->xkbvariant
? pLayout
->xkbvariant
: "none",
342 pLayout
->xkboptions
? pLayout
->xkboptions
: "none");
344 g_winInfo
.xkb
.model
= pLayout
->xkbmodel
;
345 g_winInfo
.xkb
.layout
= pLayout
->xkblayout
;
346 g_winInfo
.xkb
.variant
= pLayout
->xkbvariant
;
347 g_winInfo
.xkb
.options
= pLayout
->xkboptions
;
349 if (deviceIdentifier
== 0xa000) {
350 winMsg(X_PROBED
, "Windows keyboard layout device identifier indicates Macintosh, setting Model = \"macintosh\"");
351 g_winInfo
.xkb
.model
= "macintosh";
363 "Keyboardlayout \"%s\" (%s) is unknown, using X server default layout\n",
364 layoutFriendlyName
, layoutName
);
368 /* parse the configuration */
369 #ifdef XWIN_XF86CONFIG
370 if (g_cmdline
.keyboard
)
374 * Until the layout code is finished, I search for the keyboard
375 * device and configure the server with it.
378 if (g_xf86configptr
!= NULL
)
379 input_list
= g_xf86configptr
->conf_input_lst
;
381 while (input_list
!= NULL
) {
382 if (winNameCompare(input_list
->inp_driver
, "keyboard") == 0) {
383 /* Check if device name matches requested name */
384 if (g_cmdline
.keyboard
&& winNameCompare(input_list
->inp_identifier
,
389 input_list
= input_list
->list
.next
;
394 if (kbd
->inp_identifier
)
395 winMsg(kbdfrom
, "Using keyboard \"%s\" as primary keyboard\n",
396 kbd
->inp_identifier
);
398 if ((s
= winSetStrOption(kbd
->inp_option_lst
, "AutoRepeat", NULL
))) {
399 if ((sscanf(s
, "%ld %ld", &g_winInfo
.keyboard
.delay
,
400 &g_winInfo
.keyboard
.rate
) != 2) ||
401 (g_winInfo
.keyboard
.delay
< 1) ||
402 (g_winInfo
.keyboard
.rate
== 0) ||
403 (1000 / g_winInfo
.keyboard
.rate
) < 1) {
404 winErrorFVerb(2, "\"%s\" is not a valid AutoRepeat value", s
);
409 winMsg(X_CONFIG
, "AutoRepeat: %ld %ld\n",
410 g_winInfo
.keyboard
.delay
, g_winInfo
.keyboard
.rate
);
415 if (g_cmdline
.xkbRules
) {
416 s
= g_cmdline
.xkbRules
;
419 #ifdef XWIN_XF86CONFIG
421 s
= winSetStrOption(kbd
->inp_option_lst
, "XkbRules", NULL
);
426 g_winInfo
.xkb
.rules
= NULL_IF_EMPTY(s
);
427 winMsg(from
, "XKB: rules: \"%s\"\n", s
);
431 if (g_cmdline
.xkbModel
) {
432 s
= g_cmdline
.xkbModel
;
435 #ifdef XWIN_XF86CONFIG
437 s
= winSetStrOption(kbd
->inp_option_lst
, "XkbModel", NULL
);
442 g_winInfo
.xkb
.model
= NULL_IF_EMPTY(s
);
443 winMsg(from
, "XKB: model: \"%s\"\n", s
);
447 if (g_cmdline
.xkbLayout
) {
448 s
= g_cmdline
.xkbLayout
;
451 #ifdef XWIN_XF86CONFIG
453 s
= winSetStrOption(kbd
->inp_option_lst
, "XkbLayout", NULL
);
458 g_winInfo
.xkb
.layout
= NULL_IF_EMPTY(s
);
459 winMsg(from
, "XKB: layout: \"%s\"\n", s
);
463 if (g_cmdline
.xkbVariant
) {
464 s
= g_cmdline
.xkbVariant
;
467 #ifdef XWIN_XF86CONFIG
469 s
= winSetStrOption(kbd
->inp_option_lst
, "XkbVariant", NULL
);
474 g_winInfo
.xkb
.variant
= NULL_IF_EMPTY(s
);
475 winMsg(from
, "XKB: variant: \"%s\"\n", s
);
479 if (g_cmdline
.xkbOptions
) {
480 s
= g_cmdline
.xkbOptions
;
483 #ifdef XWIN_XF86CONFIG
485 s
= winSetStrOption(kbd
->inp_option_lst
, "XkbOptions", NULL
);
490 g_winInfo
.xkb
.options
= NULL_IF_EMPTY(s
);
491 winMsg(from
, "XKB: options: \"%s\"\n", s
);
494 #ifdef XWIN_XF86CONFIG
501 #ifdef XWIN_XF86CONFIG
503 winConfigMouse(DeviceIntPtr pDevice
)
505 MessageType mousefrom
= X_CONFIG
;
507 XF86ConfInputPtr mouse
= NULL
;
508 XF86ConfInputPtr input_list
= NULL
;
511 mousefrom
= X_CMDLINE
;
513 if (g_xf86configptr
!= NULL
)
514 input_list
= g_xf86configptr
->conf_input_lst
;
516 while (input_list
!= NULL
) {
517 if (winNameCompare(input_list
->inp_driver
, "mouse") == 0) {
518 /* Check if device name matches requested name */
519 if (g_cmdline
.mouse
&& winNameCompare(input_list
->inp_identifier
,
524 input_list
= input_list
->list
.next
;
528 if (mouse
->inp_identifier
)
529 winMsg(mousefrom
, "Using pointer \"%s\" as primary pointer\n",
530 mouse
->inp_identifier
);
532 g_winInfo
.pointer
.emulate3Buttons
=
533 winSetBoolOption(mouse
->inp_option_lst
, "Emulate3Buttons", FALSE
);
534 if (g_cmdline
.emulate3buttons
)
535 g_winInfo
.pointer
.emulate3Buttons
= g_cmdline
.emulate3buttons
;
537 g_winInfo
.pointer
.emulate3Timeout
=
538 winSetIntOption(mouse
->inp_option_lst
, "Emulate3Timeout", 50);
539 if (g_cmdline
.emulate3timeout
)
540 g_winInfo
.pointer
.emulate3Timeout
= g_cmdline
.emulate3timeout
;
543 winMsg(X_ERROR
, "No primary pointer configured\n");
544 winMsg(X_DEFAULT
, "Using compiletime defaults for pointer\n");
554 XF86ConfFilesPtr filesptr
= NULL
;
556 /* set some shortcuts */
557 if (g_xf86configptr
!= NULL
) {
558 filesptr
= g_xf86configptr
->conf_files
;
564 if (g_cmdline
.fontPath
) {
566 defaultFontPath
= g_cmdline
.fontPath
;
568 else if (filesptr
!= NULL
&& filesptr
->file_fontpath
) {
570 defaultFontPath
= strdup(filesptr
->file_fontpath
);
572 winMsg(from
, "FontPath set to \"%s\"\n", defaultFontPath
);
581 if (g_cmdline
.fontPath
) {
582 defaultFontPath
= g_cmdline
.fontPath
;
583 winMsg(X_CMDLINE
, "FontPath set to \"%s\"\n", defaultFontPath
);
591 winConfigOptions(void)
597 winConfigScreens(void)
602 #ifdef XWIN_XF86CONFIG
604 winSetStrOption(void *optlist
, const char *name
, char *deflt
)
609 o
.type
= OPTV_STRING
;
610 if (ParseOptionValue(-1, optlist
, &o
))
613 return strdup(deflt
);
619 winSetBoolOption(void *optlist
, const char *name
, int deflt
)
624 o
.type
= OPTV_BOOLEAN
;
625 if (ParseOptionValue(-1, optlist
, &o
))
626 deflt
= o
.value
.boolean
;
631 winSetIntOption(void *optlist
, const char *name
, int deflt
)
636 o
.type
= OPTV_INTEGER
;
637 if (ParseOptionValue(-1, optlist
, &o
))
643 winSetRealOption(void *optlist
, const char *name
, double deflt
)
649 if (ParseOptionValue(-1, optlist
, &o
))
650 deflt
= o
.value
.realnum
;
655 winSetPercentOption(void *optlist
, const char *name
, double deflt
)
660 o
.type
= OPTV_PERCENT
;
661 if (ParseOptionValue(-1, optlist
, &o
))
662 deflt
= o
.value
.realnum
;
668 * Compare two strings for equality. This is caseinsensitive and
669 * The characters '_', ' ' (space) and '\t' (tab) are treated as
674 winNameCompare(const char *s1
, const char *s2
)
678 if (!s1
|| *s1
== 0) {
685 while (*s1
== '_' || *s1
== ' ' || *s1
== '\t')
687 while (*s2
== '_' || *s2
== ' ' || *s2
== '\t')
690 c1
= (isupper((int) *s1
) ? tolower((int) *s1
) : *s1
);
691 c2
= (isupper((int) *s2
) ? tolower((int) *s2
) : *s2
);
699 while (*s1
== '_' || *s1
== ' ' || *s1
== '\t')
701 while (*s2
== '_' || *s2
== ' ' || *s2
== '\t')
704 c1
= (isupper((int) *s1
) ? tolower((int) *s1
) : *s1
);
705 c2
= (isupper((int) *s2
) ? tolower((int) *s2
) : *s2
);
710 #ifdef XWIN_XF86CONFIG
712 * Find the named option in the list.
713 * @return the pointer to the option record, or NULL if not found.
717 winFindOption(XF86OptionPtr list
, const char *name
)
720 if (winNameCompare(list
->opt_name
, name
) == 0)
722 list
= list
->list
.next
;
728 * Find the Value of an named option.
729 * @return The option value or NULL if not found.
733 winFindOptionValue(XF86OptionPtr list
, const char *name
)
735 list
= winFindOption(list
, name
);
738 return list
->opt_val
;
750 ParseOptionValue(int scrnIndex
, void *options
, OptionInfoPtr p
)
754 if ((s
= winFindOptionValue(options
, p
->name
)) != NULL
) {
758 winDrvMsg(scrnIndex
, X_WARNING
,
759 "Option \"%s\" requires an integer value\n", p
->name
);
763 p
->value
.num
= strtoul(s
, &end
, 0);
768 winDrvMsg(scrnIndex
, X_WARNING
,
769 "Option \"%s\" requires an integer value\n",
777 winDrvMsg(scrnIndex
, X_WARNING
,
778 "Option \"%s\" requires a string value\n", p
->name
);
792 winDrvMsg(scrnIndex
, X_WARNING
,
793 "Option \"%s\" requires a floating point value\n",
798 p
->value
.realnum
= strtod(s
, &end
);
803 winDrvMsg(scrnIndex
, X_WARNING
,
804 "Option \"%s\" requires a floating point value\n",
811 if (GetBoolValue(p
, s
)) {
815 winDrvMsg(scrnIndex
, X_WARNING
,
816 "Option \"%s\" requires a boolean value\n", p
->name
);
822 winDrvMsg(scrnIndex
, X_WARNING
,
823 "Option \"%s\" requires a percent value\n", p
->name
);
827 double percent
= strtod(s
, &end
);
829 if (end
!= s
&& winNameCompare(end
, "%")) {
831 p
->value
.realnum
= percent
;
834 winDrvMsg(scrnIndex
, X_WARNING
,
835 "Option \"%s\" requires a frequency value\n",
842 winDrvMsg(scrnIndex
, X_WARNING
,
843 "Option \"%s\" requires a frequency value\n",
848 double freq
= strtod(s
, &end
);
853 if (!winNameCompare(end
, "Hz"))
855 else if (!winNameCompare(end
, "kHz") ||
856 !winNameCompare(end
, "k"))
858 else if (!winNameCompare(end
, "MHz") ||
859 !winNameCompare(end
, "M"))
862 winDrvMsg(scrnIndex
, X_WARNING
,
863 "Option \"%s\" requires a frequency value\n",
868 freq
*= (double) units
;
871 winDrvMsg(scrnIndex
, X_WARNING
,
872 "Option \"%s\" requires a frequency value\n",
877 p
->value
.freq
.freq
= freq
;
878 p
->value
.freq
.units
= units
;
883 /* Should never get here */
888 winDrvMsgVerb(scrnIndex
, X_CONFIG
, 2, "Option \"%s\"", p
->name
);
889 if (!(p
->type
== OPTV_BOOLEAN
&& *s
== 0)) {
890 winErrorFVerb(2, " \"%s\"", s
);
892 winErrorFVerb(2, "\n");
895 else if (p
->type
== OPTV_BOOLEAN
) {
896 /* Look for matches with options with or without a "No" prefix. */
900 n
= winNormalizeName(p
->name
);
905 if (strncmp(n
, "no", 2) == 0) {
910 n
= malloc(strlen(p
->name
) + 2 + 1);
919 if ((s
= winFindOptionValue(options
, newn
)) != NULL
) {
920 if (GetBoolValue(&opt
, s
)) {
921 p
->value
.boolean
= !opt
.value
.boolean
;
925 winDrvMsg(scrnIndex
, X_WARNING
,
926 "Option \"%s\" requires a boolean value\n", newn
);
934 winDrvMsgVerb(scrnIndex
, X_CONFIG
, 2, "Option \"%s\"", newn
);
936 winErrorFVerb(2, " \"%s\"", s
);
938 winErrorFVerb(2, "\n");
949 configLayout(serverLayoutPtr servlayoutp
, XF86ConfLayoutPtr conf_layout
,
950 char *default_layout
)
953 #pragma warn UNIMPLEMENTED
959 configImpliedLayout(serverLayoutPtr servlayoutp
, XF86ConfScreenPtr conf_screen
)
962 #pragma warn UNIMPLEMENTED
968 GetBoolValue(OptionInfoPtr p
, const char *s
)
971 p
->value
.boolean
= TRUE
;
974 if (winNameCompare(s
, "1") == 0)
975 p
->value
.boolean
= TRUE
;
976 else if (winNameCompare(s
, "on") == 0)
977 p
->value
.boolean
= TRUE
;
978 else if (winNameCompare(s
, "true") == 0)
979 p
->value
.boolean
= TRUE
;
980 else if (winNameCompare(s
, "yes") == 0)
981 p
->value
.boolean
= TRUE
;
982 else if (winNameCompare(s
, "0") == 0)
983 p
->value
.boolean
= FALSE
;
984 else if (winNameCompare(s
, "off") == 0)
985 p
->value
.boolean
= FALSE
;
986 else if (winNameCompare(s
, "false") == 0)
987 p
->value
.boolean
= FALSE
;
988 else if (winNameCompare(s
, "no") == 0)
989 p
->value
.boolean
= FALSE
;
996 winNormalizeName(const char *s
)
1004 ret
= malloc(strlen(s
) + 1);
1005 for (p
= s
, q
= ret
; *p
!= 0; p
++) {
1012 if (isupper((int) *p
))
1013 *q
++ = tolower((int) *p
);