Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!uwvax!oddjob!gargoyle!ihnp4!inuxc!iuvax!pur-ee!uiucdcs!uiucdcsb!kkim From: kkim@uiucdcsb.cs.uiuc.edu Newsgroups: comp.sys.mac Subject: Re: article about jGNEFilter in Mac Message-ID: <164500046@uiucdcsb> Date: Wed, 19-Aug-87 16:58:00 EDT Article-I.D.: uiucdcsb.164500046 Posted: Wed Aug 19 16:58:00 1987 Date-Received: Sat, 22-Aug-87 10:58:33 EDT References: <1172@csib.UUCP> Lines: 67 Nf-ID: #R:csib.UUCP:1172:uiucdcsb:164500046:000:2225 Nf-From: uiucdcsb.cs.uiuc.edu!kkim Aug 19 15:58:00 1987 i tried to e-mail him the following only to fail. could you (jwhitnel) please post/send your e-mail address? my system could not recognize 'csib'. 0. thanks for your helpful comments. 1. what c compiler are you using here? (lightspeec, mpw, aztec, etc). also, are "pascal Boolean myGetNextEvent" and "CallPascalW" available in some specific C compiler only OR are they available in most C compilers in general? 2. you did not use any assembly language. do you think that you can patch a trap without any assembly language? somebody said that we need it a little in general to patch a trap? 3. you did not mention how to put the patch on the application heap. could you pleae explain it a little more? it seems that we need to create a CODE resource, isn't it? 4. some procedure/variable names used are defined externally: myGetNextEvent in the initialization code, and oldGetNextEvent in the patch itself. i want to know how to make externally defined procedure names available in a procedure/function. 5. i can understand where initialization/termination codes should be placed within a Desk Acc. However, i cannot imagine how / where to put the patch itself ? OpenRoutine of Desk Acc: /* initlization code */ > oldGetNextEvent = NGetTrapAddr( GNE_TRAP ); > NSetTrapAddr( myGetNextEvent ); > CloseRoutine of Desk Acc: /* termination code. */ > SetTrapAddr( GNE_TRAP, oldGetNextEvent ); ???????? how / where to put the following code?????? > /* This is the patch itself, parameters must match GetNextEvent */ > pascal Boolean myGetNextEvent( event, mask ) > EventRecord *event; > int mask; { > Boolean retCode; > > /* First call real GetNextEvent to get the event. CallPascalW calls > ** indirectly a pascal function from C. Your glue may differ here > */ > retCode = CallPascalW( event, mask, oldGetNextEvent ); > if ( retCode ) > { > /* We have an event, so preprocess it */ > } > > return( retCode ); > } > > Jerry Whitnell > Communication Solutions, Inc. Kyongsok KIM Dept. of Computer Science; Univ. of Illinois at Urbana-Champaign arpanet/csnet: kkim@b.cs.uiuc.edu usenet/uucp : {seismo, pur-ee, ihnp4}!uiucdcs!kkim