2 #include <string.h> /* strlen & strcat */
3 #include <ctype.h> /* toupper */
5 #include <WINGs/WUtil.h>
9 /* Let's make lint happy */
10 #define lputs(x) (void)puts(x)
12 char *read_param(char *string
)
20 /* Command line parameters take precedence over all */
22 if (!strcmp(string
, "Icon1") && icon1
)
24 if (!strcmp(string
, "Icon2") && icon2
)
26 if (!strcmp(string
, "Icon3") && icon3
)
28 if (!strcmp(string
, "Icon4") && icon4
)
30 if (!strcmp(string
, "IconBoom") && iconboom
)
34 * Here we start the game with property lists.
35 * pl will be property list, read from DEFAULTS_FILE.
36 * tmp will be temporary key for this property list,
37 * constructed using ``string'', supplied to function.
38 * value will be property list, which contain the value
42 path
= wexpandpath(DEFAULTS_FILE
);
43 pl
= WMReadPropListFromFile(path
);
47 lputs("Cannot open config file: ");
52 tmp
= WMCreatePLString(string
);
53 value
= WMGetFromPLDictionary(pl
, tmp
);
54 WMReleasePropList(tmp
);
57 * pl and value objects will exist as long as fookb is running
61 lputs("Cannot find in config file value for: ");
66 if (!WMIsPLString(value
)) {
69 lputs("in config file is not a string.");
73 result
= WMGetFromPLString(value
);
76 lputs("Something wrong with libWUtils :(");
77 lputs("Please report this error to fookb author.");