| 1 |
|
| 2 |
|
| 3 |
#include "pdcx11.h" |
| 4 |
|
| 5 |
RCSID("$Id: pdcutil.c,v 1.10 2008/07/14 04:24:52 wmcbrine Exp $") |
| 6 |
|
| 7 |
#if defined(HAVE_POLL) && !defined(HAVE_USLEEP) |
| 8 |
# include <poll.h> |
| 9 |
#endif |
| 10 |
|
| 11 |
void PDC_beep(void) |
| 12 |
{ |
| 13 |
PDC_LOG(("PDC_beep() - called\n")); |
| 14 |
|
| 15 |
XCursesInstruct(CURSES_BELL); |
| 16 |
} |
| 17 |
|
| 18 |
void PDC_napms(int ms) |
| 19 |
{ |
| 20 |
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); |
| 21 |
|
| 22 |
#if defined(HAVE_USLEEP) |
| 23 |
|
| 24 |
usleep(1000 * ms); |
| 25 |
|
| 26 |
#elif defined(HAVE_POLL) |
| 27 |
{ |
| 28 |
struct pollfd fd; |
| 29 |
fd.fd = -1; |
| 30 |
fd.events = 0; |
| 31 |
poll(&fd, 1, ms); |
| 32 |
} |
| 33 |
#endif |
| 34 |
} |
| 35 |
|
| 36 |
const char *PDC_sysname(void) |
| 37 |
{ |
| 38 |
return "X11"; |
| 39 |
} |