Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!zaphod.mps.ohio-state.edu!wuarchive!waikato.ac.nz!comp.vuw.ac.nz!actrix!templar!jbickers From: jbickers@templar.actrix.gen.nz (John Bickers) Newsgroups: comp.sys.amiga.programmer Subject: Re: Dumb windows from SAS/C programs on Workbench Message-ID: <3816.tnews@templar.actrix.gen.nz> Date: 18 May 91 07:08:57 GMT References: <1991May14.164909.19186@NCoast.ORG> <3770.tnews@templar.actrix.gen.nz> <1991May17.024020.1828@NCoast.ORG> Organization: TAP, NZAmigaUG. Lines: 91 Quoted from <1991May17.024020.1828@NCoast.ORG> by davewt@NCoast.ORG (David Wright): > In article <3770.tnews@templar.actrix.gen.nz> jbickers@templar.actrix.gen.nz (John Bickers) writes: > > The ^C trapping appears to be in the prelude to various C library > > functions. Particularly the IO ones (fread, etc). The solution is not > yourself, it is not part of the C library functions (although they would also > see it), but rather part of the SAS/C "umain.c" module, which is linked into I meant that the actuall call to whatever's been put into _ONBREAK is done by the prelude to the IO functions. Either don't use the functions, or set _ONBREAK to something harmless yourself. The DEFINE __main=__tinymain should get rid of the Workbench window. If it doesn't, then sorry - it worked for me back when I was using 5.04. I haven't run any of my code from Workbench since I got 5.10. Using the DEFINE is a lot nicer, I think, then fiddling with umain. I did that too, ages ago, before I knew what __tinymain did. From another of your articles, you appear to be having difficulty reading the ^C signal. The following is the routine I use, which I derived by taking apart the Lattice one, I think. I use it in either of two ways: if (tabort(NULL)) die(); or: tabort(die); ------------------------------ 8< ------------------------------ ;************************************************************************** ;*** tabort.a (JJB TEMPLAR) *** ;*** Date begun: 3/8/89 - cut from Lattice's chkabort function. *** ;*** Last modified: 3/8/89. *** ;*** 15-May-90: allow NULL function pointer. *** ;************************************************************************** ;*** Use as follows: tabort(void (*)()); *** ;************************************************************************** CSECT text XDEF _tabort SetSignal EQU -$0132 _tabort: movem.l d7/a6,-(a7) ; use d7 and a6 moveq #$00,d0 ; no newsignals move.l #$00003000,d1 ; test signal 00003000 movea.l $0004,a6 ; ExecBase jsr SetSignal(a6) move.l d0,d7 ; move signals into d7 andi.l #$00003000,d7 ; test for signal 00003000 tst.l d7 bne.b break moveq.l #$00,d0 ; clear d0 == return(0) beq.b exit ; false break: move.l $0c(a7),d0 ; load break function beq.b skipfunc ; if no func, ignore movea.l d0,a0 jsr (a0) ; gosub it skipfunc: move.l d7,d0 exit: movem.l (a7)+,d7/a6 rts END ------------------------------ 8< ------------------------------ I've also used the following, when I've wanted to check for several signals at one time, and then process each one... ------------------------------ 8< ------------------------------ ULONG sigs; sigs = SetSignal(0L,0L); if (sigs & SIGBREAKF_CTRL_C) { mprintf("*** break.\n"); SetSignal(0L,SIGBREAKF_CTRL_C); /* clear the thing */ ... /* go away and die */ } ------------------------------ 8< ------------------------------ These work (or seem to work) under KS1.2. > Dave -- *** John Bickers, TAP, NZAmigaUG. jbickers@templar.actrix.gen.nz *** *** "Endless variations, make it all seem new" - Devo. ***