Supply oriental theme settings
[xboard.git] / args.h
diff --git a/args.h b/args.h
index 9533406..827952e 100644 (file)
--- a/args.h
+++ b/args.h
@@ -468,6 +468,7 @@ ArgDescriptor argDescriptors[] = {
   { "soundSeek", ArgFilename, (void *) &appData.soundSeek, TRUE, (ArgIniType) "" },
   { "soundMove", ArgFilename, (void *) &appData.soundMove, TRUE, (ArgIniType) "" },
   { "soundBell", ArgFilename, (void *) &appData.soundBell, TRUE, (ArgIniType) SOUND_BELL },
+  { "soundRoar", ArgFilename, (void *) &appData.soundRoar, TRUE, (ArgIniType) "" },
   { "soundIcsWin", ArgFilename, (void *) &appData.soundIcsWin, TRUE, (ArgIniType) "" },
   { "soundIcsLoss", ArgFilename, (void *) &appData.soundIcsLoss, TRUE, (ArgIniType) "" },
   { "soundIcsDraw", ArgFilename, (void *) &appData.soundIcsDraw, TRUE, (ArgIniType) "" },
@@ -597,6 +598,7 @@ ArgDescriptor argDescriptors[] = {
   { "useBorder", ArgBoolean, (void *) &appData.useBorder, TRUE, (ArgIniType) FALSE },
   { "ub", ArgBoolean, (void *) &appData.useBorder, FALSE, INVALID },
   { "border", ArgFilename, (void *) &appData.border, TRUE, (ArgIniType) "" },
+  { "finger", ArgFilename, (void *) &appData.finger, FALSE, (ArgIniType) "" },
 
   // [HGM] tournament options
   { "tourneyFile", ArgFilename, (void *) &appData.tourneyFile, FALSE, (ArgIniType) "" },
@@ -873,6 +875,12 @@ ParseSettingsFile(char *name, char **addr)
     }
   if (ok) {
     f = fopen(fullname, "r");
+#ifdef DATADIR
+    if(f == NULL && *fullname != '/') {         // when a relative name did not work
+       MySearchPath(DATADIR "/themes/conf", name, fullname); // also look in standard place
+       f = fopen(fullname, "r");
+    }
+#endif
     if (f != NULL) {
       if (addr != NULL) {
            ASSIGN(*addr, fullname);
@@ -919,8 +927,10 @@ ParseArgs(GetFunc get, void *cl)
       for (ad = argDescriptors; ad->argName != NULL; ad++)
        if (strcmp(ad->argName, argName + 1) == 0) break;
       if (ad->argName == NULL) {
+       char endChar = (ch && ch != '\n' && (ch = get(cl)) == '{' ? '}' : '\n');
        ExitArgError(_("Unrecognized argument %s"), argName, get != &FileGet); // [HGM] make unknown argument non-fatal
-       while (ch != '\n' && ch != NULLCHAR) ch = get(cl); // but skip rest of line it is on
+       while (ch != endChar && ch != NULLCHAR) ch = get(cl); // but skip rest of line it is on (or until closing '}' )
+       if(ch == '}') ch = get(cl);
        continue; // so that when it is in a settings file, it is the only setting that will be purged from it
       }
     } else if (ch == '@') {
@@ -1103,6 +1113,14 @@ ParseArgs(GetFunc get, void *cl)
 
     case ArgString:
     case ArgFilename:
+#ifdef DATADIR
+      if(argValue[0] == '~' && argValue[1] == '~') {
+        char buf[4*MSG_SIZ]; // expand ~~
+        snprintf(buf, 4*MSG_SIZ, DATADIR "%s", argValue+2);
+        ASSIGN(*(char **) ad->argLoc, buf);
+        break;
+      }
+#endif
       ASSIGN(*(char **) ad->argLoc, argValue);
       break;