diff options
author | Simon Rettberg | 2021-04-06 14:23:46 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-04-06 14:23:46 +0200 |
commit | 26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9 (patch) | |
tree | a51e1637554bcd84e63cccb1cb220c898a2c4ee8 /driver/test-xinerama.c | |
parent | 5.44 (diff) | |
download | xscreensaver-26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9.tar.gz xscreensaver-26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9.tar.xz xscreensaver-26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9.zip |
xscreensaver 6.00
Diffstat (limited to 'driver/test-xinerama.c')
-rw-r--r-- | driver/test-xinerama.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/driver/test-xinerama.c b/driver/test-xinerama.c index 8bafbb0..cd8add4 100644 --- a/driver/test-xinerama.c +++ b/driver/test-xinerama.c @@ -1,5 +1,5 @@ /* test-xinerama.c --- playing with the Xinerama extension. - * xscreensaver, Copyright (c) 2003 Jamie Zawinski <jwz@jwz.org> + * xscreensaver, Copyright © 2003-2021 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 @@ -30,26 +30,9 @@ #include <X11/Xproto.h> #include <X11/extensions/Xinerama.h> -char *progname = 0; +#include "blurb.h" char *progclass = "XScreenSaver"; -static const char * -blurb (void) -{ - static char buf[255]; - time_t now = time ((time_t *) 0); - char *ct = (char *) ctime (&now); - int n = strlen(progname); - if (n > 100) n = 99; - strncpy(buf, progname, n); - buf[n++] = ':'; - buf[n++] = ' '; - strncpy(buf+n, ct+11, 8); - strcpy(buf+n+9, ": "); - return buf; -} - - int main (int argc, char **argv) { @@ -63,13 +46,12 @@ main (int argc, char **argv) Widget toplevel_shell = XtAppInitialize (&app, progclass, 0, 0, &argc, argv, 0, 0, 0); Display *dpy = XtDisplay (toplevel_shell); - XtGetApplicationNameAndClass (dpy, &progname, &progclass); if (!XineramaQueryExtension(dpy, &event_number, &error_number)) { fprintf(stderr, "%s: XineramaQueryExtension(dpy, ...) ==> False\n", blurb()); - fprintf(stderr, "%s: server does not support the Xinerama extension.\n", + fprintf(stderr, "%s: server does not support the Xinerama extension\n", blurb()); exit(1); } @@ -80,7 +62,7 @@ main (int argc, char **argv) if (!XineramaIsActive(dpy)) { fprintf(stderr, "%s: XineramaIsActive(dpy) ==> False\n", blurb()); - fprintf(stderr, "%s: server says Xinerama is turned off.\n", blurb()); + fprintf(stderr, "%s: server says Xinerama is turned off\n", blurb()); exit(1); } else |