home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12742 next >
Encoding:
Internet Message Format  |  1992-07-20  |  4.6 KB

  1. Path: sparky!uunet!portal!cup.portal.com!Chewy
  2. From: Chewy@cup.portal.com (Paul Frederick Snively)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Gestalt glue is redundant!
  5. Message-ID: <62510@cup.portal.com>
  6. Date: Mon, 20 Jul 92 21:56:46 PDT
  7. Organization: The Portal System (TM)
  8. References: <28086@goofy.Apple.COM>
  9.   <1992Jul11.063540.11834@usenet.ins.cwru.edu>
  10.   <5cWy03MV36Pd00@amdahl.uts.amdahl.com> <BrEo5w.Bt4@world.std.com>
  11.   <c6n403hY3dcZ00@amdahl.uts.amdahl.com>
  12. Lines: 81
  13.  
  14. jsp@uts.amdahl.com (James Preston) writes:
  15.  
  16. >siegel@world.std.com (Rich Siegel) writes:
  17. >
  18. >}In article <5cWy03MV36Pd00@amdahl.uts.amdahl.com> jsp@pls.amdahl.com writes:
  19. >
  20. >}>The glue is not documented anywhere in the THINK C documentation.  Symantec
  21. >}>makes great compilers, but the completeness of their documentation is sadly
  22. >}>lacking.
  23. >
  24. >}In defense of the guys who wrote the doc, it's not their responsibility (nor
  25. >}is it Symantec's) to document the Macintosh toolbox interface, particularly
  26. >}since it's a moving target. The Gestalt glue (and the rest of the components
  27. >}of MacTraps and MacTraps2) are supplied by Apple.
  28. >
  29. >}It's also not their responsibility to teach people how to program the Macinto
  30. sh
  31. >}or how to program in C; there are reference materials already extant that
  32. >}do a very complete job at both tasks, including, but not limited to,
  33. >}Kernighan & Ritchie's "The C Programming Language" and Apple Computer's
  34. >}"Inside Macintosh" (along with associated technical notes and other related
  35. >}materials).
  36. >
  37. >Well, this is getting a little off topic, but since I feel strongly that
  38. >the THINK products' documentation is a very large blemish on otherwise
  39. >excellent products, I'd like to followup a little.
  40. >
  41. >I disagree when you say that it is not the responsibility of the THINK C
  42. >documentation to talk about something like the Gestalt glue code.  In the
  43. >first place (and I'm sure I don't need to remind Rich of this), THINK C
  44. >is not just a C compiler, it is a Macintosh development environment.
  45. >Therefore, its documentation certainly should talk about the interface
  46. >between the application program and the Mac toolbox.
  47.  
  48. The THINK C documentation _does_ talk about the interface between the
  49. application program and the Mac toolbox, to the extent that it documents
  50. how to use #include files and libraries in your projects.  There is nothing
  51. magical about the Toolbox/OS interface viz-a-viz interfacing to any other
  52. kind of library that you have library/header files for.
  53.  
  54. >More importantly,
  55. >in this particular case, calling the glue code is something that the compiler
  56. >does _behind the programmer's back_.  It doesn't matter where that glue
  57. >code comes from, be it Apple or anywhere else; the point is that the code
  58. >generator does not see my call to Gestalt and emit a call to directly to
  59. >Gestalt.  It emits code to call the glue code.  I agree that it is a good
  60. >thing to do, but certainly any such behind the back calling must be
  61. >documented by the product that does so, which in this case is THINK C.
  62.  
  63. I have to disagree.  As has been pointed out before, the interfaces and
  64. libraries that the THINK products ship with are licensed from Apple and
  65. are a moving target.  Not only is Symantec not under the obligation to
  66. reiterate Apple documentation regarding Apple interfaces and libraries,
  67. it would be, IMHO, irresponsible of them to do so, since maintaining
  68. parallel versions of such documentation would be a herculean effort
  69. replete with the potential for the most egregious sorts of errors to
  70. occur.
  71.  
  72. >I don't see how something like this can be put in the category of "teaching"
  73. >Mac or C programming; what I'm saying is that the documentation left out
  74. >a feature _of the code generator_ (i.e. that it calls glue code rather than
  75. >the Gestalt routine directly), and I therefore ended up doing an hour or
  76. >so of unecessary work.
  77.  
  78. Your assertion that the inclusion of the Gestalt glue in your code is `a
  79. feature _of the code generator_' is in error.  The Gestalt call is defined
  80. in ":Mac #includes:Apple #includes:GestaltEqu.h" (from the THINK C folder)
  81. and is conditionalized on whether the compiler variable SystemSevenOrLater is
  82. defined or not.  If it is defined, then the trap is used, otherwise the
  83. function declaration is left unresolved, in which case it's up to the linker
  84. to cope with it.  Note that all of these machinations--#include files,
  85. compiler variables, preprocessor directives, etc.--are documented in the
  86. THINK C documentation.  Apple's particular use of these features in their
  87. interfaces and libraries, however, are not, and this is what I claim is as
  88. it should be.
  89.  
  90. >--James Preston
  91.  
  92. Paul Snively
  93. Dissolute Wandering Hacker
  94. chewy@apple.com
  95.