comparison src/event-tty.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 1f50e6fe4f3f
children 2f8bb876ab1d
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
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 (struct Lisp_Event *emacs_event) 67 tty_timeout_to_emacs_event (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 (struct Lisp_Event *emacs_event) 115 emacs_tty_next_event (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 struct Lisp_Process *p = 159 Lisp_Process *p = get_process_from_usid (FD_TO_USID(i));
160 get_process_from_usid (FD_TO_USID(i));
161 160
162 assert (p); 161 assert (p);
163 XSETPROCESS (process, p); 162 XSETPROCESS (process, p);
164 emacs_event->event_type = process_event; 163 emacs_event->event_type = process_event;
165 /* process events have nil as channel */ 164 /* process events have nil as channel */
186 } 185 }
187 } 186 }
188 } 187 }
189 188
190 static void 189 static void
191 emacs_tty_handle_magic_event (struct Lisp_Event *emacs_event) 190 emacs_tty_handle_magic_event (Lisp_Event *emacs_event)
192 { 191 {
193 /* Nothing to do currently */ 192 /* Nothing to do currently */
194 } 193 }
195 194
196 195
197 static void 196 static void
198 emacs_tty_select_process (struct Lisp_Process *process) 197 emacs_tty_select_process (Lisp_Process *process)
199 { 198 {
200 event_stream_unixoid_select_process (process); 199 event_stream_unixoid_select_process (process);
201 } 200 }
202 201
203 static void 202 static void
204 emacs_tty_unselect_process (struct Lisp_Process *process) 203 emacs_tty_unselect_process (Lisp_Process *process)
205 { 204 {
206 event_stream_unixoid_unselect_process (process); 205 event_stream_unixoid_unselect_process (process);
207 } 206 }
208 207
209 static void 208 static void
243 /************************************************************************/ 242 /************************************************************************/
244 /* initialization */ 243 /* initialization */
245 /************************************************************************/ 244 /************************************************************************/
246 245
247 void 246 void
248 vars_of_event_tty (void) 247 reinit_vars_of_event_tty (void)
249 { 248 {
250 tty_event_stream = xnew (struct event_stream); 249 tty_event_stream = xnew (struct event_stream);
251 250
252 tty_event_stream->event_pending_p = emacs_tty_event_pending_p; 251 tty_event_stream->event_pending_p = emacs_tty_event_pending_p;
253 tty_event_stream->next_event_cb = emacs_tty_next_event; 252 tty_event_stream->next_event_cb = emacs_tty_next_event;
262 tty_event_stream->create_stream_pair_cb = emacs_tty_create_stream_pair; 261 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; 262 tty_event_stream->delete_stream_pair_cb = emacs_tty_delete_stream_pair;
264 } 263 }
265 264
266 void 265 void
266 vars_of_event_tty (void)
267 {
268 reinit_vars_of_event_tty ();
269 }
270
271 void
267 init_event_tty_late (void) 272 init_event_tty_late (void)
268 { 273 {
269 event_stream = tty_event_stream; 274 event_stream = tty_event_stream;
270 } 275 }