home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sun-barr!apple!apple!keith@taligent.com
- From: keith@taligent.com (Keith Rollin)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Gestalt glue is redundant!
- Message-ID: <70287@apple.Apple.COM>
- Date: 21 Jul 92 17:40:05 GMT
- References: <28086@goofy.Apple.COM> <1992Jul11.063540.11834@usenet.ins.cwru.edu> <5cWy03MV36Pd00@amdahl.uts.amdahl.com> <BrEo5w.Bt4@world.std.com> <c6n403hY3dcZ00@amdahl.uts.amdahl.com>
- Sender: daemon@Apple.COM
- Organization: Taligent
- Lines: 45
-
- In article <c6n403hY3dcZ00@amdahl.uts.amdahl.com>, jsp@uts.amdahl.com (James
- Preston) writes:
- >
- > I disagree when you say that it is not the responsibility of the THINK C
- > documentation to talk about something like the Gestalt glue code. In the
- > first place (and I'm sure I don't need to remind Rich of this), THINK C
- > is not just a C compiler, it is a Macintosh development environment.
- > Therefore, its documentation certainly should talk about the interface
- > between the application program and the Mac toolbox. More importantly,
- > in this particular case, calling the glue code is something that the compiler
- > does _behind the programmer's back._ It doesn't matter where that glue
- > code comes from, be it Apple or anywhere else; the point is that the code
- > generator does not see my call to Gestalt and emit a call to directly to
- > Gestalt. It emits code to call the glue code. I agree that it is a good
- > thing to do, but certainly any such behind the back calling must be
- > documented by the product that does so, which in this case is THINK C.
-
- I must agree with Paul in disagreeing with you here. First of all, this is
- nothing new, and you never complained until now. There are many, many routines
- that are glue routines that appear no differently that direct trap calls. Take a
- look at Inside Mac. Any routine marked as Not In ROM is a glue routine.
- Additionally, until MPW 3.1, almost every OS routine was also a glue routine in
- order to convert from a register based convention into a stack based based
- calling convention. (This has been now changed with the use of inline code and
- #pragma parameter). Finally, there are several calls provided as glue for C
- programmers that convert C strings into Pascal strings before calling the
- ToolBox or OS.
-
- Secondly, calling the Gestalt glue is definitely not an idiosyncracy of the code
- generator. If anything, you've got it the wrong way around. In C, something with
- the following form:
-
- myErr = Gestalt(selector, &result);
-
- is a function call (or a macro, I suppose), and results in the compiler calling
- a function linked with your application. Anything else, such as inserting a trap
- number, is the exceptional case. The code generator is just doing what the
- headers tell it to, and in the normal case, the headers tell the compiler to
- generate a function call.
-
- --
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-
-