http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.28.tar.gz
[xscreensaver] / driver / test-passwd.c
index dfb7da25c22f55977d1b956b10477c0b2bee575e..eaa884ff2ecb460769e3bcf0c48cc5373b440faa 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1998 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1998, 2001 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
    itself.
  */
 
-#define WHICH 0
+#define WHICH_PASS   100
+#define WHICH_SPLASH 101
+#define WHICH_TTY    102
+
+#define WHICH        WHICH_PASS
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -55,7 +59,9 @@ Bool handle_clientmessage (saver_info *si, XEvent *e, Bool u) { return False; }
 int BadWindow_ehandler (Display *dpy, XErrorEvent *error) { exit(1); }
 const char *signal_name(int signal) { return "???"; }
 void restore_real_vroot (saver_info *si) {}
+void store_saver_status (saver_info *si) {}
 void saver_exit (saver_info *si, int status, const char *core) { exit(status);}
+int move_mouse_grab (saver_info *si, Window to, Cursor cursor) { return 0; }
 
 const char *blurb(void) { return progname; }
 Atom XA_SCREENSAVER, XA_DEMO, XA_PREFS;
@@ -131,7 +137,7 @@ main (int argc, char **argv)
 
   progclass = "XScreenSaver";
 
-#if (WHICH != 2)
+#if (WHICH != WHICH_TTY)
   toplevel_shell = XtAppInitialize (&si->app, progclass, 0, 0,
                                    &argc, argv, fallback,
                                    0, 0);
@@ -160,7 +166,7 @@ main (int argc, char **argv)
 
   while (1)
     {
-#if WHICH == 0
+#if WHICH == WHICH_PASS
       if (unlock_p (si))
        fprintf (stderr, "%s: password correct\n", progname);
       else
@@ -168,7 +174,7 @@ main (int argc, char **argv)
 
       XSync(si->dpy, False);
       sleep (3);
-#elif WHICH == 1
+#elif WHICH == WHICH_SPLASH
       {
        XEvent event;
        make_splash_dialog (si);
@@ -184,7 +190,7 @@ main (int argc, char **argv)
        XSync (si->dpy, False);
        sleep (1);
       }
-#elif WHICH == 2
+#elif WHICH == WHICH_TTY
       {
         char *pass;
         char buf[255];
@@ -202,6 +208,8 @@ main (int argc, char **argv)
         else
           printf ("%s: Wrong!\n", progname);
       }
+#else
+# error bogus WHICH value!
 #endif
     }
 }