18 static struct sgttyb param_input;
19 static long mode_raw =
FALSE;
20 static char bufbuf[BUFSIZ+1] = {0};
38 Errorline (
"in begin_raw: already in mode raw\n");
43 Errorline (
"in begin_raw: cannot get the input parameters\n");
45 bcopy ((
char*)¶m_input, (
char*)¶m,
sizeof (param));
49 param.sg_flags |= CBREAK | TANDEM | RAW;
51 param.sg_flags |= CBREAK | TANDEM;
54 param.sg_flags &= ~ECHO;
57 Errorline (
"in begin_raw: cannot set the input parameters\n");
60 Errorline (
"in begin_raw: cannot get the terminal\n");
65 argio.c_lflag &= ~(ICANON|ISIG);
67 argio.c_cc[VTIME] = 0;
70 argio.c_iflag &= ~(ISTRIP|IXON);
73 argio.c_oflag |= OPOST|ONLCR;
75 argio.c_iflag &= ~(ISTRIP);
79 Errorline (
"in begin_raw: cannot set the terminal\n");
81 (void)setvbuf (stdin, bufbuf, _IOFBF, BUFSIZ);
83 bzero (bufbuf, BUFSIZ+1);
104 fd_set readfd, writefd, exceptfd;
105 struct timeval timeout;
116 if ((
int)strlen (bufbuf) == 0)
118 level = (
unsigned long)
aim->c;
128 timeout.tv_usec = 100000;
130 nfds = select (32, &readfd, &writefd, &exceptfd, &timeout);
135 Errorline (
"it is not possible to read characters or X events\n");
160 if ((c = fgetc (stdin)) != 0)
168 Errorline (
"in select: unknown descriptor\n");
170 }
while (!(char_flag || event_flag));
180 bcopy (&bufbuf[1], bufbuf, BUFSIZ-1);
207 (void)putchar ((
char) val[0]);
208 (void)fflush (stdout);
226 Errorline (
"in c_end_raw: not in mode raw\n");
231 Errorline (
"in end_raw: cannot reset mode raw\n");
233 (void)setvbuf (stdin, bufbuf, _IONBF, BUFSIZ);
234 bzero (bufbuf, BUFSIZ);
long x_exist_event()
x_exist_event
void new_built_in(ptr_module m, char *s, def_type t, long(*r)())
new_built_in
#define function_it
was enum (def_type) in extern.h now there is typedef ptr_definition
void interrupt()
INTERRUPT()
void exit_life(long nl_flag)
exit_life
void unify_bool_result(ptr_psi_term t, long v)
unify_bool_result
#define REAL
Which C type to use to represent reals and integers in Wild_Life.
ptr_definition boolean
symbol in bi module
#define begin_builtin(FUNCNAME, NBARGS, NBARGSIN, TYPES)
void release_resid(ptr_psi_term t)
release_resid
ptr_definition real
symbol in bi module
long c_reset_window_flag()
void Errorline(char *format,...)
Errorline.
void raw_setup_builtins()
raw_setup_builtins
#define TRUE
Standard boolean.
#define FALSE
Standard boolean.
ptr_module bi_module
Module for public built-ins.
long unify_real_result(ptr_psi_term t, REAL v)
unify_real_result
ptr_psi_term xevent_existing
#define include_var_builtin(NBARGS)