summaryrefslogtreecommitdiff
path: root/src/w32inevt.c
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2004-02-27 23:48:59 +0000
committerKim F. Storm <storm@cua.dk>2004-02-27 23:48:59 +0000
commit9cd31aafd44dd4039c58d144a02fbd31f3c7e07f (patch)
tree5f4aa8e24307e6c98ed21278112d2a0ce1e7b29d /src/w32inevt.c
parent9c46d57b205887f8e43a56ee29315e3455f0bd87 (diff)
downloademacs-9cd31aafd44dd4039c58d144a02fbd31f3c7e07f.tar.gz
(w32_console_read_socket): Remove bufp_r and
numcharsp args. Add hold_quit arg. Rework to use just one, local, inev input_event. Store inev directly in fifo using kbd_buffer_store_event_hold.
Diffstat (limited to 'src/w32inevt.c')
-rw-r--r--src/w32inevt.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/w32inevt.c b/src/w32inevt.c
index b3f8e3ff737..168a0fb87b3 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -642,8 +642,7 @@ maybe_generate_resize_event ()
}
int
-w32_console_read_socket (int sd, struct input_event *bufp, int numchars,
- int expected)
+w32_console_read_socket (int sd, int expected, struct input_event *hold_quit)
{
BOOL no_events = TRUE;
int nev, ret = 0, add;
@@ -670,27 +669,31 @@ w32_console_read_socket (int sd, struct input_event *bufp, int numchars,
return nev;
}
- while (nev > 0 && numchars > 0)
+ while (nev > 0)
{
+ struct input_event inev;
+
+ EVENT_INIT (inev);
+ inev.kind = NO_EVENT;
+ inev.arg = Qnil;
+
switch (queue_ptr->EventType)
{
case KEY_EVENT:
- add = key_event (&queue_ptr->Event.KeyEvent, bufp, &isdead);
+ add = key_event (&queue_ptr->Event.KeyEvent, &inev, &isdead);
if (add == -1) /* 95.7.25 by himi */
{
queue_ptr--;
add = 1;
}
- bufp += add;
- ret += add;
- numchars -= add;
+ if (add)
+ kbd_buffer_store_event_hold (&inev, hold_quit);
break;
case MOUSE_EVENT:
- add = do_mouse_event (&queue_ptr->Event.MouseEvent, bufp);
- bufp += add;
- ret += add;
- numchars -= add;
+ add = do_mouse_event (&queue_ptr->Event.MouseEvent, &inev);
+ if (add)
+ kbd_buffer_store_event_hold (&inev, hold_quit);
break;
case WINDOW_BUFFER_SIZE_EVENT: