1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
#include "config.h"
#include <sys/time.h>
#include <signal.h>
#include <stdio.h>
#include "fep.h"
static char *lastmodestr;
static char *curmodestr;
#ifdef NO_USLEEP
/*
* alarm in microsecond
*/
static
alarm_ms(n)
int n;
{
struct itimerval itval;
itval.it_interval.tv_sec = 0;
itval.it_interval.tv_usec = 0;
itval.it_value.tv_sec = n / 1000000;
itval.it_value.tv_usec = n % 1000000;
setitimer(ITIMER_REAL, &itval, NULL);
}
/*
* sleep in microsecond
*/
sleep_ms(n)
int n;
{
void break_sleep();
signal(SIGALRM, break_sleep);
alarm_ms(n);
pause();
signal(SIGALRM, SIG_DFL);
}
void
break_sleep()
{
}
#else
sleep_ms(n)
int n;
{
usleep(n*1000);
}
#endif
showmode(s)
int s;
{
lastmodestr = curmodestr;
showmessage(modeString[s]);
curmodestr = modeString[s];
}
showcurmode()
{
showmessage(curmodestr);
}
showlastmode()
{
showmessage(lastmodestr);
curmodestr = lastmodestr;
}
showmessage(s)
char *s;
{
if (msgLine()) {
toMsg();
writes(s);
clearToEnd();
fromMsg();
}
}
kanjiInputEffect(on)
int on;
{
underline(on);
}
kanjiSelectionEffect(on)
int on;
{
standout(on);
}
|