+
+\f
+/* Button callbacks */
+
+#ifdef VMS
+# define pid_t int
+# define fork vfork
+#endif /* VMS */
+
+
+static void
+do_demo (saver_screen_info *ssi)
+{
+ saver_info *si = ssi->global;
+ saver_preferences *p = &si->prefs;
+ const char *cmd = p->demo_command;
+
+ if (cmd && *cmd)
+ fork_and_exec (ssi, cmd);
+ else
+ fprintf (stderr, "%s: no demo-mode command has been specified.\n",
+ blurb());
+}
+
+#ifdef PREFS_BUTTON
+static void
+do_prefs (saver_screen_info *ssi)
+{
+ saver_info *si = ssi->global;
+ saver_preferences *p = &si->prefs;
+ const char *cmd = p->prefs_command;
+
+ if (command && *command)
+ fork_and_exec (ssi, cmd);
+ else
+ fprintf (stderr, "%s: no preferences command has been specified.\n",
+ blurb());
+}
+#endif /* PREFS_BUTTON */
+
+static void
+do_help (saver_screen_info *ssi)
+{
+ saver_info *si = ssi->global;
+ saver_preferences *p = &si->prefs;
+ char *help_command = 0;
+
+ if (!p->load_url_command || !*p->load_url_command)
+ {
+ fprintf (stderr, "%s: no URL command has been specified.\n", blurb());
+ return;
+ }
+ if (!p->help_url || !*p->help_url)
+ {
+ fprintf (stderr, "%s: no Help URL has been specified.\n", blurb());
+ return;
+ }
+
+ help_command = (char *) malloc (strlen (p->load_url_command) +
+ (strlen (p->help_url) * 4) + 10);
+ sprintf (help_command, p->load_url_command,
+ p->help_url, p->help_url, p->help_url, p->help_url);
+
+ fork_and_exec (ssi, help_command);
+ free (help_command);
+}