comparison src/event-tty.c @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 2f8bb876ab1d
children 11054d720c21
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
62 { 62 {
63 remove_low_level_timeout (&tty_timer_queue, id); 63 remove_low_level_timeout (&tty_timer_queue, id);
64 } 64 }
65 65
66 static void 66 static void
67 tty_timeout_to_emacs_event (Lisp_Event *emacs_event) 67 tty_timeout_to_emacs_event (struct Lisp_Event *emacs_event)
68 { 68 {
69 emacs_event->event_type = timeout_event; 69 emacs_event->event_type = timeout_event;
70 /* timeout events have nil as channel */ 70 /* timeout events have nil as channel */
71 emacs_event->timestamp = 0; /* #### */ 71 emacs_event->timestamp = 0; /* #### */
72 emacs_event->event.timeout.interval_id = 72 emacs_event->event.timeout.interval_id =
110 110
111 return 0; 111 return 0;
112 } 112 }
113 113
114 static void 114 static void
115 emacs_tty_next_event (Lisp_Event *emacs_event) 115 emacs_tty_next_event (struct Lisp_Event *emacs_event)
116 { 116 {
117 while (1) 117 while (1)
118 { 118 {
119 int ndesc; 119 int ndesc;
120 int i; 120 int i;
154 for (i = 0; i < MAXDESC; i++) 154 for (i = 0; i < MAXDESC; i++)
155 { 155 {
156 if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &process_only_mask)) 156 if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &process_only_mask))
157 { 157 {
158 Lisp_Object process; 158 Lisp_Object process;
159 Lisp_Process *p = get_process_from_usid (FD_TO_USID(i)); 159 struct Lisp_Process *p =
160 get_process_from_usid (FD_TO_USID(i));
160 161
161 assert (p); 162 assert (p);
162 XSETPROCESS (process, p); 163 XSETPROCESS (process, p);
163 emacs_event->event_type = process_event; 164 emacs_event->event_type = process_event;
164 /* process events have nil as channel */ 165 /* process events have nil as channel */
185 } 186 }
186 } 187 }
187 } 188 }
188 189
189 static void 190 static void
190 emacs_tty_handle_magic_event (Lisp_Event *emacs_event) 191 emacs_tty_handle_magic_event (struct Lisp_Event *emacs_event)
191 { 192 {
192 /* Nothing to do currently */ 193 /* Nothing to do currently */
193 } 194 }
194 195
195 196
196 static void 197 static void
197 emacs_tty_select_process (Lisp_Process *process) 198 emacs_tty_select_process (struct Lisp_Process *process)
198 { 199 {
199 event_stream_unixoid_select_process (process); 200 event_stream_unixoid_select_process (process);
200 } 201 }
201 202
202 static void 203 static void
203 emacs_tty_unselect_process (Lisp_Process *process) 204 emacs_tty_unselect_process (struct Lisp_Process *process)
204 { 205 {
205 event_stream_unixoid_unselect_process (process); 206 event_stream_unixoid_unselect_process (process);
206 } 207 }
207 208
208 static void 209 static void
242 /************************************************************************/ 243 /************************************************************************/
243 /* initialization */ 244 /* initialization */
244 /************************************************************************/ 245 /************************************************************************/
245 246
246 void 247 void
247 reinit_vars_of_event_tty (void) 248 vars_of_event_tty (void)
248 { 249 {
249 tty_event_stream = xnew (struct event_stream); 250 tty_event_stream = xnew (struct event_stream);
250 251
251 tty_event_stream->event_pending_p = emacs_tty_event_pending_p; 252 tty_event_stream->event_pending_p = emacs_tty_event_pending_p;
252 tty_event_stream->force_event_pending = 0;
253 tty_event_stream->next_event_cb = emacs_tty_next_event; 253 tty_event_stream->next_event_cb = emacs_tty_next_event;
254 tty_event_stream->handle_magic_event_cb = emacs_tty_handle_magic_event; 254 tty_event_stream->handle_magic_event_cb = emacs_tty_handle_magic_event;
255 tty_event_stream->add_timeout_cb = emacs_tty_add_timeout; 255 tty_event_stream->add_timeout_cb = emacs_tty_add_timeout;
256 tty_event_stream->remove_timeout_cb = emacs_tty_remove_timeout; 256 tty_event_stream->remove_timeout_cb = emacs_tty_remove_timeout;
257 tty_event_stream->select_console_cb = emacs_tty_select_console; 257 tty_event_stream->select_console_cb = emacs_tty_select_console;
262 tty_event_stream->create_stream_pair_cb = emacs_tty_create_stream_pair; 262 tty_event_stream->create_stream_pair_cb = emacs_tty_create_stream_pair;
263 tty_event_stream->delete_stream_pair_cb = emacs_tty_delete_stream_pair; 263 tty_event_stream->delete_stream_pair_cb = emacs_tty_delete_stream_pair;
264 } 264 }
265 265
266 void 266 void
267 vars_of_event_tty (void)
268 {
269 reinit_vars_of_event_tty ();
270 }
271
272 void
273 init_event_tty_late (void) 267 init_event_tty_late (void)
274 { 268 {
275 event_stream = tty_event_stream; 269 event_stream = tty_event_stream;
276 } 270 }