|
|
@ -1,20 +1,24 @@
|
|
|
|
/* $Id: sysfunc.c,v 1.9 2003/05/07 18:52:13 stpohle Exp $
|
|
|
|
/* $Id: sysfunc.c,v 1.10 2003/05/07 18:52:57 stpohle Exp $
|
|
|
|
sysfunc.c - this file hold some routines for the system functions..
|
|
|
|
sysfunc.c - this file hold some routines for the system functions..
|
|
|
|
like d_delay
|
|
|
|
like d_delay
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "bomberclone.h"
|
|
|
|
#include "bomberclone.h"
|
|
|
|
#include "sysfunc.h"
|
|
|
|
#include "sysfunc.h"
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
s_delay (int ms)
|
|
|
|
s_delay (int ms)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fd_set selectset;
|
|
|
|
fd_set selectset;
|
|
|
|
struct timeval tval;
|
|
|
|
struct timeval tval;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ms < 20) {
|
|
|
|
FD_ZERO (&selectset);
|
|
|
|
FD_ZERO (&selectset);
|
|
|
|
tval.tv_sec = 0;
|
|
|
|
tval.tv_sec = 0;
|
|
|
|
tval.tv_usec = ms * 1000;
|
|
|
|
tval.tv_usec = ms * 1000;
|
|
|
|
select (1, &selectset, NULL, NULL, &tval);
|
|
|
|
select (1, &selectset, NULL, NULL, &tval);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else usleep (1000 * ms);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
int
|
|
|
|