signal.c (1ede1615747861739301dfdbb525338ceacb5183) signal.c (6dcb072b3021f88118ab758d851d01be270f36b2)
1/*
1/*
2 * Copyright (C) 1984-2002 Mark Nudelman
2 * Copyright (C) 1984-2004 Mark Nudelman
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Less License, as specified in the README file.
6 *
7 * For more information about less, or for information on how to
8 * contact the author, see the README file.
9 */
10
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Less License, as specified in the README file.
6 *
7 * For more information about less, or for information on how to
8 * contact the author, see the README file.
9 */
10
11/* $FreeBSD$ */
12
13/*
14 * Routines dealing with signals.
15 *
16 * A signal usually merely causes a bit to be set in the "signals" word.
17 * At some convenient time, the mainline code checks to see if any
18 * signals need processing by calling psignal().
19 * If we happen to be reading from a file [in iread()] at the time

--- 9 unchanged lines hidden (view full) ---

29public int sigs;
30
31extern int sc_width, sc_height;
32extern int screen_trashed;
33extern int lnloop;
34extern int linenums;
35extern int wscroll;
36extern int reading;
11
12/*
13 * Routines dealing with signals.
14 *
15 * A signal usually merely causes a bit to be set in the "signals" word.
16 * At some convenient time, the mainline code checks to see if any
17 * signals need processing by calling psignal().
18 * If we happen to be reading from a file [in iread()] at the time

--- 9 unchanged lines hidden (view full) ---

28public int sigs;
29
30extern int sc_width, sc_height;
31extern int screen_trashed;
32extern int lnloop;
33extern int linenums;
34extern int wscroll;
35extern int reading;
37extern int more_mode;
36extern int quit_on_intr;
38
39/*
40 * Interrupt signal handler.
41 */
42 /* ARGSUSED*/
43 static RETSIGTYPE
44u_interrupt(type)
45 int type;

--- 7 unchanged lines hidden (view full) ---

53 /*
54 * If a keyboard has been hit, it must be Ctrl-C
55 * (as opposed to Ctrl-Break), so consume it.
56 * (Otherwise, Less will beep when it sees Ctrl-C from keyboard.)
57 */
58 if (kbhit())
59 getkey();
60#endif
37
38/*
39 * Interrupt signal handler.
40 */
41 /* ARGSUSED*/
42 static RETSIGTYPE
43u_interrupt(type)
44 int type;

--- 7 unchanged lines hidden (view full) ---

52 /*
53 * If a keyboard has been hit, it must be Ctrl-C
54 * (as opposed to Ctrl-Break), so consume it.
55 * (Otherwise, Less will beep when it sees Ctrl-C from keyboard.)
56 */
57 if (kbhit())
58 getkey();
59#endif
61 if (more_mode)
62 quit(0);
63 if (reading)
64 intread();
65}
66
67#ifdef SIGTSTP
68/*
69 * "Stop" (^Z) signal handler.
70 */

--- 175 unchanged lines hidden (view full) ---

246 {
247 wscroll = (sc_height + 1) / 2;
248 screen_trashed = 1;
249 }
250 }
251#endif
252 if (tsignals & S_INTERRUPT)
253 {
60 if (reading)
61 intread();
62}
63
64#ifdef SIGTSTP
65/*
66 * "Stop" (^Z) signal handler.
67 */

--- 175 unchanged lines hidden (view full) ---

243 {
244 wscroll = (sc_height + 1) / 2;
245 screen_trashed = 1;
246 }
247 }
248#endif
249 if (tsignals & S_INTERRUPT)
250 {
251 if (quit_on_intr)
252 quit(QUIT_OK);
254 bell();
255 /*
256 * {{ You may wish to replace the bell() with
257 * error("Interrupt", NULL_PARG); }}
258 */
259
260 /*
261 * If we were interrupted while in the "calculating

--- 13 unchanged lines hidden ---
253 bell();
254 /*
255 * {{ You may wish to replace the bell() with
256 * error("Interrupt", NULL_PARG); }}
257 */
258
259 /*
260 * If we were interrupted while in the "calculating

--- 13 unchanged lines hidden ---