1 /* xscreensaver, Copyright (c) 1992 Jamie Zawinski <jwz@mcom.com>
3 * Permission to use, copy, modify, distribute, and sell this software and its
4 * documentation for any purpose is hereby granted without fee, provided that
5 * the above copyright notice appear in all copies and that both that
6 * copyright notice and this permission notice appear in supporting
7 * documentation. No representations are made about the suitability of this
8 * software for any purpose. It is provided "as is" without express or
17 #include <X11/Xos.h> /* lazy way out */
22 extern char *progname;
23 #include <lib$routines.h>
24 unsigned long int statvms;
28 /* usleep() doesn't exist everywhere, and select() is faster anyway.
34 /* If you don't have select() or usleep(), I guess you lose...
35 Maybe you have napms() instead? Let me know.
38 screenhack_usleep (usecs)
44 #else /* ! NO_SELECT */
47 screenhack_usleep (usecs)
51 tv.tv_sec = usecs / 1000000L;
52 tv.tv_usec = usecs % 1000000L;
53 (void) select (0, 0, 0, 0, &tv);
56 #endif /* ! NO_SELECT */
60 #define SEC_DELTA "0000 00:00:01.00"
61 #define TICK_DELTA "0000 00:00:00.08"
62 static int bin_sec_delta[2], bin_tick_delta[2], deltas_set = 0;
68 extern int SYS$BINTIM ();
69 $DESCRIPTOR (str_sec_delta, SEC_DELTA);
70 $DESCRIPTOR (str_tick_delta, TICK_DELTA);
73 status = SYS$BINTIM (&str_sec_delta, &bin_sec_delta);
76 fprintf (stderr, "%s: cannot convert delta time ", progname);
77 fprintf (stderr, SEC_DELTA);
78 fprintf (stderr, "; status code = %d\n", status);
81 status = SYS$BINTIM (&str_tick_delta, &bin_tick_delta);
84 fprintf (stderr, "%s: cannot convert delta time ", progname);
85 fprintf (stderr, TICK_DELTA);
86 fprintf (stderr, "; status code = %d\n", status);
94 screenhack_usleep (usecs)
97 int status, *bin_delta;
99 /* extern int SYS$SCHWDK (), SYS$HIBER (); */
100 /*#define TICK_INTERVAL 1000 */
102 /* if (!deltas_set) set_deltas (); */
103 /* bin_delta = (usecs == TICK_INTERVAL) ? &bin_tick_delta : &bin_sec_delta; */
104 /* status = SYS$SCHDWK (0, 0, bin_delta, 0); */
105 /* if ((status & 1)) (void) SYS$HIBER (); */
107 seconds = ((float) usecs)/1000000.0;
108 statvms = lib$wait(&seconds);