rnd-20070131-1-src
[rocksndiamonds.git] / src / libgame / misc.c
index f9b8b2570134b840e1cd41f418e5a207c12cedc9..88d2e299409024e5eb76c2fa66ecbd4c0b1b57d9 100644 (file)
@@ -1219,6 +1219,7 @@ void translate_keyname(Key *keysym, char **x11name, char **name, int mode)
     { KSYM_asciitilde, "XK_asciitilde",        "~" },
 
     /* special (non-ASCII) keys */
+    { KSYM_degree,     "XK_degree",            "°" },
     { KSYM_Adiaeresis, "XK_Adiaeresis",        "Ä" },
     { KSYM_Odiaeresis, "XK_Odiaeresis",        "Ö" },
     { KSYM_Udiaeresis, "XK_Udiaeresis",        "Ü" },
@@ -1447,16 +1448,23 @@ Key getKeyFromX11KeyName(char *x11name)
 char getCharFromKey(Key key)
 {
   char *keyname = getKeyNameFromKey(key);
-  char letter = 0;
+  char c = 0;
 
   if (strlen(keyname) == 1)
-    letter = keyname[0];
+    c = keyname[0];
   else if (strEqual(keyname, "space"))
-    letter = ' ';
-  else if (strEqual(keyname, "circumflex"))
-    letter = '^';
+    c = ' ';
 
-  return letter;
+  return c;
+}
+
+char getValidConfigValueChar(char c)
+{
+  if (c == '#' ||      /* used to mark comments */
+      c == '\\')       /* used to mark continued lines */
+    c = 0;
+
+  return c;
 }
 
 
@@ -1965,6 +1973,10 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list,
 
       file_list[list_pos].token = config_list[i].token;
       file_list[list_pos].default_filename = config_list[i].value;
+
+#if 0
+      printf("::: '%s' => '%s'\n", config_list[i].token, config_list[i].value);
+#endif
     }
   }
 
@@ -1973,13 +1985,17 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list,
   {
     Error(ERR_RETURN_LINE, "-");
     Error(ERR_RETURN, "inconsistant config list information:");
-    Error(ERR_RETURN, "- should be:   %d (according to 'src/conf_gfx.h')",
+    Error(ERR_RETURN, "- should be:   %d (according to 'src/conf_xxx.h')",
          num_file_list_entries);
-    Error(ERR_RETURN, "- found to be: %d (according to 'src/conf_gfx.c')",
+    Error(ERR_RETURN, "- found to be: %d (according to 'src/conf_xxx.c')",
          num_file_list_entries_found);
     Error(ERR_EXIT,   "please fix");
   }
 
+#if 0
+  printf("::: ---------- DONE ----------\n");
+#endif
+
   return file_list;
 }