Mercurial > hg > xemacs-beta
comparison src/signal.c @ 272:c5d627a313b1 r21-0b34
Import from CVS: tag r21-0b34
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:28:48 +0200 |
parents | 677f6a0ee643 |
children | ca9a9ec9c1c1 |
comparison
equal
deleted
inserted
replaced
271:c7b7086b0a39 | 272:c5d627a313b1 |
---|---|
18 along with XEmacs; see the file COPYING. If not, write to | 18 along with XEmacs; see the file COPYING. If not, write to |
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 Boston, MA 02111-1307, USA. */ | 20 Boston, MA 02111-1307, USA. */ |
21 | 21 |
22 /* Synched up with: Not synched with FSF. Split out of keyboard.c. */ | 22 /* Synched up with: Not synched with FSF. Split out of keyboard.c. */ |
23 | |
24 /* Just to make sure we don't use any global vars below */ | |
25 #define DONT_DECLARE_MAC_VARS | |
26 | 23 |
27 #include <config.h> | 24 #include <config.h> |
28 #include "lisp.h" | 25 #include "lisp.h" |
29 | 26 |
30 #include "console.h" | 27 #include "console.h" |
32 #include "frame.h" | 29 #include "frame.h" |
33 #include "sysdep.h" | 30 #include "sysdep.h" |
34 #include "syssignal.h" | 31 #include "syssignal.h" |
35 #include "systime.h" | 32 #include "systime.h" |
36 | 33 |
34 #ifdef HAVE_UNISTD_H | |
35 #include <unistd.h> | |
36 #endif | |
37 #include <errno.h> | 37 #include <errno.h> |
38 | 38 |
39 /* Set to 1 when a quit-check signal (either a SIGIO interrupt or | 39 /* Set to 1 when a quit-check signal (either a SIGIO interrupt or |
40 the asynch. timeout for poll-for-quit) occurs. The QUITP | 40 the asynch. timeout for poll-for-quit) occurs. The QUITP |
41 macro may look at this. */ | 41 macro may look at this. */ |
307 /* If asynch. timeouts are blocked, then don't do anything now, | 307 /* If asynch. timeouts are blocked, then don't do anything now, |
308 but make this function get called again next QUIT. | 308 but make this function get called again next QUIT. |
309 | 309 |
310 #### This is a bit inefficient because there will be function call | 310 #### This is a bit inefficient because there will be function call |
311 overhead each time QUIT occurs. */ | 311 overhead each time QUIT occurs. */ |
312 | 312 |
313 if (!NILP (Vinhibit_quit)) | 313 if (!NILP (Vinhibit_quit)) |
314 { | 314 { |
315 something_happened = 1; | 315 something_happened = 1; |
316 alarm_happened = 1; | 316 alarm_happened = 1; |
317 return; | 317 return; |
357 in XEmacs). It will always be nil if XEmacs is not inside of | 357 in XEmacs). It will always be nil if XEmacs is not inside of |
358 an asynchronout timeout or process callback. | 358 an asynchronout timeout or process callback. |
359 */ | 359 */ |
360 ()) | 360 ()) |
361 { | 361 { |
362 return ((waiting_for_user_input_p) ? Qt : Qnil); | 362 return waiting_for_user_input_p ? Qt : Qnil; |
363 } | 363 } |
364 | 364 |
365 | 365 |
366 /**********************************************************************/ | 366 /**********************************************************************/ |
367 /* Control-G checking */ | 367 /* Control-G checking */ |
469 dont_check_for_quit = 1; | 469 dont_check_for_quit = 1; |
470 } | 470 } |
471 | 471 |
472 /* The effect of this function is to set Vquit_flag if the user pressed | 472 /* The effect of this function is to set Vquit_flag if the user pressed |
473 ^G and discard the ^G, so as to not notice the same ^G again. */ | 473 ^G and discard the ^G, so as to not notice the same ^G again. */ |
474 int | 474 int |
475 check_quit (void) | 475 check_quit (void) |
476 { | 476 { |
477 /* dont_check_for_quit is set in two circumstances: | 477 /* dont_check_for_quit is set in two circumstances: |
478 | 478 |
479 (1) when we are in the process of changing the window | 479 (1) when we are in the process of changing the window |
518 handle_alarm_going_off (); | 518 handle_alarm_going_off (); |
519 } | 519 } |
520 return check_quit (); | 520 return check_quit (); |
521 } | 521 } |
522 | 522 |
523 | 523 |
524 | 524 |
525 void | 525 void |
526 init_poll_for_quit (void) | 526 init_poll_for_quit (void) |
527 { | 527 { |
528 #if !defined (SIGIO) && !defined (DONT_POLL_FOR_QUIT) | 528 #if !defined (SIGIO) && !defined (DONT_POLL_FOR_QUIT) |