This shows you the differences between two versions of the page.
client:defaults [2018/04/15 06:10] karl created |
client:defaults [2018/04/15 14:36] (current) karl [Crossfire Client configuration file defaults] Remove FIXME, add explanation, why it is case sensitive ( by strcmp ) , |
||
---|---|---|---|
Line 3: | Line 3: | ||
The //defaults// file is usually located inside the **.**[[crossfire]] directory. \\ | The //defaults// file is usually located inside the **.**[[crossfire]] directory. \\ | ||
This file applies to the very old **X11** client for crossfire, \\ | This file applies to the very old **X11** client for crossfire, \\ | ||
- | The newer gtk clients uses the [[gdefaults]] file as configuration file. \\ | + | The newer gtk clients are using the [[gdefaults]] file as configuration file. \\ |
At the top of the file one reads : | At the top of the file one reads : | ||
Line 12: | Line 12: | ||
# 'True' and 'False' are the proper cases for those two values | # 'True' and 'False' are the proper cases for those two values | ||
</code> | </code> | ||
- | FIXME \\ | + | The code in function //load_defaults()// in file //client/x11/x11.c// parses as follows : |
- | Xorg is case insensitive reading it's xorg.conf configuration file, \\ | + | <code c> |
- | and is able to use either False / True , Off / On , and probaly also 0 / 1 values of variables. | + | if (inbuf[0]=='#') continue; |
+ | /* IF no colon, then we certainly don't have a real value, so just skip */ | ||
+ | if (!(cp=strchr(inbuf,':'))) continue; | ||
+ | *cp='\0'; | ||
+ | cp+=2; /* colon, space, then value */ | ||
+ | </code> | ||
+ | Meaning, that lines starting with **#** are ignored, \\ | ||
+ | lines need to contain a colon **:** or are ignored, \\ | ||
+ | and may have any content. \\ | ||
+ | The code then uses ''strcmp'' for the **keyword** and **True** and **False** , which is case sensitive; as in | ||
+ | <code c> | ||
+ | if (!strcmp(inbuf,"cacheimages")) { | ||
+ | if (!strcmp(cp,"True")) want_config[CONFIG_CACHE]=TRUE; | ||
+ | else want_config[CONFIG_CACHE]=FALSE; | ||
+ | continue; | ||
+ | </code> | ||
===== Entries == | ===== Entries == |