signal.c (009e81b16465ea457c0e63fd49fe77f47cc27a5a) | signal.c (1ea316270f1f75922ac53976d5d8808a41442f46) |
---|---|
1/* 2 * Copyright (C) 1984-2015 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, see the README file. 8 */ --- 28 unchanged lines hidden (view full) --- 37extern int less_is_more; 38extern long jump_sline_fraction; 39 40/* 41 * Interrupt signal handler. 42 */ 43 /* ARGSUSED*/ 44 static RETSIGTYPE | 1/* 2 * Copyright (C) 1984-2015 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, see the README file. 8 */ --- 28 unchanged lines hidden (view full) --- 37extern int less_is_more; 38extern long jump_sline_fraction; 39 40/* 41 * Interrupt signal handler. 42 */ 43 /* ARGSUSED*/ 44 static RETSIGTYPE |
45u_interrupt(type) 46 int type; | 45u_interrupt(int type) |
47{ 48 bell(); 49#if OS2 50 LSIGNAL(SIGINT, SIG_ACK); 51#endif 52 LSIGNAL(SIGINT, u_interrupt); 53 sigs |= S_INTERRUPT; 54#if MSDOS_COMPILER==DJGPPC --- 12 unchanged lines hidden (view full) --- 67} 68 69#ifdef SIGTSTP 70/* 71 * "Stop" (^Z) signal handler. 72 */ 73 /* ARGSUSED*/ 74 static RETSIGTYPE | 46{ 47 bell(); 48#if OS2 49 LSIGNAL(SIGINT, SIG_ACK); 50#endif 51 LSIGNAL(SIGINT, u_interrupt); 52 sigs |= S_INTERRUPT; 53#if MSDOS_COMPILER==DJGPPC --- 12 unchanged lines hidden (view full) --- 66} 67 68#ifdef SIGTSTP 69/* 70 * "Stop" (^Z) signal handler. 71 */ 72 /* ARGSUSED*/ 73 static RETSIGTYPE |
75stop(type) 76 int type; | 74stop(int type) |
77{ 78 LSIGNAL(SIGTSTP, stop); 79 sigs |= S_STOP; 80 if (reading) 81 intread(); 82} 83#endif 84 85#ifdef SIGWINCH 86/* 87 * "Window" change handler 88 */ 89 /* ARGSUSED*/ 90 public RETSIGTYPE | 75{ 76 LSIGNAL(SIGTSTP, stop); 77 sigs |= S_STOP; 78 if (reading) 79 intread(); 80} 81#endif 82 83#ifdef SIGWINCH 84/* 85 * "Window" change handler 86 */ 87 /* ARGSUSED*/ 88 public RETSIGTYPE |
91winch(type) 92 int type; | 89winch(int type) |
93{ 94 LSIGNAL(SIGWINCH, winch); 95 sigs |= S_WINCH; 96 if (reading) 97 intread(); 98} 99#else 100#ifdef SIGWIND 101/* 102 * "Window" change handler 103 */ 104 /* ARGSUSED*/ 105 public RETSIGTYPE | 90{ 91 LSIGNAL(SIGWINCH, winch); 92 sigs |= S_WINCH; 93 if (reading) 94 intread(); 95} 96#else 97#ifdef SIGWIND 98/* 99 * "Window" change handler 100 */ 101 /* ARGSUSED*/ 102 public RETSIGTYPE |
106winch(type) 107 int type; | 103winch(int type) |
108{ 109 LSIGNAL(SIGWIND, winch); 110 sigs |= S_WINCH; 111 if (reading) 112 intread(); 113} 114#endif 115#endif 116 117#if MSDOS_COMPILER==WIN32C 118/* 119 * Handle CTRL-C and CTRL-BREAK keys. 120 */ 121#include "windows.h" 122 123 static BOOL WINAPI | 104{ 105 LSIGNAL(SIGWIND, winch); 106 sigs |= S_WINCH; 107 if (reading) 108 intread(); 109} 110#endif 111#endif 112 113#if MSDOS_COMPILER==WIN32C 114/* 115 * Handle CTRL-C and CTRL-BREAK keys. 116 */ 117#include "windows.h" 118 119 static BOOL WINAPI |
124wbreak_handler(dwCtrlType) 125 DWORD dwCtrlType; | 120wbreak_handler(DWORD dwCtrlType) |
126{ 127 switch (dwCtrlType) 128 { 129 case CTRL_C_EVENT: 130 case CTRL_BREAK_EVENT: 131 sigs |= S_INTERRUPT; 132 return (TRUE); 133 default: 134 break; 135 } 136 return (FALSE); 137} 138#endif 139 140/* 141 * Set up the signal handlers. 142 */ 143 public void | 121{ 122 switch (dwCtrlType) 123 { 124 case CTRL_C_EVENT: 125 case CTRL_BREAK_EVENT: 126 sigs |= S_INTERRUPT; 127 return (TRUE); 128 default: 129 break; 130 } 131 return (FALSE); 132} 133#endif 134 135/* 136 * Set up the signal handlers. 137 */ 138 public void |
144init_signals(on) 145 int on; | 139init_signals(int on) |
146{ 147 if (on) 148 { 149 /* 150 * Set signal handlers. 151 */ 152 (void) LSIGNAL(SIGINT, u_interrupt); 153#if MSDOS_COMPILER==WIN32C --- 35 unchanged lines hidden (view full) --- 189 } 190} 191 192/* 193 * Process any signals we have received. 194 * A received signal cause a bit to be set in "sigs". 195 */ 196 public void | 140{ 141 if (on) 142 { 143 /* 144 * Set signal handlers. 145 */ 146 (void) LSIGNAL(SIGINT, u_interrupt); 147#if MSDOS_COMPILER==WIN32C --- 35 unchanged lines hidden (view full) --- 183 } 184} 185 186/* 187 * Process any signals we have received. 188 * A received signal cause a bit to be set in "sigs". 189 */ 190 public void |
197psignals() | 191psignals(void) |
198{ | 192{ |
199 register int tsignals; | 193 int tsignals; |
200 201 if ((tsignals = sigs) == 0) 202 return; 203 sigs = 0; 204 205#ifdef SIGTSTP 206 if (tsignals & S_STOP) 207 { --- 53 unchanged lines hidden --- | 194 195 if ((tsignals = sigs) == 0) 196 return; 197 sigs = 0; 198 199#ifdef SIGTSTP 200 if (tsignals & S_STOP) 201 { --- 53 unchanged lines hidden --- |