Mercurial > hg > xemacs-beta
comparison src/signal.c @ 611:38db05db9cb5
[xemacs-hg @ 2001-06-08 12:21:09 by ben]
------ gc-in-window-procedure fixes ------
alloc.c: Create "post-gc actions", to avoid those dreaded "GC during window
procedure" problems.
event-msw.c: Abort, clean and simple, when GC in window procedure. We want
to flush these puppies out.
glyphs-msw.c: Use a post-gc action when destroying subwindows.
lisp.h: Declare register_post_gc_action().
scrollbar-msw.c: Use a post-gc action when unshowing scrollbar windows, if in gc.
redisplay.c: Add comment about the utter evilness of what's going down here.
------ cygwin setitimer fixes ------
Makefile.in.in: Compile profile.c only when HAVE_SETITIMER.
nt.c: Style fixes.
nt.c: Move setitimer() emulation to win32.c, because Cygwin needs it too.
profile.c: Make sure we don't compile if no setitimer(). Use qxe_setitimer()
instead of just plain setitimer().
signal.c: Define qxe_setitimer() as an encapsulation around setitimer() --
call setitimer() directly unless Cygwin or MS Win, in which case
we use our simulated version in win32.c.
systime.h: Prototype mswindows_setitimer() and qxe_setitimer(). Long
comment about "qxe" and the policy regarding encapsulation.
win32.c: Move setitimer() emulation here, so Cygwin can use it.
Rename a couple of functions and variables to be longer and more
descriptive. In setitimer_helper_proc(), send the signal
using either mswindows_raise() or (on Cygwin) kill(). If for
some reason we are still getting lockups, we'll change the kill()
to directly invoke the signal handlers.
------ windows shell fixes ------
callproc.c, ntproc.c: Comments about how these two files must die.
callproc.c: On MS Windows, init shell-file-name from SHELL, then COMSPEC,
not just COMSPEC. (more correct and closer to FSF.) Don't
force a value for SHELL into the environment. (Comments added
to explain why not.)
nt.c: Don't shove a fabricated SHELL into the environment. See above.
------ misc fixes ------
glyphs-shared.c: Style correction.
xemacs-faq.texi: Merge in the rest of Hrvoje's Windows FAQ. Redo section 7
to update current reality and add condensed versions of
new changes for 21.1 and 21.4. (Not quite done for 21.4.)
Lots more Windows updates.
process.el: Need to quote a null
argument, too. From Dan Holmsand.
startup.el:
startup.el: Call MS Windows init function.
win32-native.el: Correct comments at top. Correctly handle passing arguments
to Cygwin programs and to bash. Fix quoting of zero-length
arguments (from Dan Holmsand). Set shell-command-switch based
on shell-file-name, which in turn comes from env var SHELL.
author | ben |
---|---|
date | Fri, 08 Jun 2001 12:21:27 +0000 |
parents | 5fd7ba8b56e7 |
children | 023b83f4e54b |
comparison
equal
deleted
inserted
replaced
610:45ba69404a1f | 611:38db05db9cb5 |
---|---|
26 | 26 |
27 #include "console.h" | 27 #include "console.h" |
28 #include "events.h" /* for signal_fake_event() */ | 28 #include "events.h" /* for signal_fake_event() */ |
29 #include "frame.h" | 29 #include "frame.h" |
30 #include "process.h" | 30 #include "process.h" |
31 | |
31 #include "sysdep.h" | 32 #include "sysdep.h" |
33 #include "sysfile.h" | |
32 #include "syssignal.h" | 34 #include "syssignal.h" |
33 #include "systime.h" | 35 #include "systime.h" |
34 | |
35 #include "sysfile.h" | |
36 | 36 |
37 /* Set to 1 when a quit-check signal (either a SIGIO interrupt or | 37 /* Set to 1 when a quit-check signal (either a SIGIO interrupt or |
38 the asynch. timeout for poll-for-quit) occurs. The QUITP | 38 the asynch. timeout for poll-for-quit) occurs. The QUITP |
39 macro may look at this. */ | 39 macro may look at this. */ |
40 volatile int quit_check_signal_happened; | 40 volatile int quit_check_signal_happened; |
107 { | 107 { |
108 #ifdef HAVE_SETITIMER | 108 #ifdef HAVE_SETITIMER |
109 struct itimerval it; | 109 struct itimerval it; |
110 it.it_value = interval; | 110 it.it_value = interval; |
111 EMACS_SET_SECS_USECS (it.it_interval, 0, 0); | 111 EMACS_SET_SECS_USECS (it.it_interval, 0, 0); |
112 setitimer (ITIMER_REAL, &it, 0); | 112 qxe_setitimer (ITIMER_REAL, &it, 0); |
113 #else | 113 #else |
114 int secs; | 114 int secs; |
115 EMACS_TIME_TO_INT (interval, secs); | 115 EMACS_TIME_TO_INT (interval, secs); |
116 alarm (secs); | 116 alarm (secs); |
117 #endif | 117 #endif |
261 ability to C-g out of library functions this way (unless we forcibly | 261 ability to C-g out of library functions this way (unless we forcibly |
262 longjmp() out of a signal handler, which is likely to lead to a | 262 longjmp() out of a signal handler, which is likely to lead to a |
263 crash). --ben */ | 263 crash). --ben */ |
264 | 264 |
265 #ifdef HAVE_SETITIMER | 265 #ifdef HAVE_SETITIMER |
266 | |
266 unsigned int | 267 unsigned int |
267 alarm (unsigned int howlong) | 268 alarm (unsigned int howlong) |
268 { | 269 { |
269 struct itimerval old_it, new_it; | 270 struct itimerval old_it, new_it; |
270 | 271 |
272 | 273 |
273 new_it.it_value.tv_sec = howlong; | 274 new_it.it_value.tv_sec = howlong; |
274 new_it.it_value.tv_usec = 0; | 275 new_it.it_value.tv_usec = 0; |
275 new_it.it_interval.tv_sec = 0; | 276 new_it.it_interval.tv_sec = 0; |
276 new_it.it_interval.tv_usec = 0; | 277 new_it.it_interval.tv_usec = 0; |
277 setitimer (ITIMER_REAL, &new_it, &old_it); | 278 qxe_setitimer (ITIMER_REAL, &new_it, &old_it); |
278 | 279 |
279 /* Never return zero if there was a timer outstanding. */ | 280 /* Never return zero if there was a timer outstanding. */ |
280 return old_it.it_value.tv_sec + (old_it.it_value.tv_usec > 0 ? 1 : 0); | 281 return old_it.it_value.tv_sec + (old_it.it_value.tv_usec > 0 ? 1 : 0); |
281 } | 282 } |
282 #endif | 283 |
284 int | |
285 qxe_setitimer (int kind, const struct itimerval *itnew, | |
286 struct itimerval *itold) | |
287 { | |
288 #if defined (WIN32_NATIVE) || defined (CYGWIN) | |
289 /* setitimer() does not exist on native MS Windows, and appears broken | |
290 on Cygwin. See win32.c. */ | |
291 return mswindows_setitimer (kind, itnew, itold); | |
292 #else | |
293 return setitimer (kind, itnew, itold); | |
294 #endif | |
295 } | |
296 | |
297 #endif /* HAVE_SETITIMER */ | |
298 | |
283 | 299 |
284 DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, 0, 0, 0, /* | 300 DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, 0, 0, 0, /* |
285 Return non-nil if XEmacs is waiting for input from the user. | 301 Return non-nil if XEmacs is waiting for input from the user. |
286 This is intended for use by asynchronous timeout callbacks and by | 302 This is intended for use by asynchronous timeout callbacks and by |
287 asynchronous process output filters and sentinels (not yet implemented | 303 asynchronous process output filters and sentinels (not yet implemented |