Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!mit-eddie!uw-beaver!tektronix!sequent!mntgfx!gssc!geoffs From: geoffs@gssc.UUCP Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: Help with ^C in MS-DOS Message-ID: <357@gssc.UUCP> Date: Thu, 26-Mar-87 16:08:39 EST Article-I.D.: gssc.357 Posted: Thu Mar 26 16:08:39 1987 Date-Received: Sat, 28-Mar-87 08:27:50 EST References: <234@cup.portal.com> Reply-To: geoffs@gssc.UUCP (Geoff Shapiro) Distribution: world Organization: Graphic Software Systems, Beaverton Or Lines: 36 Xref: utgpu comp.lang.c:1347 comp.sys.ibm.pc:2576 In article <234@cup.portal.com> RichardKitts@cup.portal.com writes: > > I am trying to prevent a ^C break in MS-DOS using MSC 4.0. >If anyone could mail me some generic routines, pointers, or reference >sources I would be grateful. > Thanx in advance. > > > sun!cup.portal.com!RichardKitts The MSC 4.0 library contains a function named 'signal' which allows you to trap ^C breaks at the keyboard. Its use is straightforward and looks something like this: signal(SIGINT,KeyBreak); /* SIGINT means trap Int23h */ /* KeyBreak is a function -> to a user-defined routine to handle the ^C break */ KeyBreak looks like this: int KeyBreak() { /* body of code implementing what you would like to do in the ^C handler */ signal(SIGINT,KeyBreak); /* ensure ^C break next time also */ } Hope this helps you. Be sure to look in the MSC reference manual for more complete descriptions. Geoffs (Geoffrey Shapiro)