Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!intercon!amanda@intercon.com From: amanda@intercon.com (Amanda Walker) Newsgroups: comp.sys.mac.programmer Subject: Re: Segmentation (was Re: ARRGH (Strings and things)) Message-ID: <1529@intercon.com> Date: 3 Nov 89 15:43:03 GMT References: <16004@netnews.upenn.edu> <8835@hoptoad.uucp> <16420@dartvax.Dartmouth.EDU> <8852@hoptoad.uucp> <14386@well.UUCP> <8878@hoptoad.uucp> <1989Nov2.053139.23967@agate.berkeley.edu> <32323@ucbvax.BERKELEY.EDU> Sender: news@intercon.com Reply-To: amanda@intercon.com (Amanda Walker) Organization: InterCon Systems Corporation Lines: 19 In article <32323@ucbvax.BERKELEY.EDU>, oster@dewey.soe.berkeley.edu (David Phillip Oster) writes: > CanLoadSeg(procedureName) which > returns NIL or a handle to the segment. It always bothers me when I see a > function with an obvious inverse that is not implemented. (Yes, I know I > could write it, but would it work in System 7?) Hmm. Actually, if your development system implements function pointers as jump table entries (which I believe MPW does, unless you tell it otherwise), this shouldn't be too hard. You can look at the contents of the function pointer (its entry in the jump table), and get either the actual address if it's loaded or the segment # if not... This assumes the jump table format won't change, but as long as System 7 runs current binaries, life should be pretty mellow (this should even work under A/UX, come to think of it...). -- Amanda Walker