Article View: comp.sys.atari.st
Article #41818C help - Critical replacement
From: cs325ec
Date: Mon, 12 Mar 1990 10:39
Date: Mon, 12 Mar 1990 10:39
48 lines
1271 bytes
1271 bytes
I am trying to set a function name to an absolute value in
Turbo C:
Could someone just drop a note on how to call olderrh (the
old critical error handler) if I do not want to service the
call?
Thanks in advance
-- Greg
I have tried this and more:
#include <stdio.h>
#include <tos.h>
#define drivebits 0x0030
void *olderrh;
/****************************
Critical Error Handler
****************************/
long criterr(int err, int drive)
{
if (drive & drivebits)
return(1L);
else
return(eval(olderrh));
}
/****************************
Replace Error Handler
****************************/
void replerr(void)
{
olderrh = (void *)(*(long *)0x404L);
*(long *)0x404L = (long)criterr;
}
void main(void)
{
Supexec(replerr);
Ptermres(0x400L,0);
}
Technical Details
Message-ID:
<16000023@ux1.cso.uiuc.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!cs325ecShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!cs325ec From: cs325ec@ux1.cso.uiuc.edu Newsgroups: comp.sys.atari.st Subject: C help - Critical replacement Message-ID: <16000023@ux1.cso.uiuc.edu> Date: 12 Mar 90 10:39:37 GMT Lines: 48 Nf-ID: #N:ux1.cso.uiuc.edu:16000023:000:782 Nf-From: ux1.cso.uiuc.edu!cs325ec Mar 11 23:02:00 1990