Lost of changes

This commit is contained in:
Michiel Broek
2004-01-25 10:57:35 +00:00
parent 1382701bd8
commit 5a0e317f23
41 changed files with 762 additions and 604 deletions

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Common utilities
*
*****************************************************************************
* Copyright (C) 1997-2003
* Copyright (C) 1997-2004
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -514,7 +514,7 @@ int Waitchar(unsigned char *ch, int wtime)
rc = read(ttyfd, ch, 1);
if (rc == 1)
return rc;
usleep(10000);
msleep(10);
}
return rc;
}
@@ -862,6 +862,42 @@ void mvprintw(int y, int x, const char *format, ...)
/*
* * Milliseconds timer, returns 0 on success.
* */
int msleep(int msecs)
{
int rc;
struct timespec req, rem;
rem.tv_sec = 0;
rem.tv_nsec = 0;
req.tv_sec = msecs / 1000;
req.tv_nsec = (msecs % 1000) * 1000000;
while (TRUE) {
rc = nanosleep(&req, &rem);
if (rc == 0)
break;
if ((errno == EINVAL) || (errno == EFAULT)) {
Syslog('?', "$msleep(%d)", msecs);
break;
}
/*
* Error was EINTR, run timer again to complete.
*/
req.tv_sec = rem.tv_sec;
req.tv_nsec = rem.tv_nsec;
rem.tv_sec = 0;
rem.tv_nsec = 0;
}
return rc;
}
/*
* Signal handler signal names.
*/

View File

@@ -86,7 +86,7 @@ void colour(int, int);
void clear(void);
void locate(int, int);
void mvprintw(int, int, const char *, ...);
int msleep(int);
#endif

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Utilities
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2004
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -531,9 +531,9 @@ void working(int txno, int y, int x)
for (i = 1; i <= 5; i++) {
putchar(7);
fflush(stdout);
usleep(150000);
msleep(150);
}
usleep(550000);
msleep(550);
break;
case 3: mvprintw(4, columns - 14, (char *)"Form inserted");
putchar(7);