http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.16.tar.gz
[xscreensaver] / driver / prefs.c
index 180dfca6478f31d4bd0bb06b7b83118efcf24994..9a68afc73e77af73a3c922a1db8dbf14dd808c66 100644 (file)
@@ -1,5 +1,5 @@
 /* dotfile.c --- management of the ~/.xscreensaver file.
- * xscreensaver, Copyright (c) 1998 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1998-2004 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -90,7 +90,7 @@ chase_symlinks (const char *file)
       if (realpath (file, buf))
         return strdup (buf);
 
-      sprintf (buf, "%s: realpath", blurb());
+      sprintf (buf, "%.100s: realpath %.200s", blurb(), file);
       perror(buf);
     }
 # endif /* HAVE_REALPATH */
@@ -244,6 +244,7 @@ static const char * const prefs[] = {
   "timestamp",
   "splash",
   "splashDuration",
+  "quad",
   "demoCommand",
   "prefsCommand",
   "helpURL",
@@ -256,6 +257,7 @@ static const char * const prefs[] = {
   "fadeTicks",
   "captureStderr",
   "captureStdout",             /* not saved -- obsolete */
+  "ignoreUninstalledPrograms",
   "font",
   "dpmsEnabled",
   "dpmsStandby",
@@ -276,6 +278,7 @@ static const char * const prefs[] = {
   "sgiSaverExtension",
   "mitSaverExtension",
   "xidleExtension",
+  "GetViewPortIsFullOfLies",
   "procInterrupts",
   "overlayStderr",
   "overlayTextBackground",     /* not saved -- X resources only */
@@ -766,10 +769,13 @@ write_init_file (saver_preferences *p, const char *version_string,
       CHECK("timestamp")       type = pref_bool, b = p->timestamp_p;
       CHECK("splash")          type = pref_bool, b = p->splash_p;
       CHECK("splashDuration")  type = pref_time, t = p->splash_duration;
+      CHECK("quad")            type = pref_bool, b = p->quad_p;
       CHECK("demoCommand")     type = pref_str,  s = p->demo_command;
       CHECK("prefsCommand")    type = pref_str,  s = p->prefs_command;
-      CHECK("helpURL")         type = pref_str,  s = p->help_url;
-      CHECK("loadURL")         type = pref_str,  s = p->load_url_command;
+/*    CHECK("helpURL")         type = pref_str,  s = p->help_url; */
+      CHECK("helpURL")         continue;  /* don't save */
+/*    CHECK("loadURL")         type = pref_str,  s = p->load_url_command; */
+      CHECK("loadURL")         continue;  /* don't save */
       CHECK("nice")            type = pref_int,  i = p->nice_inferior;
       CHECK("memoryLimit")     type = pref_byte, i = p->inferior_memory_limit;
       CHECK("fade")            type = pref_bool, b = p->fade_p;
@@ -778,6 +784,9 @@ write_init_file (saver_preferences *p, const char *version_string,
       CHECK("fadeTicks")       type = pref_int,  i = p->fade_ticks;
       CHECK("captureStderr")   type = pref_bool, b = p->capture_stderr_p;
       CHECK("captureStdout")   continue;  /* don't save */
+      CHECK("ignoreUninstalledPrograms")
+                                type = pref_bool, b = p->ignore_uninstalled_p;
+
       CHECK("font")            type = pref_str,  s =    stderr_font;
 
       CHECK("dpmsEnabled")     type = pref_bool, b = p->dpms_enabled_p;
@@ -805,6 +814,8 @@ write_init_file (saver_preferences *p, const char *version_string,
       CHECK("mitSaverExtension")type = pref_bool, b=p->use_mit_saver_extension;
       CHECK("xidleExtension")  type = pref_bool, b = p->use_xidle_extension;
       CHECK("procInterrupts")  type = pref_bool, b = p->use_proc_interrupts;
+      CHECK("GetViewPortIsFullOfLies")  type = pref_bool,
+                                       b = p->getviewport_full_of_lies_p;
       CHECK("overlayStderr")   type = pref_bool, b = overlay_stderr_p;
       CHECK("overlayTextBackground") continue;  /* don't save */
       CHECK("overlayTextForeground") continue;  /* don't save */
@@ -998,7 +1009,10 @@ load_init_file (saver_preferences *p)
   p->nice_inferior  = get_integer_resource ("nice", "Nice");
   p->inferior_memory_limit = get_byte_resource ("memoryLimit", "MemoryLimit");
   p->splash_p       = get_boolean_resource ("splash", "Boolean");
+  p->quad_p         = get_boolean_resource ("quad", "Boolean");
   p->capture_stderr_p = get_boolean_resource ("captureStderr", "Boolean");
+  p->ignore_uninstalled_p = get_boolean_resource ("ignoreUninstalledPrograms",
+                                                  "Boolean");
 
   p->initial_delay   = 1000 * get_seconds_resource ("initialDelay", "Time");
   p->splash_duration = 1000 * get_seconds_resource ("splashDuration", "Time");
@@ -1054,6 +1068,9 @@ load_init_file (saver_preferences *p)
                                                     "Boolean");
   p->use_proc_interrupts = get_boolean_resource ("procInterrupts", "Boolean");
 
+  p->getviewport_full_of_lies_p =
+    get_boolean_resource ("GetViewPortIsFullOfLies", "Boolean");
+
   get_screenhacks (p);                /* Parse the "programs" resource. */
 
   p->selected_hack = get_integer_resource ("selected", "Integer");
@@ -1312,6 +1329,10 @@ make_hack_name (const char *shell_command)
     s[0] -= 'a'-'A';
   if (s[0] == 'X' && s[1] >= 'a' && s[1] <= 'z')       /* (magic leading X) */
     s[1] -= 'a'-'A';
+  if (s[0] == 'G' && s[1] == 'l' && 
+      s[2] >= 'a' && s[2] <= 'z')                     /* (magic leading GL) */
+    s[1] -= 'a'-'A',
+    s[2] -= 'a'-'A';
   return s;
 }