home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / csmpdigest / csmp-digest-v3-052 < prev    next >
Text File  |  2010-09-21  |  139KB  |  3,817 lines

  1. Received-Date: Thu, 1 Sep 1994 14:34:02 +0200
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-052
  4. To: csmp-digest@ens.fr
  5. Date: Thu, 1 Sep 1994 14:33:55 +0200 (MET DST)
  6. X-Mailer: ELM [version 2.4 PL23]
  7. Mime-Version: 1.0
  8. Content-Type: text/plain; charset=ISO-8859-1
  9. Content-Transfer-Encoding: 8bit
  10. Errors-To: listman@ens.fr
  11. Reply-To: pottier@clipper.ens.fr
  12. X-Sequence: 57
  13.  
  14. C.S.M.P. Digest             Thu, 01 Sep 94       Volume 3 : Issue 52
  15.  
  16. Today's Topics:
  17.  
  18.         A Note for SC++ newbies
  19.         Adobe Photoshop Plug-ins.
  20.         Advanced QuickTime 1.6.1 Question
  21.         AppleEvents during ModalDialog?
  22.         Background always app that cannot be switched to by user?
  23.         Book recommendations for new Mac programmer?
  24.         CodeWarrior WWW Support Service
  25.         Control Strip docs?
  26.         Copying graphics without QuickDraw: custom blitting code
  27.         Debugging on PowerMacs
  28.         Guide for writing programs for both PowerPC and 680x0? etc...
  29.         HFSDispatch Trap. Success
  30.         MPW PPCC funnies ...
  31.         Opening the Apple CD ROM Tray.
  32.         PPC CDK User Comments
  33.         Problem with FSRead-WriteNoCache
  34.         Talking to the network (TCP) -- how?
  35.         What fonts are always available?
  36.         [Q] Universal Headers
  37.         best c++ book...
  38.         testing if a sound is done
  39.  
  40.  
  41.  
  42. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  43. (pottier@clipper.ens.fr).
  44.  
  45. The digest is a collection of article threads from the internet newsgroup
  46. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  47. regularly and want an archive of the discussions.  If you don't know what a
  48. newsgroup is, you probably don't have access to it.  Ask your systems
  49. administrator(s) for details.  If you don't have access to news, you may
  50. still be able to post messages to the group by using a mail server like
  51. anon.penet.fi (mail help@anon.penet.fi for more information).
  52.  
  53. Each issue of the digest contains one or more sets of articles (called
  54. threads), with each set corresponding to a 'discussion' of a particular
  55. subject.  The articles are not edited; all articles included in this digest
  56. are in their original posted form (as received by our news server at
  57. nef.ens.fr).  Article threads are not added to the digest until the last
  58. article added to the thread is at least two weeks old (this is to ensure that
  59. the thread is dead before adding it to the digest).  Article threads that
  60. consist of only one message are generally not included in the digest.
  61.  
  62. The digest is officially distributed by two means, by email and ftp.
  63.  
  64. If you want to receive the digest by mail, send email to listserv@ens.fr
  65. with no subject and one of the following commands as body:
  66.     help                        Sends you a summary of commands
  67.     subscribe csmp-digest Your Name    Adds you to the mailing list
  68.     signoff csmp-digest            Removes you from the list
  69. Once you have subscribed, you will automatically receive each new
  70. issue as it is created.
  71.  
  72. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  73. Questions related to the ftp site should be directed to
  74. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  75. digest are available there.
  76.  
  77. Also, the digests are available to WAIS users.  To search back issues
  78. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  79. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  80.  
  81.  
  82. -------------------------------------------------------
  83.  
  84. >From pfiglio@ohstpy.mps.ohio-state.edu (Pete Figliozzi)
  85. Subject: A Note for SC++ newbies
  86. Date: 31 Jul 94 12:45:01 -0400
  87. Organization: The Ohio State University, Department of Physics
  88.  
  89.  
  90. I would like to point something out to SC++ newcomers:
  91.  
  92. If your source filename ends with .c, it gets compiled with the regular C
  93. compilier.  If you turn "Think C Object Extensions" on, then your .c source
  94. file can use all of the old Think C almost-C++ stuff.
  95.  
  96. If your source filename ends with .cp or .cpp, it gets compiled with the
  97. real C++ compiler.
  98.  
  99. In other words, if all of the sudden the compiler is choking on "class xxx"
  100. statements, make sure the source file has the .cp or .cpp extension.  This
  101. just about drove me out of my mind yesterday, until I finally figured out what
  102. the problem was!
  103.  
  104. Pete 
  105.  
  106. pfiglio@mps.ohio-state.edu
  107.  
  108.  
  109. ---------------------------
  110.  
  111. >From Ed_Estes@pol.com (Ed Estes)
  112. Subject: Adobe Photoshop Plug-ins.
  113. Date: 15 Aug 1994 14:01:06 -0500
  114. Organization: (none)
  115.  
  116. Greetings.
  117.  
  118. I am interested in writing a few plug-ins for Adobe Photoshop.  Where might I
  119. find the appropriate docs/hooks in order to do so?  I see that Adobe has an
  120. "Adobe Developer's Association" and I'm hoping I don't have to join in order
  121. to get this information.  I spent close to an hour navigating through their
  122. voice-mail and never found the answers I needed.  The FAX I received
  123. regarding the ADA seemed to be geared more towards font developers and people
  124. who need serious phone support.  We've got several copies of Photoshop here
  125. at the office and I'd just like to write a few simple things to help the
  126. designers.  I don't need any support or advance technical docs, so I'm hoping
  127. I won't have to pay the $195+ to join ADA.  We've already spent thousands on
  128. the software and joining it would be an overkill for my purposes.
  129.  
  130. TAI for your input.
  131.  
  132. --Ed
  133.  
  134.  
  135. +++++++++++++++++++++++++++
  136.  
  137. >From halstej@iia.org (halstej)
  138. Date: 15 Aug 1994 22:09:46 GMT
  139. Organization: Dartmouth College, Hanover, NH
  140.  
  141. In article <217305021.597885@POLuucp.pol.com>
  142. Ed_Estes@pol.com (Ed Estes) writes:
  143. > I am interested in writing a few plug-ins for Adobe Photoshop.  Where might I
  144. > find the appropriate docs/hooks in order to do so?  I see that Adobe has an
  145.  
  146. I found this the other day at Info-Mac.  It WASN'T in the developers
  147. directory, believe it or not.  Here's the whole path:
  148.  
  149. sumex-aim.stanford.edu   /info-mac/Graphic/util/photoshop-kit.hqx
  150.  
  151. Hope that fixes you up.
  152.  
  153. -Jerry
  154.  
  155.  
  156. p.s. Public praise to Peter Lewis for Anarchie: this is an awesome
  157. program!
  158.      (including the drag manager support in the latest version)
  159.  
  160. ---------------------------
  161.  
  162. >From macneils@aol.com (MacneilS)
  163. Subject: Advanced QuickTime 1.6.1 Question
  164. Date: 29 Jul 1994 22:48:02 -0400
  165. Organization: America Online, Inc. (1-800-827-6364)
  166.  
  167. I don't know how advanced you have to be to answer this question, but I've
  168. been RTFMing QuickTime Components and Tech Notes for the answer and still
  169. haven't found it. Here it goes: Does anybody know how I can access the
  170. CopyBits() like function embedded in QuickTime? I've heard that QuickTim
  171. uses it's own version for speed's sake. Also would the dithering  be a
  172. part of that function? You see: I'm making a game that I want to work in
  173. both 16 grays as well as 256 colors. CopyBits()ing from the 8-Bit GWorld
  174. to the 4-Bit window is just too slow (especially if I use ditherCopy
  175. instead of srcCopy). And it would take too long to re-write the offscreen
  176. blitting code to support 4-Bit (not even mentioning that I would have to
  177. convert all of the icl8's to 4-Bit when the application is launched
  178. [either that or waste disk space]).
  179.  
  180. Any help would be appreciated.
  181.  
  182. Take Care,
  183. MacneilS@aol.com, The Syzygy Cult
  184.  
  185.  
  186. +++++++++++++++++++++++++++
  187.  
  188. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  189. Date: 2 Aug 94 17:41:29 +1200
  190. Organization: University of Waikato, Hamilton, New Zealand
  191.  
  192. In article <31cf12$rkt@search01.news.aol.com>, macneils@aol.com (MacneilS) writes:
  193. > I don't know how advanced you have to be to answer this question, but I've
  194. > been RTFMing QuickTime Components and Tech Notes for the answer and still
  195. > haven't found it. Here it goes: Does anybody know how I can access the
  196. > CopyBits() like function embedded in QuickTime? I've heard that QuickTim
  197. > uses it's own version for speed's sake. Also would the dithering  be a
  198. > part of that function?
  199.  
  200. Ah, you want to use "fast dithering". Yes, this is possible. The easiest way
  201. is to call the "None" codec. Basically all that does is convert between
  202. different bit depths, including doing fast dithering.
  203.  
  204. You have to set up to invoke the codec via a DecompressImage call. This needs
  205. a pointer to the "compressed" data; pass a 32-bit-clean pointer to your
  206. offscreen pixels. It also wants a handle to an ImageDescription record: you
  207. need to fake one. One important thing to remember is that the width field
  208. of the ImageDescription needs to be computed from the rowBytes field of your
  209. PixMap, not the bounds width; this is because the "compressed" pixels are
  210. assumed not to have any rowBytes padding.
  211.  
  212. Here's some example code I wrote a while ago to deal with all this. I must
  213. admit I didn't test all the cases to make sure they work, so you might want
  214. to use this with care. The code takes SrcBits as a pointer to a BitMap, only
  215. it might be a part of a PixMap or CGrafPort (as with CopyBits):
  216.  
  217.     SrcPix := NIL; (* default *)
  218.     SrcPixMap := NIL; (* ditto *)
  219.     IF BitTestPtr(7, ADR(SrcBits^.rowBytes)) THEN
  220.     IF BitTestPtr(6, ADR(SrcBits^.rowBytes)) THEN
  221.       (* it's a CGrafPort *)
  222.         SrcPixMap := CAST(PixMapHandle, SrcBits^.baseAddr);
  223.         SrcPix := SrcPixMap^; (* for SrcWidth calculation *)
  224.         PixData := GetPixBaseAddr(SrcPixMap);
  225.         SrcRect := SrcPixMap^^.bounds (* default *)
  226.     ELSE
  227.       (* pointer into pixmap -- should I try using GetPixBaseAddr here too? *)
  228.         SrcPix := CAST(PixMapPtr, SrcBits);
  229.         PixData := SrcPix^.baseAddr;
  230.         SrcRect := SrcPix^.bounds (* default *)
  231.     END (*IF*);
  232.     SrcWidth := BAndWS(SrcPix^.rowBytes, 03FFFH) * 8 DIV SrcPix^.pixelSize
  233.     ELSE
  234.       (* b&w bitmap *)
  235.     PixData := SrcBits^.baseAddr;
  236.     SrcRect := SrcBits^.bounds; (* default *)
  237.     SrcWidth := SrcBits^.rowBytes * 8
  238.     END (*IF*);
  239.     SrcOrigin := SrcRect.topLeft;
  240.     Desc := NewHandleClear(SIZE(ImageDescription));
  241.     Desc^^.idSize := SIZE(ImageDescription);
  242.     Desc^^.cType := 072617720H (* 'raw ' *);
  243.     Desc^^.resvd1 := 0;
  244.     Desc^^.resvd2 := 0;
  245.     Desc^^.dataRefIndex := 0;
  246.     Desc^^.version := 0;
  247.     Desc^^.revisionLevel := 0;
  248.     Desc^^.vendor := 0;
  249.     Desc^^.temporalQuality := ImageCompression.codecMinQuality;
  250.     Desc^^.spatialQuality := ImageCompression.codecNormalQuality;
  251.     Desc^^.width := SrcWidth;
  252.     Desc^^.height := SrcRect.bottom - SrcRect.top;
  253.     Desc^^.hRes := 000480000H;
  254.     Desc^^.vRes := 000480000H;
  255.     Desc^^.dataSize := 0;
  256.     Desc^^.frameCount := 1;
  257.   (* Desc^^.name -- skip *)
  258.     IF SrcPixMap <> NIL THEN
  259.     SrcPix := SrcPixMap^ (* refresh pointer *)
  260.     END (*IF*);
  261.     IF SrcPix = NIL THEN
  262.       (* b&w bitmap *)
  263.     Desc^^.depth := 1;
  264.     Desc^^.clutID := 1
  265.     ELSE
  266.     CASE SrcPix^.pixelSize OF
  267.     | 1, 2, 4, 8:
  268.         Desc^^.depth := SrcPix^.pixelSize;
  269.         IF (SrcPix^.pmTable^^.ctSeed > 0) AND (SrcPix^.pmTable^^.ctSeed < 128) THEN
  270.           (* standard CLUT *)
  271.         Desc^^.clutID := SrcPix^.pmTable^^.ctSeed;
  272.         IF (SrcPix^.pmTable^^.ctSeed > 32) AND (SrcPix^.pmTable^^.ctSeed < 64) THEN
  273.           (* greyscale image *)
  274.             Desc^^.depth := Desc^^.depth + 32
  275.         END (*IF*)
  276.         ELSE
  277.           (* custom CLUT *)
  278.         Err := SetImageDescriptionCTable(Desc, SrcPix^.pmTable);
  279.         IF Err <> noErr THEN
  280.             Debugger
  281.         END (*IF*)
  282.         END (*IF*)
  283.     | 16, 32:
  284.         Desc^^.depth := SrcPix^.pixelSize;
  285.         Desc^^.clutID := -1
  286.     END (*CASE*)
  287.     END (*IF*);
  288.  
  289. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  290. Info & Tech Services Division              fax: +64-7-838-4066
  291. University of Waikato            electric mail: ldo@waikato.ac.nz
  292. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  293.  
  294. ---------------------------
  295.  
  296. >From bb@lightside.com (Bob Bradley)
  297. Subject: AppleEvents during ModalDialog?
  298. Date: Mon, 25 Jul 1994 06:46:28 -0800
  299. Organization: SS Software Inc.
  300.  
  301. How are AppleEvent handles while a ModalDialog is up? Are they queued
  302. until the dialog is gone or are they just ignored and forgotten?
  303.  
  304. I've looked at the NewsWatcher source and with it's MyMovableModalDialog
  305. routine, it just masks out AppleEvents. Is this what ModalDialog does?
  306.  
  307. +++++++++++++++++++++++++++
  308.  
  309. >From bb@lightside.com (Bob Bradley)
  310. Date: Mon, 25 Jul 1994 15:26:00 -0800
  311. Organization: SS Software Inc.
  312.  
  313. In article <AA5A8FD2.44F30@klkmac008.nada.kth.se>, h+@nada.kth.se (Jon
  314. Wdtte) wrote:
  315.  
  316. > You can't mask AppleEvents; when you call WaitNextEvent, you
  317. > can receive AppleEvents. You have to write a ModalFilterProc that
  318. > is prepared to handle AppleEvents.
  319.  
  320. This is what is in the NewsWatcher Source:
  321.  
  322. WaitNextEvent(everyEvent & ~highLevelEventMask, &ev, 0, nil);
  323.  
  324. Is this not masking out high level events (AppleEvents)? I'm not being
  325. sarcastic, I've honestly never seen the ~ character used and don't know
  326. what it does. I just thought, by the way it was used above that it masked
  327. out high level events.
  328.  
  329. The problem for me with writing support for AppleEvents in my Filter Proc
  330. is that when I get an OpenDocument AppleEvent, I put up a ModalDialog for
  331. the user to setup the operation on the file and if someone was sending me
  332. OpenDocument AppleEvents while that a dialog was up, I'd get ModalDialogs
  333. popping up on top of each other.
  334.  
  335. The only way I can think of getting around this is to queue AppleEvents
  336. similar to how DragonSmith queues them.
  337.  
  338. +++++++++++++++++++++++++++
  339.  
  340. >From dnebing@andy.bgsu.edu (bgsuvax)
  341. Date: 26 Jul 1994 13:20:44 GMT
  342. Organization: Bowling Green State University
  343.  
  344. h+@nada.kth.se (Jon Wdtte) writes:
  345. > In article <bb-2507940646280001@user50.lightside.com>,
  346. >  bb@lightside.com (Bob Bradley) wrote:
  347. >>I've looked at the NewsWatcher source and with it's MyMovableModalDialog
  348. >>routine, it just masks out AppleEvents. Is this what ModalDialog does?
  349. > You can't mask AppleEvents; when you call WaitNextEvent, you
  350. > can receive AppleEvents. You have to write a ModalFilterProc that
  351. > is prepared to handle AppleEvents.
  352.  
  353.   Hmm, I haven't given this much thought before.  Would it be
  354. simpler to have the modal filter proc re-post the event so the
  355. main event loop can handle it later?
  356.  
  357. Dave
  358.  
  359. ============================================================
  360. Dave Nebinger                    dnebing@andy.bgsu.edu
  361. Network Manager, Biology Dept.   dnebing@opie.bgsu.edu
  362. Bowling Green State University   dnebing@bgsuopie (bitnet)
  363. Bowling Green, OH 43403          #include <std_disclaimer.h>
  364.  
  365.              *THE* alt.sources.mac supporter!
  366.  
  367.  
  368. +++++++++++++++++++++++++++
  369.  
  370. >From dazuma@cco.caltech.edu (Daniel Azuma)
  371. Date: Tue, 26 Jul 1994 07:37:32 -0700
  372. Organization: California Institute of Technology
  373.  
  374. bb@lightside.com (Bob Bradley) wrote:
  375.  
  376. > How are AppleEvent handles while a ModalDialog is up? Are they queued
  377. > until the dialog is gone or are they just ignored and forgotten?
  378.  
  379. Even if, as Jon Watte says, you can't mask out AppleEvents, I think you
  380. can keep them there in the queue by just NOT calling AcceptHighLevelEvent
  381. or AEProcessAppleEvent.
  382.  
  383. dnebing@andy.bgsu.edu (bgsuvax) wrote:
  384.  
  385. >   Hmm, I haven't given this much thought before.  Would it be
  386. > simpler to have the modal filter proc re-post the event so the
  387. > main event loop can handle it later?
  388.  
  389. I'd suspect that isn't such a good idea, seeing that the AppleEvent
  390. manager automatically dispatches AppleEvents you send to yourself, without
  391. putting them through the event queue. You'd have to disable that
  392. mechanism, or manually try to send them as high-level events (which is
  393. hairy).
  394.  
  395. --Dan
  396.  
  397. - ----------------------------------------------------------------
  398.   Daniel Azuma            | "Rejoice in the Lord always; again I
  399.   Caltech                 |  will say, Rejoice..."
  400.   dazuma@cco.caltech.edu  |              --Philippians 4:4
  401. - ----------------------------------------------------------------
  402.  
  403. +++++++++++++++++++++++++++
  404.  
  405. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  406. Date: Tue, 26 Jul 1994 21:05:24 GMT
  407. Organization: Apple Computer
  408.  
  409. Bob Bradley, bb@lightside.com writes:
  410. > The problem for me with writing support for AppleEvents in my Filter Proc
  411. > is that when I get an OpenDocument AppleEvent, I put up a ModalDialog for
  412. > the user to setup the operation on the file and if someone was sending me
  413. > OpenDocument AppleEvents while that a dialog was up, I'd get ModalDialogs
  414. > popping up on top of each other.
  415.  
  416. (1) You should allow the parameters to opening the file to be specified in
  417. the Apple event as optional parameters, so that the entire action can be
  418. driven by a script without user interaction.
  419.  
  420. (2) If handling an Apple event requires user interaction like a dialog, and
  421. this can't be done (like because another dialog is up) your AE handler should
  422. return the error code errAENoInteractionAllowed (I'm not sure about the exact
  423. spelling; look in <AppleEvents.h>.)
  424.  
  425. --Jens Alfke
  426.   jens_alfke@powertalk              Rebel girl, rebel girl,
  427.             .apple.com              Rebel girl you are the queen of my world
  428.  
  429. +++++++++++++++++++++++++++
  430.  
  431. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  432. Date: Wed, 27 Jul 1994 11:33:46 +0800
  433. Organization: Department of Computer Science, The University of Western Australia
  434.  
  435. In article <AA5A8FD2.44F30@klkmac008.nada.kth.se>, h+@nada.kth.se (Jon
  436. Wdtte) wrote:
  437.  
  438. >You can't mask AppleEvents; when you call WaitNextEvent, you
  439. >can receive AppleEvents. You have to write a ModalFilterProc that
  440. >is prepared to handle AppleEvents.
  441.  
  442. Or don't use ModalDialog.  The best way to do this is to bring up the
  443. dialog as the front window and then return to your application's main
  444. event loop, which detects the modal front window and refuses to activate
  445. any other windows.  This is the way MacApp and TCL do it.
  446.  
  447. btw The number of applications that *actually* support AppleEvents while
  448. modal dialogs are up is vanishingly small ):
  449. -- 
  450. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  451. Department of Computer Science, The University of Western Australia
  452.  
  453. +++++++++++++++++++++++++++
  454.  
  455. >From jonasw@lysator.liu.se (Jonas Wallden)
  456. Date: 27 Jul 1994 08:55:08 GMT
  457. Organization: (none)
  458.  
  459. quinn@cs.uwa.edu.au (Quinn "The Eskimo!") writes:
  460.  
  461. >btw The number of applications that *actually* support AppleEvents while
  462. >modal dialogs are up is vanishingly small ):
  463.  
  464. Hehe. I've written one (PowerScan), but can you say Thread Manager... It is
  465. possible to open e.g. the Preferences dialog, switch to the Finder, and drag &
  466. drop a folder/volume to the application icon!
  467.  
  468. -- Jonas Wallden
  469. --
  470. -- Jonas Wallden -- Internet: jonasw@lysator.liu.se -- AppleLink: sw1369 --
  471.  
  472. +++++++++++++++++++++++++++
  473.  
  474. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  475. Date: Thu, 28 Jul 1994 10:40:42 +0800
  476. Organization: Department of Computer Science, The University of Western Australia
  477.  
  478. In article <3157dc$mug@newsy.ifm.liu.se>, jonasw@lysator.liu.se (Jonas
  479. Wallden) wrote:
  480.  
  481. >quinn@cs.uwa.edu.au (Quinn "The Eskimo!") writes:
  482. >
  483. >>btw The number of applications that *actually* support AppleEvents while
  484. >>modal dialogs are up is vanishingly small ):
  485. >
  486. >Hehe. I've written one (PowerScan), but can you say Thread Manager...
  487.  
  488. Well my officemate has written one too but it doesn't need threads to do it!
  489. -- 
  490. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  491. Department of Computer Science, The University of Western Australia
  492.   My fully scriptable, recordable and attachable application is better
  493.   than your fully scriptable, recordable and attachable application.
  494.   [na na na-na na!]
  495.  
  496. +++++++++++++++++++++++++++
  497.  
  498. >From bb@lightside.com (Bob Bradley)
  499. Date: Sat, 30 Jul 1994 16:44:39 -0800
  500. Organization: SS Software Inc.
  501.  
  502. In article <1994Jul26.210524.22506@gallant.apple.com>, Jens Alfke
  503. <jens_alfke@powertalk.apple.com> wrote:
  504.  
  505. > (1) You should allow the parameters to opening the file to be specified in
  506. > the Apple event as optional parameters, so that the entire action can be
  507. > driven by a script without user interaction.
  508.  
  509. I'm not sure if the action should actually be done like an Open event or
  510. not. I do it now but, what my app does is rename files and my end goal
  511. would to make the application almost totally driven by scripts (no app
  512. interaction by the user at all) but, I'm not sure if I should create a new
  513. type of AppleEvent (RenameEvent?) or just use the standard OpenDocument
  514. event with special parameters. What do you think?
  515.  
  516. ---------------------------
  517.  
  518. >From gavin@ccu1.auckland.ac.nz (Gavin Picknell)
  519. Subject: Background always app that cannot be switched to by user?
  520. Date: 11 Aug 1994 00:29:37 GMT
  521. Organization: University of Auckland
  522.  
  523. Is there anyway to code an app under system 7 so that it does not appear in
  524. the finders "switch to menu", doesnt appear in the "about this macintosh"
  525. dialouge, and just sits in the background doing it's own thing
  526. whenever it gets time passed to it?
  527.  
  528. Assuming of course that its already been set up with no user interface and
  529. knows what it should be doing and requires no interaction.
  530.  
  531. Cheers.
  532.  
  533. gavin@ccu1.auckland.ac.nz
  534.  
  535. +++++++++++++++++++++++++++
  536.  
  537. >From rmah@panix.com (Robert Mah)
  538. Date: Thu, 11 Aug 1994 03:59:59 -0500
  539. Organization: One Step Beyond
  540.  
  541. gavin@ccu1.auckland.ac.nz (Gavin Picknell) wrote:
  542.  
  543. ) Is there anyway to code an app under system 7 so that it does not appear in
  544. ) the finders "switch to menu", doesnt appear in the "about this macintosh"
  545. ) dialouge, and just sits in the background doing it's own thing
  546. ) whenever it gets time passed to it?
  547. ) Assuming of course that its already been set up with no user interface and
  548. ) knows what it should be doing and requires no interaction.
  549.  
  550.  
  551. Basically, all you want to do is minimal toolbox initialization (just 
  552. _InitGraf and maybe _InitFonts) and then go to your event loop.
  553.  
  554. In your event loop, since you have no user interface, and the app can't be
  555. switched in/out, the only events you have to handle are kHighLevelEvent's
  556. and idle events.  Simply dispatch on the AppleEvents as they come in to do
  557. your stuff. 
  558.  
  559. Don't forget to set the "background only" bit in the 'SIZE' resource and
  560. change the file type to 'appe' if you want it to behave like an extension
  561. from the user's point of view.
  562.  
  563. The code is rather simple...
  564.  
  565. void main()
  566. {
  567.     EventRecord evt;
  568.  
  569.     InitGraf( &qd.thePort );
  570.     InstallAppleEvents();       // install 'oapp', 'quit' and
  571.                                 // dummy 'odoc'/'pdoc' handlers
  572.     DoOtherInits();
  573.  
  574.     while( ! gAllDone ){
  575.         WaitNextEvent( everyEvent, &evt, sleepTime, NULL );
  576.         if( evt.what == kHighLevelEvent )
  577.             AEProcessAppleEvent( &evt );
  578.         else
  579.             DoIdle();
  580.     }
  581.     ExitToShell();
  582. }
  583.  
  584.  
  585. Cheers,
  586. Rob
  587. _____________________________________________________________________
  588. Robert S. Mah           Software Development          +1.212.947.6507
  589. One Step Beyond        and Network Consulting          rmah@panix.com
  590.  
  591. +++++++++++++++++++++++++++
  592.  
  593. >From sokoloff@mv.mv.com (Jim Sokoloff)
  594. Date: Thu, 11 Aug 1994 12:57:45 GMT
  595. Organization: MV Communications, Inc.
  596.  
  597. In article <32brdh$2nd@ccu2.auckland.ac.nz>,
  598. Gavin Picknell <gavin@ccu1.auckland.ac.nz> wrote:
  599. >Is there anyway to code an app under system 7 so that it does not appear in
  600. >the finders "switch to menu", doesnt appear in the "about this macintosh"
  601. >dialouge, and just sits in the background doing it's own thing
  602. >whenever it gets time passed to it?
  603. >
  604. >Assuming of course that its already been set up with no user interface and
  605. >knows what it should be doing and requires no interaction.
  606. >
  607. >Cheers.
  608. >
  609. >gavin@ccu1.auckland.ac.nz
  610.  
  611. Sure there is. In the SIZE resource, set the background only bit.
  612. I used to think that you had to change the file type to appe, but I
  613. don't think that is necessary...
  614.  
  615. - -Jim
  616.  
  617.  
  618. +++++++++++++++++++++++++++
  619.  
  620. >From Matt Slot <fprefect@engin.umich.edu>
  621. Date: 11 Aug 1994 04:19:04 GMT
  622. Organization: University of Michigan
  623.  
  624. Gavin Picknell, gavin@ccu1.auckland.ac.nz writes:
  625.  > Is there anyway to code an app under system 7 so that it does not appear in
  626.  > the finders "switch to menu", doesnt appear in the "about this macintosh"
  627.  > dialouge, and just sits in the background doing it's own thing
  628.  > whenever it gets time passed to it?
  629.  
  630. You need to set the "Background Only" bit in your app's SIZE flags 
  631. (typically the same place you set Type/Creator/MemSize). Such "programs"
  632. have File Type of "appe", not "APPL" -- and is treated as an extension.
  633. This will keep your program from being switch to, out of the Applications
  634. menu, but not out of the "About the Finder" and other memory utils.
  635.  
  636. Matt
  637.  
  638. +++++++++++++++++++++++++++
  639.  
  640. >From Mats.Bredell@udac.se (Mats Bredell)
  641. Date: Sat, 13 Aug 1994 20:38:22 +0200
  642. Organization: UDAC
  643.  
  644. In article <32c8ro$bna@lastactionhero.rs.itd.umich.edu>, Matt Slot
  645. <fprefect@engin.umich.edu> wrote:
  646.  
  647. > Gavin Picknell, gavin@ccu1.auckland.ac.nz writes:
  648. >  > Is there anyway to code an app under system 7 so that it does not appear in
  649. >  > the finders "switch to menu", doesnt appear in the "about this macintosh"
  650. >  > dialouge, and just sits in the background doing it's own thing
  651. >  > whenever it gets time passed to it?
  652. > You need to set the "Background Only" bit in your app's SIZE flags 
  653. > (typically the same place you set Type/Creator/MemSize). Such "programs"
  654. > have File Type of "appe", not "APPL" -- and is treated as an extension.
  655. > This will keep your program from being switch to, out of the Applications
  656. > menu, but not out of the "About the Finder" and other memory utils.
  657.  
  658. They can also have type "APPL", which makes it possible to start them by
  659. double clicking by the user. It still doesn't have any user interface, so
  660. the application will simply "disappear" into the system which might
  661. confuse the user. "appe" is useful if the application should always be run
  662. at startup, while "APPL" can be used if the user is supposed to start the
  663. background application.
  664.  
  665. /Mats
  666.  
  667. ---------------------------
  668.  
  669. >From kimmel@cs.umass.edu (Matt Kimmel)
  670. Subject: Book recommendations for new Mac programmer?
  671. Date: 15 Aug 1994 14:54:47 GMT
  672. Organization: University of Massachusetts, Amherst MA
  673.  
  674.  
  675. Hi,
  676.  
  677. I just bought a Mac system and a copy of Metrowerks CodeWarrior, and I'd
  678. like to start to learn how to write Mac apps in C and/or C++.  Can anybody
  679. recommend a good book to get me started?  I am very familiar with C and
  680. C++ and with other GUIs; however, I have no experience with the Mac toolbox
  681. or with CodeWarrior.
  682.  
  683. Any recommendations would be most appreciated.
  684.  
  685. Thanks!
  686. -Matt
  687. -- 
  688. Matt Kimmel                                   Associate Software Specialist
  689. Department of Computer Science, LGRC A313             Phone: (413) 545-4319
  690. University of Massachusetts                             Fax: (413) 545-1249
  691. Amherst, MA  01003                              E-mail: kimmel@cs.umass.edu
  692.  
  693. +++++++++++++++++++++++++++
  694.  
  695. >From nick+@pitt.edu ( nick.c )
  696. Date: Mon, 15 Aug 94 15:15:29 GMT
  697. Organization: The Pitt, Chemistry
  698.  
  699. In Article <32nvjn$ncc@opine.cs.umass.edu>, kimmel@cs.umass.edu (Matt
  700. Kimmel) wrote:
  701.  
  702. >I just bought a Mac system and a copy of Metrowerks CodeWarrior, and I'd
  703. >like to start to learn how to write Mac apps in C and/or C++.  Can anybody
  704. >recommend a good book to get me started?  I am very familiar with C and
  705. >C++ and with other GUIs; however, I have no experience with the Mac toolbox
  706. >or with CodeWarrior.
  707.  
  708.  
  709.     Here's a list I keep on my HD, take all comments with a grain of
  710.       salt, luck.
  711.  
  712.  
  713.  
  714. Books on Mac Programming
  715. ~~~~~~~~~~~~~~~~~~~~~~~~
  716.  
  717. Learning the Language (C/C++)
  718. =============================
  719.  
  720.     _Learn C on the Macintosh_ by Dave Mark
  721.       Addison Wesley Publishing
  722.         
  723.       A good introduction to the C language, includes a limited
  724.       version of Think C 5.0.  Does not cover the toolbox, but
  725.       then you shouldn't be worrying about the toolbox till you
  726.       understand the language
  727.       
  728.     _Learn C++ on the Macintosh_ by Dave Mark
  729.       Addison Wesley Publishing, 1993 ISBN: 0-201-62204-1
  730.       
  731.       An introduction to C++, best if you already understand C.
  732.       I'd consider this an unofficial "part 2" to Dave's Learn C
  733.       book.  Includes a limited version of Symantec C++ 6.0.
  734.       
  735.     _The C Programming Language_ 2nd ed. by Brian Kernighan 
  736.       and Dennis Ritchie, Prentice Hall, 1988 ISBN: 0-13-110362-8
  737.       
  738.       The definitive reference for the C language.  A must have.
  739.       
  740.     _The C++ Programming Language_ 2nd ed., by Bjarne Stroustrup
  741.       Addison Wesley Publishing, 1991 ISBN: 0-201-53992-6
  742.       
  743.       As close to a definitive reference for the C++ language as
  744.       exists.  Very important reference, but reads like stereo
  745.       instructions.  Should not be considered an introduction.
  746.       
  747. Learning the Toolbox
  748. ====================
  749.  
  750.     _Macintosh Programming Techniques_ by Dan Parks Sydow
  751.       M&T Books, 1994 ISBN: 1-55828-326-9
  752.                       
  753.       One of the best introductions to macintosh programming.
  754.       Introduces windows, menus, etc.  Assumes a working knowledge
  755.       of C.  Includes a floppy with all example source code, and
  756.       an electronic tutorial.
  757.       
  758.     _Macintosh Programming Primer_ by Dave Marks
  759.     
  760.       Volumes one and two.  A good introduction to macintosh programming,
  761.       and what I started with.  Some folks argue it's a little out of
  762.       date, but I'd still recommend it to anyone starting out.
  763.       
  764. Learning an Environment
  765. =======================
  766.  
  767.     _Symantec C++ for the Macintosh: The Basics_ by John May
  768.       & Judy Whittle, M&T Books, 1993 ISBN: 1-55828-276-9
  769.       
  770.       A good introduction to Symantec's C++ environment, one of the
  771.       best programming environment's for the mac (IMHO).  Reintroduces
  772.       basic C++ concepts and the environment in detail.  Includes 
  773.       example source code on enclosed floppy disk.
  774.       
  775.     _Power Macintosh Programming Starter Kit_ by Tom Thompson
  776.       Hayden Books, 1994 ISBN: 1-56830-091-3
  777.       
  778.       A good introduction to MetroWerk's CodeWarrior, the other best
  779.       programming environment for the mac, the only one to use if you're
  780.       building PPC code, and my current favorite.  The enclosed CD
  781.       has a limited version of CodeWarrior (you can only work on
  782.       the projects included in the disc - can't create new ones),
  783.       and example code.  Covers a lot of toolbox issues that are 
  784.       not explored in other introductory books and the PPC architecture
  785.       in detail.  Assumes working knowledge of C, and the toolbox.
  786.      
  787.      
  788.  
  789.      Interet: nick@pitt.edu         _/   _/  _/  _/_/_/   _/   _/  
  790.       eWorld: nick                 _/_/ _/  _/  _/   _/  _/_/_/    
  791.          CIS: 71232,766           _/ _/_/  _/  _/       _/ _/      
  792.                                  _/   _/  _/   _/_/_/  _/   _/     
  793.     
  794.            "Science is nothing but perception" - Plato
  795.  
  796.  
  797. ---------------------------
  798.  
  799. >From fairgate@vespucci.iquest.com (Fairgate Technologies)
  800. Subject: CodeWarrior WWW Support Service
  801. Date: 5 Aug 1994 14:26:22 -0500
  802. Organization: Fairgate Technologies
  803.  
  804. Fairgate Technologies (FT) is pleased to announce the availability of
  805. its WWW server at http://www.iquest.com/~fairgate.
  806.  
  807. FT specializes in custom software & documentation for the Macintosh.
  808. Because of all the help and useful information we've gotten from the
  809. 'net over the years, we're offering our WWW server as a free resource
  810. to the net.community of Macintosh developers.
  811.  
  812. The server contains useful information for the Macintosh developer,
  813. including the official Metrowerks CodeWarrior WWW support area and an
  814. archive of user-contributed PowerPlant classes. We will be continuing
  815. to expand and improve the server over the next several months, so we
  816. encourage you to visit often and to make suggestions via the provided
  817. suggestion boxes.
  818.  
  819. Send specific comments or questions to the FT Webmaster at
  820. "web@fairgate.com". We hope you enjoy our service!
  821.  
  822. -Paul Robichaux
  823.  Fairgate Technologies
  824.  
  825. -- 
  826. Paul Robichaux       Fairgate Technologies         fairgate@iquest.com
  827.       Fairgate Technologies does custom Mac development.
  828.     Visit our WWW page at http://www.iquest.com/~fairgate.
  829.  
  830. ---------------------------
  831.  
  832. >From J.C.Highfield@lut.ac.uk
  833. Subject: Control Strip docs?
  834. Date: Fri, 29 Jul 1994 22:02:09 GMT
  835. Organization: Loughborough University, UK.
  836.  
  837. Hi there! Does anyone know where documentation about writing control
  838. strip modules for the powerbooks can be found?
  839.  
  840. Thanks,
  841.        Julian.
  842.  
  843. J.C.Highfield@lut.ac.uk
  844.  
  845.  
  846. +++++++++++++++++++++++++++
  847.  
  848. >From rmah@panix.com (Robert Mah)
  849. Date: 30 Jul 1994 19:12:46 GMT
  850. Organization: One Step Beyond
  851.  
  852. J.C.Highfield@lut.ac.uk (J.C.Highfield) wrote:
  853.  
  854. ) Hi there! Does anyone know where documentation about writing control
  855. ) strip modules for the powerbooks can be found?
  856.  
  857. It's included as a chapter in the developer's note about the Powerbook
  858. 500 series.
  859.  
  860. Cheers,
  861. Rob
  862. _____________________________________________________________________
  863. Robert S. Mah           Software Development          +1.212.947.6507
  864. One Step Beyond        and Network Consulting          rmah@panix.com
  865.  
  866. +++++++++++++++++++++++++++
  867.  
  868. >From dnebing@andy.bgsu.edu (bgsuvax)
  869. Date: 30 Jul 1994 20:45:53 GMT
  870. Organization: Bowling Green State University
  871.  
  872. J.C.Highfield@lut.ac.uk writes:
  873. > Hi there! Does anyone know where documentation about writing control
  874. > strip modules for the powerbooks can be found?
  875. > Thanks,
  876. >        Julian.
  877. > J.C.Highfield@lut.ac.uk
  878.  
  879.   The header files for doing so can be found in the alt.sources.mac
  880. archive at ftpbio.bgsu.edu (129.1.252.66) in the
  881. /ftp/pub/alt.sources.mac/snippets-v02/controlstrip.h.
  882.  
  883. Dave
  884.  
  885. ============================================================
  886. Dave Nebinger                    dnebing@andy.bgsu.edu
  887. Network Manager, Biology Dept.   dnebing@opie.bgsu.edu
  888. Bowling Green State University   dnebing@bgsuopie (bitnet)
  889. Bowling Green, OH 43403          #include <std_disclaimer.h>
  890.  
  891.              *THE* alt.sources.mac supporter!
  892.  
  893. +++++++++++++++++++++++++++
  894.  
  895. >From Tony Andreoli <Tony_Andreoli_-_CTA@CL_C21SMTP_GW.CHINALAKE.NAVY.MIL>
  896. Date: Mon, 1 Aug 1994 01:49:23 GMT
  897. Organization: Naval Air Warfare Center - Weapons Division
  898.  
  899. In article <Ctq2JL.128@lut.ac.uk> , J.C.Highfield@lut.ac.uk writes:
  900. >Hi there! Does anyone know where documentation about writing control
  901. >strip modules for the powerbooks can be found?
  902. >
  903. >Thanks,
  904.  
  905. Look on the June (I think) Developers References CD.  It's in the PB 5xx
  906. documentation.
  907.  
  908. Tony Andreoli
  909.  
  910. ---------------------------
  911.  
  912. >From alex@metcalf.demon.co.uk (Alex Metcalf)
  913. Subject: Copying graphics without QuickDraw: custom blitting code
  914. Date: Thu, 4 Aug 1994 12:40:19 GMT
  915. Organization: Best Before Yesterday
  916.  
  917.  
  918.         Due to further requests from a number of people, here again is
  919. some code for copying graphics without QuickDraw. It's really intended for
  920. all those people writing arcade games: 90 percent of programmers will do
  921. fine using CopyBits and CopyMask in their software.
  922.  
  923.         If you have any questions or comments on the code, feel free to
  924. get in touch!
  925.  
  926.  
  927.         Alex
  928.  
  929. --
  930. Alex Metcalf, Best Before Yesterday
  931. Mac programmer in C, C++, HyperTalk, assembler
  932. Juggler, 3-ball tricks
  933.  
  934. Internet:          alex@metcalf.demon.co.uk
  935. Fax (UK):          (0570) 45636
  936. Fax (US / Canada): 011 44 570 45636
  937.  
  938.  
  939.  
  940. Custom graphics blitting code
  941. - ---------------------------
  942.  
  943.    This code is a modification on the code from my new arcade game,
  944. Maniac 2. It is possible to make the code even faster (especially if you
  945. are only copying one size of rectangle), but it works well (and fast) as
  946. a cheap alternative to CopyBits. With this and similar routines
  947. in my game, I get an increase of up to 500 percent over CopyBits and
  948. CopyMask, mainly because the code does far less checking than CopyBits does.
  949.  
  950.    Note that this code may actually draw to the screen when the
  951. electron beam is half way down the screen. So, the top half of
  952. your graphic may appear slightly after the bottom half. You
  953. need to read up on the Vertical Retrace manager and SlotVInstall if you
  954. want to "sync" your animation with the electron beam of the screen.
  955.  
  956.    The code copies a rectangle from an offscreen graphics world onto the
  957. screen. The following assumptions are made:
  958.  
  959. o   You're in 32-bit addressing mode
  960. o   The monitor is in 8-bit (256 colours/grays); 1 byte per pixel
  961. o   The cursor is hidden
  962. o   The source and destination rectangles are the same size
  963. o   The GWorld and the screen are using the same colour table
  964. o   The rectangles don't go off the screen or off the GWorld
  965. o   The rectangles are in coordinates which are local to the screen
  966.         (i.e. top left of screen is 0,0)
  967.  
  968.    There are four globals used:
  969.  
  970. o   gWorldPixMapBase is the base address of the graphics world pix map.
  971. You use GetGWorldPixMap to get the pix map, and then you use
  972. GetPixBaseAddr to get the base address.
  973.  
  974. o   gScreenPixMapBase is the pix map base address of the screen.
  975. You get the pix map from the GDHandle of the screen you're using. Then
  976. you use GetPixBaseAddr.
  977.  
  978.     If you're using the main monitor, you can get the GDHandle for that
  979. monitor by using GetMainDevice ().
  980.  
  981. o   gWorldRowByteCount is the rowBytes for the graphics world. You get
  982. it like this:
  983.  
  984. gWorldRowByteCount = (0x7FFF & (**tWorldPixMap).rowBytes);
  985.  
  986. o   gScreenRowByteCount is the rowBytes for the screen. You get it like
  987. this:
  988.  
  989. gScreenRowByteCount = (0x7FFF & (**tScreenPixMap).rowBytes);
  990.  
  991.  
  992.    I hope the code is useful to someone: you might try using the code,
  993. but it's much better if you read through and understand what's happening,
  994. and then use parts of it in your own game, animation app, or whatever.
  995.  
  996.    If you don't know how to read assembler, an excellent start is this
  997. book:
  998.  
  999. How to Write Macintosh Software
  1000. by Scott Knaster
  1001. Published by Addison Wesley
  1002. ISBN 0-201-60805-7
  1003.  
  1004.    Have fun!
  1005.  
  1006.  
  1007.  
  1008.    Alex Metcalf
  1009.    alex@metcalf.demon.co.uk
  1010.  
  1011.  
  1012. void RectCopy (Rect tSourceRect, Rect tDestRect)
  1013. {
  1014.         asm
  1015.         {
  1016.                 movem.l a0-a1/d0-d7, -(sp);
  1017.                 
  1018.                 move.l  gWorldPixMapBase, D0;
  1019.                 move.w  tSourceRect.top, D1;
  1020.                 ext.l   D1;
  1021.                 mulu.l  gWorldRowByteCount, D1;
  1022.                 add.l   D1, D0;
  1023.                 move.w  tSourceRect.left, D1;
  1024.                 ext.l   D1;
  1025.                 add.l   D1, D0;
  1026.                 move.l  D0, A0;     // A0 is the source
  1027.                 
  1028.                 move.l  gScreenPixMapBase, D0;
  1029.                 move.w  tDestRect.top, D1;
  1030.                 ext.l   D1;
  1031.                 mulu.l  gScreenRowByteCount, D1;
  1032.                 add.l   D1, D0;
  1033.                 move.w  tDestRect.left, D1;
  1034.                 ext.l   D1;
  1035.                 add.l   D1, D0;
  1036.                 move.l  D0, A1;     // A1 is the destination
  1037.                 
  1038.                 move.w  tSourceRect.right, D6;
  1039.                 move.w  tSourceRect.left, D0;
  1040.                 sub.w   D0, D6; 
  1041.                 ext.l   D6;         // D6 is the width of rect to copy
  1042.                 
  1043.                 move.l  gWorldRowByteCount, D2;
  1044.                 sub.l   D6, D2;     // D2 is the source row offset
  1045.                 
  1046.                 move.l  gScreenRowByteCount, D3;
  1047.                 sub.l   D6, D3;     // D3 is the destination row offset
  1048.                 
  1049.                 move.w  tSourceRect.bottom, D4;
  1050.                 move.w  tSourceRect.top, D0;
  1051.                 sub.w   D0, D4;
  1052.                 ext.l   D4;
  1053.                 subq.l  #1, D4;     // D4 is number of rows to copy
  1054.                 
  1055.                 moveq.l #4, D5;
  1056.                 
  1057.                 tst.l   D4;
  1058.                 ble.s   @6;
  1059.                 
  1060.                 move.l D6, D0;
  1061.                 divs.l D5, D0;
  1062.                 move.l D5, D7;
  1063.                 mulu.l D0, D7;
  1064.                 move.l D6, D1;
  1065.                 sub.l  D7, D1;
  1066.                 subq.l #1, D0;
  1067.                 subq.l #1, D1;
  1068.                 move.l D0, D6;
  1069.                 move.l D1, D7;
  1070.                 
  1071.                 @1;
  1072.                 tst.l D0;
  1073.                 blt.s @3;
  1074.                 
  1075.                 @2;
  1076.                 move.l (a0)+, (a1)+;
  1077.                 dbra d0,@2;
  1078.                 
  1079.                 @3;
  1080.                 tst.l D1;
  1081.                 blt.s @5;
  1082.                 
  1083.                 @4;
  1084.                 move.b (a0)+, (a1)+;
  1085.                 dbra d1,@4;
  1086.                 
  1087.                 @5;
  1088.                 adda.l D2, A0;
  1089.                 adda.l D3, A1;
  1090.                 move.l D6, D0;
  1091.                 move.l D7, D1;
  1092.                 dbra d4,@1;
  1093.                 
  1094.                 @6;
  1095.                 movem.l (sp)+, a0-a1/d0-d7;
  1096.         }
  1097. }
  1098.  
  1099. +++++++++++++++++++++++++++
  1100.  
  1101. >From dwareing@apanix.apana.org.au (David Wareing)
  1102. Date: 18 Aug 94 14:32:24 GMT
  1103. Organization: Apanix Public Access Unix, +61 8 373 5485 (5 lines)
  1104.  
  1105. alex@metcalf.demon.co.uk (Alex Metcalf) writes:
  1106.  
  1107. >        Due to further requests from a number of people, here again is
  1108. >some code for copying graphics without QuickDraw. It's really intended for
  1109. >all those people writing arcade games: 90 percent of programmers will do
  1110. >fine using CopyBits and CopyMask in their software.
  1111.  
  1112. Excellent. Well done Alex. 
  1113.  
  1114. --
  1115. David Wareing
  1116. Adelaide, South Australia         dwareing@apanix.apana.org.au
  1117. - ------------------------------------------------------------
  1118. Freelance Macintosh Games & Multimedia Programming
  1119.  
  1120. ---------------------------
  1121.  
  1122. >From lipa@camis.Stanford.EDU (Bill Lipa)
  1123. Subject: Debugging on PowerMacs
  1124. Date: 1 Aug 1994 21:11:14 GMT
  1125. Organization: Center for Advanced Medical Informatics at Stanford
  1126.  
  1127.  
  1128. What methods are people using to do low-level debugging on PowerMacs?
  1129. By low-level, I mean tracking down problems in apps that are running outside
  1130. of a source-code debugging environment like Metrowerks.
  1131.  
  1132. On 68K Macs, Macsbug made it easy to figure out where things were hanging
  1133. and crashing by using the sc7 and sc6 commands, for example. Is there any
  1134. equivalent on PowerMacs?
  1135.  
  1136. You can use Macsbug on PowerMacs but, as I understand it, only to debug
  1137. emulated code. I need to debug native code.
  1138.  
  1139. Bill
  1140.  
  1141.  
  1142. +++++++++++++++++++++++++++
  1143.  
  1144. >From mclow@san_marcos.csusm.edu (Marshall Clow)
  1145. Date: Mon, 01 Aug 1994 21:17:38 -0800
  1146. Organization: Aladdin Systems
  1147.  
  1148. In article <31jodi$ksn@morrow.stanford.edu>, lipa@camis.Stanford.EDU (Bill
  1149. Lipa) wrote:
  1150.  
  1151. > What methods are people using to do low-level debugging on PowerMacs?
  1152. > By low-level, I mean tracking down problems in apps that are running outside
  1153. > of a source-code debugging environment like Metrowerks.
  1154. > On 68K Macs, Macsbug made it easy to figure out where things were hanging
  1155. > and crashing by using the sc7 and sc6 commands, for example. Is there any
  1156. > equivalent on PowerMacs?
  1157. > You can use Macsbug on PowerMacs but, as I understand it, only to debug
  1158. > emulated code. I need to debug native code.
  1159.  
  1160. Well....
  1161.    There's "The Debugger", by Steve Jasik. Debugs native apps, and
  1162. everything else. If you can think like Steve, you're home free. :-)
  1163.  
  1164.    There's "Macintosh Debugger for Power PC", part of the Mac on Risc SDK.
  1165. It's a two machine debugger, and it only really does apps, and some plug-ins.
  1166.  
  1167.    There's Macsbug. There are some nifty dcmds that help you debug ppc code.
  1168.  
  1169.    There's the Metrowerks debugger. Nice if you're using Code Warrior and
  1170. developing apps.
  1171.  
  1172. ################
  1173.    Someday, there will be TMON PPC. Call Alan and tell him you want it now ;-)
  1174.  
  1175.    Someday, "Macintosh Debugger for Power PC" will be one-machine debugger
  1176. and will debug 68K code too. (One debugger to find them all, and in the
  1177. darkness bind them)
  1178.  
  1179. -- 
  1180. Marshall Clow
  1181. Aladdin Systems
  1182. mclow@san_marcos.csusm.edu
  1183.  
  1184. +++++++++++++++++++++++++++
  1185.  
  1186. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  1187. Date: Tue, 2 Aug 1994 17:42:46 GMT
  1188. Organization: Apple Computer
  1189.  
  1190. Bill Lipa, lipa@camis.Stanford.EDU writes:
  1191. > What methods are people using to do low-level debugging on PowerMacs?
  1192. > By low-level, I mean tracking down problems in apps that are running outside
  1193. > of a source-code debugging environment like Metrowerks.
  1194. > On 68K Macs, Macsbug made it easy to figure out where things were hanging
  1195. > and crashing by using the sc7 and sc6 commands, for example. Is there any
  1196. > equivalent on PowerMacs?
  1197. > You can use Macsbug on PowerMacs but, as I understand it, only to debug
  1198. > emulated code. I need to debug native code.
  1199.  
  1200. You're basically correct. There are some 'dcmd's -- available on the
  1201. 'develop' 17 CD -- the help with PPC debugging. They're PPC equivalents of
  1202. 'il', 'sc', 'td', 'wh' and some special stuff for viewing routine
  1203. descriptors. Of course you still can't step through native code since MacsBug
  1204. is emulated.
  1205.   (I personally have not figured out how to get the native stack crawl
  1206. ('scp') to work. Anyone know what address you have to give it as a parameter?)
  1207.  
  1208. One hint I can share: I've been having trouble with jumps to 0 -- this can be
  1209. caused by bogus RoutineDescriptors or by smashing transition vectors. It
  1210. turns out that (at least on my Mac) the random spoodge at location 0 tends to
  1211. look like a PPC instruction that branches to itself, thus causing an infinite
  1212. loop. This just freezes your machine, even if you do have a PPC debugger
  1213. running. Sadly, even EBBE doesn't help because 50FF8001 is not an illegal
  1214. instruction on PPC. 00000000, however, is illegal. So when I get one of these
  1215. freezes, I first do a 'tdp' and check if the PC is at 0 or 4. If so, I use
  1216. "sl 0 0" or "sl 4 0" to smash an illegal instruction in, then continue. I
  1217. then very quickly end up in the source level debugger with an "illegal
  1218. instruction" exception. From there I have a better chance of figuring out
  1219. what caused it.
  1220.  
  1221. --Jens Alfke
  1222.   jens_alfke@powertalk              Rebel girl, rebel girl,
  1223.             .apple.com              Rebel girl you are the queen of my world
  1224.  
  1225. +++++++++++++++++++++++++++
  1226.  
  1227. >From mattm@apple.com (Matthew Melmon)
  1228. Date: Tue, 2 Aug 1994 19:42:30 GMT
  1229. Organization: Apple Computer, Inc.
  1230.  
  1231. In article <31jodi$ksn@morrow.stanford.edu>, lipa@camis.Stanford.EDU (Bill
  1232. Lipa) wrote:
  1233. > What methods are people using to do low-level debugging on PowerMacs?
  1234. > By low-level, I mean tracking down problems in apps that are running outside
  1235. > of a source-code debugging environment like Metrowerks.
  1236. > On 68K Macs, Macsbug made it easy to figure out where things were hanging
  1237. > and crashing by using the sc7 and sc6 commands, for example. Is there any
  1238. > equivalent on PowerMacs?
  1239.  
  1240. The Macintosh Debugger, shipped on ETO, can display source code,
  1241. PowerPC instructions, POWER instructions, the registers, it can
  1242. do stack crawls, it can even show you your code fragments and their
  1243. exports.  It can do all this either on the target, or connected to
  1244. the target via serial or EtherTalk cables (Personally, I don't 
  1245. see what the big fuss about "two-machine" debugging is.  To be
  1246. blunt, it strikes me as the technically superior choice.  But hey,
  1247. c'est moi, and this is a tangent...)
  1248.  
  1249. To be fair and honest, I must admit MD can provoke you into 
  1250. fits of realous jage.  But when it works, its way cool.  Heh. 
  1251. Heh, heh, heh.
  1252.  
  1253. +++++++++++++++++++++++++++
  1254.  
  1255. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1256. Date: Wed, 3 Aug 1994 09:20:10 +1200 (NZST)
  1257. Organization: (none)
  1258.  
  1259. mclow@san_marcos.csusm.edu (Marshall Clow) writes:
  1260. >    There's "The Debugger", by Steve Jasik. Debugs native apps, and
  1261. > everything else. If you can think like Steve, you're home free. :-)
  1262. >    There's "Macintosh Debugger for Power PC", part of the Mac on Risc SDK.
  1263. > It's a two machine debugger, and it only really does apps, and some plug-ins.
  1264. >    There's Macsbug. There are some nifty dcmds that help you debug ppc code.
  1265.  
  1266. So I keep hearing.  But where do you *get* them from?  I don't see them on ETO.
  1267. I don't see them on the Mac on RISC SDK.  I don't see them on CodeWarrior/Gold.
  1268. I don't see them on Apple's ftp sites.
  1269.  
  1270. Maybe I'm blind.  I hope so :-)
  1271.  
  1272. -- Bruce
  1273.  
  1274. +++++++++++++++++++++++++++
  1275.  
  1276. >From Brian Strull <strull@apple.com>
  1277. Date: Tue, 2 Aug 1994 20:54:37 GMT
  1278. Organization: Apple Computer, Inc.
  1279.  
  1280. In article <mclow-0108942117380001@lpm1.csusm.edu> Marshall Clow,
  1281. mclow@san_marcos.csusm.edu writes:
  1282. >   There's "Macintosh Debugger for Power PC", part of the Mac on Risc
  1283. SDK.
  1284. >It's a two machine debugger, and it only really does apps, and some
  1285. plug-ins.
  1286.  
  1287. I'm not sure why you say it only does apps.  MD can debug any PowerPC 
  1288. code loaded by the Code Fragment manager, which is everything 
  1289. (except maybe the emulator itself).
  1290.  
  1291. +++++++++++++++++++++++++++
  1292.  
  1293. >From neeri@iis.ee.ethz.ch (Matthias Neeracher)
  1294. Date: 02 Aug 1994 22:49:57 GMT
  1295. Organization: Integrated Systems Laboratory, ETH, Zurich
  1296.  
  1297. In article <2858750409@hoult.actrix.gen.nz>, Bruce@hoult.actrix.gen.nz (Bruce Hoult) writes:
  1298. > mclow@san_marcos.csusm.edu (Marshall Clow) writes:
  1299. >> There's "The Debugger", by Steve Jasik. Debugs native apps, and
  1300. >> everything else. If you can think like Steve, you're home free. :-)
  1301. >> 
  1302. >> There's "Macintosh Debugger for Power PC", part of the Mac on Risc SDK.
  1303. >> It's a two machine debugger, and it only really does apps, and some plug-ins.
  1304. >> 
  1305. >> There's Macsbug. There are some nifty dcmds that help you debug ppc code.
  1306.  
  1307. > So I keep hearing.  But where do you *get* them from?  I don't see them on
  1308. > ETO.  I don't see them on the Mac on RISC SDK.  I don't see them on
  1309. > CodeWarrior/Gold.  I don't see them on Apple's ftp sites.
  1310.  
  1311. But you will see them in the "develop" folder on the appropriate CDs.
  1312.  
  1313. Matthias
  1314.  
  1315. - ---
  1316. Matthias Neeracher <neeri@iis.ee.ethz.ch> http://err.ethz.ch/members/neeri.html
  1317.    "I don't know if this will help you solve your problem, but it's
  1318.     certainly entertained me to tell you this." -- Tim Dierks
  1319.  
  1320. +++++++++++++++++++++++++++
  1321.  
  1322. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  1323. Date: Tue, 2 Aug 1994 21:41:17 GMT
  1324. Organization: Apple Computer
  1325.  
  1326. Matthew Melmon, mattm@apple.com writes:
  1327. > the target via serial or EtherTalk cables (Personally, I don't 
  1328. > see what the big fuss about "two-machine" debugging is.  To be
  1329. > blunt, it strikes me as the technically superior choice.  But hey,
  1330. > c'est moi, and this is a tangent...)
  1331.  
  1332. Well,
  1333. (A) It's damned slow;
  1334. (B) You have to go to the pain of either copying your executables to the
  1335. target machine before running them; or of copying all your source code and
  1336. .xSYM files to the debugging machine. (Depends on whether you need to run
  1337. your code on the development machine or not. Not many people have two
  1338. PowerMacs yet, so they probably want to run the code and develop it on the
  1339. same machine, at least if they use CW.)
  1340.  
  1341. --Jens Alfke                           jens_alfke@powertalk.apple.com
  1342.                    "A man, a plan, a yam, a can of Spam ... Bananama!"
  1343.  
  1344. +++++++++++++++++++++++++++
  1345.  
  1346. >From dshayer@netcom.com (David Shayer)
  1347. Date: Wed, 3 Aug 1994 02:28:38 GMT
  1348. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1349.  
  1350. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  1351. :   (I personally have not figured out how to get the native stack crawl
  1352. : ('scp') to work. Anyone know what address you have to give it as a parameter?)
  1353.  
  1354. I've gotten SCP to work when I put in A6.  It works about as often
  1355. as SC does.  If A6 is trashed, it won't work.  Also, it tends to show
  1356. some junk stack frames, because SCP doesn't understand 68K frames
  1357. or mixed mode transition frames.
  1358.  
  1359. +------------------------------------------------------------------------+
  1360. |David Shayer                                 shayer@applelink.apple.com |
  1361. |Sentient Software / Symantec                 Applelink: SHAYER          |
  1362. |"When encryption is outlawed, only outlaws will have encryption."       |
  1363. +------------------------------------------------------------------------+
  1364.  
  1365.  
  1366. +++++++++++++++++++++++++++
  1367.  
  1368. >From h+@nada.kth.se (Jon W{tte)
  1369. Date: Wed, 03 Aug 1994 10:03:04 +0200
  1370. Organization: Royal Institute of Something or other
  1371.  
  1372. In article <31jodi$ksn@morrow.stanford.edu>,
  1373.  lipa@camis.Stanford.EDU (Bill Lipa) wrote:
  1374.  
  1375. >On 68K Macs, Macsbug made it easy to figure out where things were hanging
  1376. >and crashing by using the sc7 and sc6 commands, for example. Is there any
  1377. >equivalent on PowerMacs?
  1378.  
  1379. The Debugger by Jasik designs. It's evil, but it does the job. 
  1380. macnosy@netcom.com. Probably $300.
  1381.  
  1382. Cheers,
  1383.  
  1384.                 / h+
  1385.  
  1386. --
  1387.   Jon Wdtte
  1388.   Hagagatan 1
  1389.   113 48 Stockholm
  1390.   Sweden
  1391.  
  1392.  
  1393. +++++++++++++++++++++++++++
  1394.  
  1395. >From dshayer@netcom.com (David Shayer)
  1396. Date: Wed, 3 Aug 1994 19:39:47 GMT
  1397. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1398.  
  1399. Bruce Hoult (Bruce@hoult.actrix.gen.nz) wrote:
  1400. : mclow@san_marcos.csusm.edu (Marshall Clow) writes:
  1401. : >    There's "The Debugger", by Steve Jasik. Debugs native apps, and
  1402. : > everything else. If you can think like Steve, you're home free. :-)
  1403. : > 
  1404. : >    There's "Macintosh Debugger for Power PC", part of the Mac on Risc SDK.
  1405. : > It's a two machine debugger, and it only really does apps, and some plug-ins.
  1406. : > 
  1407. : >    There's Macsbug. There are some nifty dcmds that help you debug ppc code.
  1408.  
  1409. : So I keep hearing.  But where do you *get* them from?  I don't see them on ETO.
  1410. : I don't see them on the Mac on RISC SDK.  I don't see them on CodeWarrior/Gold.
  1411. : I don't see them on Apple's ftp sites.
  1412.  
  1413. You can buy The Debugger from Jasik Designs, (415) 322-1386.
  1414. You can buy Mac on RISC SDK from APDA, (800) 282-2732.
  1415. You can get the Macsbug dcmds free on the CD in develop #17.
  1416.  
  1417. +------------------------------------------------------------------------+
  1418. |David Shayer                                 shayer@applelink.apple.com |
  1419. |Sentient Software / Symantec                 Applelink: SHAYER          |
  1420. |"Subvert the Dominant Paradigm."                                        |
  1421. +------------------------------------------------------------------------+
  1422.  
  1423.  
  1424. +++++++++++++++++++++++++++
  1425.  
  1426. >From pchang@Xenon.Stanford.EDU (The Weasel)
  1427. Date: 3 Aug 1994 23:24:51 GMT
  1428. Organization: Computer Science Department, Stanford University.
  1429.  
  1430. In article <1994Aug2.174246.22962@gallant.apple.com>,
  1431. Jens Alfke  <jens_alfke@powertalk.apple.com> wrote:
  1432.  
  1433. >One hint I can share: I've been having trouble with jumps to 0 -- this can be
  1434. >caused by bogus RoutineDescriptors or by smashing transition vectors. It
  1435. >turns out that (at least on my Mac) the random spoodge at location 0 tends to
  1436. >look like a PPC instruction that branches to itself, thus causing an infinite
  1437. >loop. 
  1438.  
  1439. Now, if you were using the debugger it would tell you that you have an
  1440. invalid pc when you tried to jump off to nowhere land. This, however,
  1441. is only moderatley useful since tracing backwards is a huge pain in my
  1442. butt due to all of the mixed mode switches etc.
  1443.  
  1444. Peter
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450. +++++++++++++++++++++++++++
  1451.  
  1452. >From rankin@scubed.com (Tom Rankin)
  1453. Date: Wed, 3 Aug 1994 20:17:19 GMT
  1454. Organization: S-CUBED, A Division of Maxwell Laboratories
  1455.  
  1456. In article <2858750409@hoult.actrix.gen.nz>, Bruce@hoult.actrix.gen.nz (Bruce Hoult) writes:
  1457. |> mclow@san_marcos.csusm.edu (Marshall Clow) writes:
  1458. |> >    There's "Macintosh Debugger for Power PC", part of the Mac on Risc SDK.
  1459. |> > It's a two machine debugger, and it only really does apps, and some plug-ins.
  1460. |> 
  1461. |> So I keep hearing.  But where do you *get* them from?  I don't see them on ETO.
  1462. |> I don't see them on the Mac on RISC SDK.  I don't see them on CodeWarrior/Gold.
  1463. |> I don't see them on Apple's ftp sites.
  1464. |> 
  1465. |> Maybe I'm blind.  I hope so :-)
  1466.  
  1467. I've got E.T.O. 14 and the "M.D. for PowerPC" can be found in the following
  1468. folder:
  1469.  
  1470.   E.T.O.:Tools - Objects:Power Macinthosh Tools:Macintosh Debugger for PowerPC
  1471.  
  1472. Squash 'dem bugs,
  1473.  
  1474. TR
  1475.  
  1476. -- 
  1477. - ------------------------------------------------------------------------------
  1478. Tom Rankin         Maxwell Laboratories, S-CUBED Division    3398 Carmel Mtn Rd.
  1479. rankin@scubed.com             (619) 587-8394                 San Diego, CA 92121
  1480. - ------------------------------------------------------------------------------
  1481.  
  1482. +++++++++++++++++++++++++++
  1483.  
  1484. >From pchang@Xenon.Stanford.EDU (The Weasel)
  1485. Date: 4 Aug 1994 07:06:30 GMT
  1486. Organization: Computer Science Department, Stanford University.
  1487.  
  1488. In article <AA651BD8.6C50@klkmac008.nada.kth.se>,
  1489. Jon W{tte <h+@nada.kth.se> wrote:
  1490.  
  1491. >The Debugger by Jasik designs. It's evil, but it does the job. 
  1492. >macnosy@netcom.com. Probably $300.
  1493.  
  1494. $350 full price and $225 if you have CodeWarrior. Steve is in Boston
  1495. right now, but you can still call and place orders.
  1496.  
  1497. Peter 
  1498.  
  1499.  
  1500.  
  1501. +++++++++++++++++++++++++++
  1502.  
  1503. >From Brian Strull <strull@apple.com>
  1504. Date: Thu, 4 Aug 1994 00:59:42 GMT
  1505. Organization: Apple Computer, Inc.
  1506.  
  1507. Subject: Re: Debugging on PowerMacs
  1508. From: Bruce Hoult, Bruce@hoult.actrix.gen.nz
  1509. Date: Wed, 3 Aug 1994 09:20:10 +1200 (NZST)
  1510. In article <2858750409@hoult.actrix.gen.nz> Bruce Hoult,
  1511. Bruce@hoult.actrix.gen.nz writes:
  1512. >mclow@san_marcos.csusm.edu (Marshall Clow) writes:
  1513. >>    There's "The Debugger", by Steve Jasik. Debugs native apps, and
  1514. >> everything else. If you can think like Steve, you're home free. :-)
  1515. >> 
  1516. >>    There's "Macintosh Debugger for Power PC", part of the Mac on Risc
  1517. SDK.
  1518. >> It's a two machine debugger, and it only really does apps, and some
  1519. plug-ins.
  1520. >> 
  1521. >>    There's Macsbug. There are some nifty dcmds that help you debug ppc
  1522. code.
  1523. >
  1524. >So I keep hearing.  But where do you *get* them from?  I don't see them
  1525. on ETO.
  1526. >I don't see them on the Mac on RISC SDK.  I don't see them on
  1527. CodeWarrior/Gold.
  1528. >I don't see them on Apple's ftp sites.
  1529. >
  1530. >Maybe I'm blind.  I hope so :-)
  1531. >
  1532. >-- Bruce
  1533.  
  1534. Both MD for PowerPC and MacsBug are on ETO and the MoR SDK.
  1535. The Debugger is a third party product available through APDA and other
  1536. channels.
  1537.  
  1538. +++++++++++++++++++++++++++
  1539.  
  1540. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1541. Date: Sat, 6 Aug 1994 22:06:33 +1200 (NZST)
  1542. Organization: (none)
  1543.  
  1544. Brian Strull <strull@apple.com> writes:
  1545. > >>    There's "The Debugger", by Steve Jasik. Debugs native apps, and
  1546. > >> everything else. If you can think like Steve, you're home free. :-)
  1547. > >> 
  1548. > >>    There's "Macintosh Debugger for Power PC", part of the Mac on Risc SDK.
  1549. > >> It's a two machine debugger, and it only really does apps, and some plug-ins.
  1550. > >> 
  1551. > >>    There's Macsbug. There are some nifty dcmds that help you debug ppc code.
  1552. > >
  1553. > >So I keep hearing.  But where do you *get* them from?  I don't see them on ETO.
  1554. > >I don't see them on the Mac on RISC SDK.  I don't see them on CodeWarrior/Gold.
  1555. > >I don't see them on Apple's ftp sites.
  1556. > >
  1557. > >Maybe I'm blind.  I hope so :-)
  1558. > >
  1559. > > -- Bruce
  1560. > Both MD for PowerPC and MacsBug are on ETO and the MoR SDK.
  1561. > The Debugger is a third party product available through APDA and other
  1562. > channels.
  1563.  
  1564. Thanks to everyone who's answered this.
  1565.  
  1566. I guess I'm going to have to take a course in communcation skills because
  1567. everyone has told me where to get The Debugger and "Macintosh Debugger for
  1568. Power PC", which I already knew perfectly well and I was using R2DB on my
  1569. PowerBook 100 (not pleasant, trust me!) for some time until a) I got the
  1570. single machine version, and b) I got CodeWarrior.
  1571.  
  1572. What I was *really* after was the location of the MacsBug PPC dcmds :-(
  1573.  
  1574. Someone mentioned that they are on the latest develop, so I'll try to
  1575. track down a copy.  Thanks to whoever it was.
  1576.  
  1577. No thanks to Apple, though: why on *earth* are such things in a $30
  1578. magazine and *not* on a $400/year developer tool mailing, or even *gasp*
  1579. on the SDK for programming the PowerMacs.  I guess that's too logical. :-(
  1580.  
  1581. -- Bruce
  1582.  
  1583. +++++++++++++++++++++++++++
  1584.  
  1585. >From dshayer@netcom.com (David Shayer)
  1586. Date: Tue, 9 Aug 1994 05:45:03 GMT
  1587. Organization: Sentient Software
  1588.  
  1589. In article <2859055592@hoult.actrix.gen.nz>, Bruce@hoult.actrix.gen.nz
  1590. (Bruce Hoult) wrote:
  1591. > What I was *really* after was the location of the MacsBug PPC dcmds :-(
  1592.    They are on develop 17.
  1593.  
  1594. However, the current issue of develop is 19.
  1595.  
  1596. -- Marshall Clow
  1597. mclow@san_marcos.csusm.edu
  1598. (Hiding out on David's account)
  1599.  
  1600. ---------------------------
  1601.  
  1602. >From dennis@mr2.ece.cmu.edu (Dennis J. Ciplickas)
  1603. Subject: Guide for writing programs for both PowerPC and 680x0? etc...
  1604. Date: 08 Aug 1994 13:13:39 GMT
  1605. Organization: Electrical and Computer Engineering, Carnegie Mellon
  1606.  
  1607.  
  1608. Hiya,
  1609.  
  1610. No snide comments please, but I've yet to learn how to adjust my
  1611. Macintosh coding style to work for both the 68000 and the PowerPC.  I
  1612. am aware the code warrior is the approved compiler for the PowerPC.
  1613. Can anyone point me to books or CDs that tell me what differences
  1614. there are from the programmer's perspective and what the "approved"
  1615. techniques are for dealing with them?
  1616.  
  1617. I am very familiar with the X-window's style architecture-adaptable
  1618. source tree technique a la "imake."  Is anyone using anything like
  1619. this on the Mac?  I have heard that code warrior does not use standard
  1620. makefiles, but can somehow be kludged into working with them.  I rely
  1621. on recursive makefiles to build groups of related source code.  Will I
  1622. be able to implement this in code warrior without too much pain?
  1623.  
  1624. Looking forward to being native on both processors,
  1625. Dennis
  1626.  
  1627. +++++++++++++++++++++++++++
  1628.  
  1629. >From sbryan@maroon.tc.umn.edu (Steve Bryan)
  1630. Date: Mon, 8 Aug 1994 15:11:23 GMT
  1631. Organization: Sexton Software
  1632.  
  1633. In article <DENNIS.94Aug8091339@mr2.ece.cmu.edu>, dennis@mr2.ece.cmu.edu
  1634. (Dennis J. Ciplickas) wrote:
  1635.  
  1636. > Hiya,
  1637. > No snide comments please, but I've yet to learn how to adjust my
  1638. > Macintosh coding style to work for both the 68000 and the PowerPC. ...
  1639.  
  1640. The Macintosh toolbox remains largely the same from either type of
  1641. machine. Apple's strategy has been to provide a new set of headers files
  1642. (for C) and interface files (for Pascal) which are called universal
  1643. headers files that are intended to work whether they are used to compile
  1644. to 68K code or PPC code. If you follow some of the threads in this
  1645. newsgroup it appears some may have even automated their build process to
  1646. produce the fat binary result froma single set of source files. Anyhow I
  1647. believe the short answer to your question is that the universal header
  1648. files should provide compatibility with either type of output (68K or
  1649. PPC).
  1650.  
  1651. -- 
  1652. Steve Bryan                Internet: sbryan@maroon.tc.umn.edu
  1653. Sexton Software          CompuServe: 76545,527
  1654. Minneapolis, MN 55415           Fax: (612) 929-1799
  1655.  
  1656. +++++++++++++++++++++++++++
  1657.  
  1658. >From jwbaxter@olympus.net (John W. Baxter)
  1659. Date: Mon, 08 Aug 1994 09:48:51 -0700
  1660. Organization: Internet for the Olympic Peninsula
  1661.  
  1662. In article <DENNIS.94Aug8091339@mr2.ece.cmu.edu>, dennis@mr2.ece.cmu.edu
  1663. (Dennis J. Ciplickas) wrote:
  1664.  
  1665. > Hiya,
  1666. > No snide comments please, but I've yet to learn how to adjust my
  1667. > Macintosh coding style to work for both the 68000 and the PowerPC.  I
  1668. > am aware the code warrior is the approved compiler for the PowerPC.
  1669. > Can anyone point me to books or CDs that tell me what differences
  1670. > there are from the programmer's perspective and what the "approved"
  1671. > techniques are for dealing with them?
  1672.  
  1673. A Power Macintosh is a Macintosh.  I haven't yet had to do anything other
  1674. than make adjustments to floating point number format, which differs among
  1675. three forms of Mac (68K without hardware floating point, 68K with hardware
  1676. floating point, and PPC).  Most of that can, for real programs, be fixed
  1677. by using the types float_t and double_t for computation, and either float
  1678. or double (setting options for the 8-byte double) for external storage. 
  1679. There's a little extra code to put a double into the 10-byte format some
  1680. programs insist on in an Apple event parameter.
  1681.  
  1682. I haven't yet had to resort to different source files for 68K vs PPC [I
  1683. did all the assembler coding I ever want to do between 1958 and 1980 or
  1684. so]...a few (ugh!) #if things are sufficient.
  1685.  
  1686.    --John
  1687.  
  1688. -- 
  1689. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1690.    "Occasionally...astronomers add a second to either June 31 or
  1691.     December 31..."   IM: OS Utilities, p 4-12
  1692.    jwbaxter@pt.olympus.net
  1693.  
  1694. +++++++++++++++++++++++++++
  1695.  
  1696. >From avirr@well.sf.ca.us (Avi Rappoport)
  1697. Date: 9 Aug 1994 17:52:35 GMT
  1698. Organization: The Whole Earth 'Lectronic Link, Sausalito, CA
  1699.  
  1700. >In article <DENNIS.94Aug8091339@mr2.ece.cmu.edu>, dennis@mr2.ece.cmu.edu
  1701. >(Dennis J. Ciplickas) wrote:
  1702.  
  1703. >> Hiya,
  1704. >> 
  1705. >> No snide comments please, but I've yet to learn how to adjust my
  1706. >> Macintosh coding style to work for both the 68000 and the PowerPC.  I
  1707. >> am aware the code warrior is the approved compiler for the PowerPC.
  1708. >> Can anyone point me to books or CDs that tell me what differences
  1709. >> there are from the programmer's perspective and what the "approved"
  1710. >> techniques are for dealing with them?
  1711.  
  1712. I wouldn't say we are "approved" but CodeWarrior is rather speedy on 
  1713. the PowerPC (and the 68K for that matter :-).
  1714.  
  1715. In general, it's pretty easy to port.  You do have to watch out for 
  1716. callbacks from system routines (usually found in dialogs and Apple Event 
  1717. support).  Use the new Universal Headers from Apple (they come with 
  1718. CodeWarrior) and follow the UPP rules -- works fine on both 68K and PPC.
  1719.   
  1720. Good sources include "Inside Macintosh: PowerPC System Software" (Addison 
  1721. Wesley), "Power Macintosh Programming Starter Kit" by Tom Thompson, and 
  1722. "Simple Porting to the Power Mac" by Chris Forden in MacTech Magazine, 
  1723. May 1994 (p. 64-71).
  1724.  
  1725. I'd also find the archives for this group -- there are lots of answers 
  1726. that have already been given.
  1727.  
  1728. -- 
  1729. Avi Rappoport                        
  1730. Technical Analyst
  1731. Metrowerks, Inc.
  1732. Please reply to: avirr@metrowerks.com  avirr@aol.com  avirr@eworld.com
  1733.  
  1734. ---------------------------
  1735.  
  1736. >From v_giles@ccuma.uma.es (Vicente Giles)
  1737. Subject: HFSDispatch Trap. Success
  1738. Date: Wed, 17 Aug 1994 10:43:12 -0800
  1739. Organization: Uniersidad de Malaga
  1740.  
  1741. Hi,
  1742.  
  1743. Some time ago, I posted some code asking for help with a patch to HFSDispatch.
  1744. The problem was the patch worked ok without File Sharing and didn4t work
  1745. when File Sharing was on.
  1746.  
  1747. With some people pointing me to the problems File Sharing was causing, I was
  1748. able to correct the code and have it working properly (as far as I4ve tested).
  1749.  
  1750. This is to thank everybody who answered (special thanks to Larry Rosenstein
  1751. and Pete Gontier) and to made available my code, just in case anybody else
  1752. is interested. Anyway, I made no warranty about it and usual disclaimers
  1753. should be applicable. Use at your own risk, ...
  1754.  
  1755.  
  1756. By the way, I rewrote most of it not to use Asm, but as much C as
  1757. possible instead :). Here4s the code (Symantec C 7.03, Monaco 9, tabs = 4):
  1758.  
  1759. //
  1760.  
  1761. OSErr    ourHFSDispatch (  CInfoPBPtr pbptr )
  1762. {
  1763.     short                selector;
  1764.     CInfoPBPtr            ourPB;
  1765.     OSErr                result;
  1766.     long                oldHFSDispatch;
  1767.     ConstStr31Param     fileName;
  1768.     Boolean                weCanTouch;
  1769.     
  1770.     asm {             
  1771.             move.w        d0, selector    ;; save parameters    
  1772.             move.l        a0, ourPB
  1773.             
  1774.     ;; Get our globals. We are not using Symantec4s SetupA4()/RestoreA4()
  1775.     ;; so you MUST use a custom header (Set Proyect Type...). main needs 
  1776.     ;; to be on the top of the compiled code, not Symantec's header, for 
  1777.     ;; this to work
  1778.     ;;         Str255    gFileName = "\pTest File";
  1779.     ;;        long     gOldHFSDispatch;
  1780.         
  1781.             movem.l        a3-a4, -(sp)
  1782.             lea            main, a4        
  1783.             move.l        gOldHFSDispatch, oldHFSDispatch
  1784.             lea            gFileName,  a3 
  1785.             move.l        a3, fileName
  1786.             movem.l        (sp)+, a3-a4
  1787.         }
  1788.     
  1789.     weCanTouch = (selector == 9) && isFinder();
  1790.     
  1791.     asm {                                ; call original trap
  1792.             move.w        selector, d0
  1793.             move.l        ourPB, a0
  1794.             move.l        oldHFSDispatch, a1
  1795.             jsr            (a1)
  1796.             move.l        a0, ourPB
  1797.             move.w        d0, result
  1798.         }    
  1799.     
  1800.     
  1801. //
  1802. //
  1803. //
  1804. //
  1805. //
  1806. error)
  1807. //
  1808.  
  1809. // I avoid the file name comparison till this point. If you do it before the
  1810. // call returns, you get the name of the previous file, when indexing
  1811. // thru the directory, in ioNameptr, so it fools the Finder with the file
  1812. // after the one we are interested in.
  1813.     
  1814.     // You can do what you like here. For example...
  1815.     if ( ourPB->hFileInfo.ioResult == 0 && weCanTouch
  1816.                 && compareNames(fileName, ourPB->hFileInfo.ioNamePtr ) ) {
  1817.         ourPB->hFileInfo.ioFlLgLen = 0x0800;
  1818.         ourPB->hFileInfo.ioFlPyLen = 0x0800;
  1819.         ourPB->hFileInfo.ioFlRLgLen = 0x0800;
  1820.         ourPB->hFileInfo.ioFlRPyLen = 0x0800;        
  1821.         }
  1822.         
  1823.     return result;
  1824. }
  1825.  
  1826. // This two next functions need to be interrupt safe, because of File Sharing
  1827. // reissuing synchronous calls as asynchronous
  1828.  
  1829. //
  1830. /// Finder is the current process ?? (quick and dirty way)
  1831.  
  1832. Boolean isFinder ( void )
  1833. {
  1834.     asm {
  1835.                 move.l        0x0910, d0        ; CurApName
  1836.                 cmp.l        #0x0646696E, d0    
  1837.                 bne.s        @end
  1838.                 move.w        #1, d0
  1839.                 rts
  1840.             @end
  1841.                 clr.w        d0                ; return false
  1842.                 rts
  1843.         }
  1844. }
  1845.  
  1846.  
  1847. //
  1848. /// Compare both file names. Returns true if they are equal. Shorter to write
  1849. // if it was to return false when equal :)
  1850.  
  1851. Boolean compareNames ( ConstStr31Param s1, ConstStr31Param s2 )
  1852. {    
  1853. asm {
  1854.             movem.l        a0-a1/d1, -(sp)
  1855.             
  1856.             move.l        s1, a1    
  1857.             move.l        s2, a0
  1858.             clr.l        d1                    ; avoid garbage
  1859.             move.b        (a0), d1            ; length of file name            
  1860.         @compare
  1861.             move.b        (a0)+, d0
  1862.             sub.b        (a1)+, d0
  1863.             tst.b        d0
  1864.             bne.s        @different        
  1865.             dbra        d1, @compare
  1866.             
  1867.         ; if we are here, d0 == 0, so both are equal. We must return true
  1868.             move.w        #1, d0
  1869.             bra.s        @end
  1870.             
  1871.         @different
  1872.             clr.w        d0                    ; false
  1873.         @end
  1874.             movem.l        (sp)+, a0-a1/d1
  1875.         }
  1876. }
  1877.  
  1878.  
  1879.    Vicente Giles Duran
  1880.    Servicio Central de Informatica
  1881.    Universidad de Malaga
  1882.    Campus de Teatinos
  1883.    v_giles@ccuma.sci.uma.es
  1884.  
  1885. -- 
  1886. Vicente Giles               |
  1887. Universidad de Malaga.      |   Favourite drink:
  1888. Spain.                      |      Bacardi += Coke;
  1889.  
  1890. ---------------------------
  1891.  
  1892. >From taihou@iss.nus.sg (Tng Tai Hou)
  1893. Subject: MPW PPCC funnies ...
  1894. Date: 10 Aug 1994 17:30:26 +0800
  1895. Organization: Institute Of Systems Science, NUS
  1896.  
  1897. I ran the latest MPW from the Mac on RISC SDK final release and
  1898. encountered two funnies which one wouldn't normally expect:
  1899.  
  1900. 1.  '\r' is not ascii code 13 but 10. Is this normal? How
  1901.     should one write code which requires comparisons
  1902.     of '\r', '\t', '\n' etc if they are not the same across
  1903.     platforms (unix, dos, mac, vax etc), and not even the same
  1904.     across compilers within the same platform. Codewarrior
  1905.     works maps '\r' to ascii value 13 but MPW maps to ascii 10!!!
  1906.  
  1907. 2.    fopen and a subsequent fclose leaves a memory leak!!! Can
  1908.     anyone varify this? I trace down a memory leak to an
  1909.     fopen, two sucessfull unleaking fprintfs, and fclose, upon
  1910.     which the memory leak was immediately detected.
  1911.  
  1912. I ran the compiler on a 8100 with loads of ram.
  1913.  
  1914. Please, can anyone comment on these points?
  1915.  
  1916. Thanks.
  1917.  
  1918.  
  1919. Tai Hou TNG
  1920. Singapore
  1921.  
  1922. +++++++++++++++++++++++++++
  1923.  
  1924. >From neeri@iis.ee.ethz.ch (Matthias Neeracher)
  1925. Date: 11 Aug 1994 09:01:34 GMT
  1926. Organization: Integrated Systems Laboratory, ETH, Zurich
  1927.  
  1928. In article <32a6ni$2bb@bugs.iss.nus.sg>, taihou@iss.nus.sg (Tng Tai Hou) writes:
  1929. > I ran the latest MPW from the Mac on RISC SDK final release and
  1930. > encountered two funnies which one wouldn't normally expect:
  1931.  
  1932. > 1.  '\r' is not ascii code 13 but 10. Is this normal? How
  1933. >     should one write code which requires comparisons
  1934. >     of '\r', '\t', '\n' etc if they are not the same across
  1935. >     platforms (unix, dos, mac, vax etc), and not even the same
  1936. >     across compilers within the same platform. Codewarrior
  1937. >     works maps '\r' to ascii value 13 but MPW maps to ascii 10!!!
  1938.  
  1939. I wrote about this about a month ago, and nobody challenged me on it, so here
  1940. goes again:
  1941.  
  1942. What I read (in ANSI X3.159-1989, section 2.2.2, _Character Display Semantics_)
  1943. is that:
  1944.  
  1945. - \n "Moves the active position to the initial position of the next line".
  1946. - \r "Moves the active position to the initial position of the current line".
  1947. - \n and \r "shall produce a unique implementation-defined value which can
  1948.   be stored in a single char object. The external representations in a text
  1949.   file need not be identical to the internal representations, and are outside
  1950.   the scope of this standard".
  1951. - This means that all you can rely on is that '\n' and '\r' produce different
  1952.   values and that you will get a newline if you write "\n" to a display device.
  1953.   You can't rely on '\n' meaning any particular character value either in
  1954.   memory or on disk.
  1955.  
  1956. Think C and (by default) CodeWarrior represent '\n' internally as 0x0A and
  1957. read/write it as 0x0D, but MPW C (optionally) CodeWarrior represent
  1958. '\n' as 0x0D. From the above passage, I believe that both variants are legit.
  1959.  
  1960. To make it short: If you want to look for character 13, compare with 13, if you
  1961. want to look for newline, compare with '\n'.
  1962.  
  1963. Matthias
  1964.  
  1965. - ---
  1966. Matthias Neeracher <neeri@iis.ee.ethz.ch> http://err.ethz.ch/members/neeri.html
  1967.    "Omne animal triste est post (or without) coitum"  -- Umberto Eco
  1968.  
  1969. ---------------------------
  1970.  
  1971. >From Ed_Estes@pol.com (Ed Estes)
  1972. Subject: Opening the Apple CD ROM Tray.
  1973. Date: 09 Aug 1994 09:52:44 -0500
  1974. Organization: (none)
  1975.  
  1976. Greetings.
  1977.  
  1978. I am involved with a project that will be publishing several Compact Discs
  1979. containing multimedia data. We've discovered some users find it difficult to
  1980. open Apple's Newer CD Drive's tray because they think they've pressed the
  1981. button on the front of the drive hard enough when they haven't.  We'd like to
  1982. eliminate the need to press the button on the newer drives if possible.  Is
  1983. there a driver call we can make that will open the tray to these drives when
  1984. we need a particular disc, or can they only be opened by depressing the
  1985. hardware button on the front?
  1986.  
  1987. TIA.
  1988.  
  1989. --Ed
  1990.  
  1991. Ed_Estes@pol.com
  1992.  
  1993.  
  1994. +++++++++++++++++++++++++++
  1995.  
  1996. >From k044477@hobbes.kzoo.edu (Jamie McCarthy)
  1997. Date: Tue, 09 Aug 1994 16:08:26 -0400
  1998. Organization: University of Michigan
  1999.  
  2000. Ed_Estes@pol.com wrote:
  2001.  
  2002. > Is
  2003. > there a driver call we can make that will open the tray to these
  2004. > [CD-ROM] drives when we need a particular disc, or can they only
  2005. > be opened by depressing the hardware button on the front?
  2006.  
  2007. I just stepped over to our LC 575, put a CD in, set an a-trap on
  2008. _Eject, and dragged the CD to the trash.  Tracing over the _Eject
  2009. reveals that it and it alone is responsible for opening the tray.
  2010.  
  2011. If you want to open it without a disc _already_ in the drive, I'm
  2012. not so sure how I'd go about that.  Here's some very old code of
  2013. mine that ejects any disks that may be in the floppy drives:
  2014.  
  2015. for (driveNum = 1; driveNum<3; driveNum++) {
  2016.   theOSErr = GetVInfo(driveNum, volName, &vRefNum, &freeBytes);
  2017.   if (theOSErr == noErr) {
  2018.       /* Physically eject the disk from the drive */
  2019.     theOSErr = FlushVol(NULL, vRefNum);
  2020.     theOSErr = Eject(NULL, vRefNum);
  2021.   }
  2022. }
  2023.  
  2024. This is really skainchy of me;  you can count on drive 1 being the
  2025. internal floppy, but everything else is up for grabs.  2 will usually
  2026. be the external floppy, 3 and up usually hard drives, but there are
  2027. no guarantees.  What the hell -- try looping from 2 to 100, you
  2028. might eject the CD-ROM tray...along with every SyQuest and optical
  2029. drive the user also happens to have hooked up...  :-)
  2030. -- 
  2031.  Jamie McCarthy   Internet: k044477@hobbes.kzoo.edu   AppleLink: j.mccarthy
  2032.  I speak for no one but myself.
  2033.  
  2034. +++++++++++++++++++++++++++
  2035.  
  2036. >From Glenn R. Howes <grhowes@students.wisc.edu>
  2037. Date: 9 Aug 1994 22:45:37 GMT
  2038. Organization: UW-Chemistry
  2039.  
  2040. Subject: Re: Opening the Apple CD ROM Tray.
  2041. From: Jamie McCarthy, k044477@hobbes.kzoo.edu
  2042. Date: Tue, 09 Aug 1994 16:08:26 -0400
  2043.  
  2044. In article <k044477-0908941608260001@via.kz.merit.edu> Jamie McCarthy,
  2045. k044477@hobbes.kzoo.edu writes:
  2046. >Ed_Estes@pol.com wrote:
  2047. ...
  2048. >This is really skainchy of me;  you can count on drive 1 being the
  2049. >internal floppy, but everything else is up for grabs.  2 will usually
  2050. >be the external floppy, 3 and up usually hard drives, but there are
  2051. >no guarantees.  What the hell -- try looping from 2 to 100, you
  2052. >might eject the CD-ROM tray...along with every SyQuest and optical
  2053. >drive the user also happens to have hooked up...  :-)
  2054.  
  2055. The following works at finding and ejecting the CD. I haven't tried to
  2056. find out if it works for empty drives. I got the info for this code
  2057. from a variety of places. There is a driver tech note on managing
  2058. audio cd's, and some of this came from there.
  2059.  
  2060.  
  2061. #define AUDIO_NAME    "\p.AppleCD"
  2062. #define dRAMBased        0x0040
  2063. #define gestaltAudioCD    'aucd'
  2064. // after finding the refNum for the CD drive call this
  2065. // to eject it.
  2066. OSErr EjectTheDrive(short refNum)
  2067. {
  2068.     OSErr             myErr;
  2069.     Str63            volName;
  2070.     HParamBlockRec    vParam; 
  2071.     
  2072.     vParam.volumeParam.ioNamePtr = (StringPtr)&volName;
  2073.     vParam.volumeParam.ioCompletion = 0L;
  2074.     vParam.volumeParam.ioVolIndex = 0;
  2075.     do
  2076.     {
  2077.         vParam.volumeParam.ioVolIndex++;
  2078.         myErr = PBHGetVInfo(&vParam, false);
  2079.         if (!myErr && vParam.volumeParam.ioVDRefNum == refNum)
  2080.         {
  2081.             myErr = PBEject((ParmBlkPtr)&vParam);
  2082.             if(!myErr)
  2083.                 myErr = PBUnmountVol((ParmBlkPtr)&vParam);
  2084.             break;
  2085.         }
  2086.     }while(!myErr);
  2087.     return (myErr);
  2088. }
  2089.  
  2090. // routine to find the reference number for the nth audio drive on
  2091. // the SCSI bus, usually you would have drive =1, driverName = "\pAppleCD"
  2092. OSErr FindAudioDrive(Str63 driverName, short drive, short *refNum)
  2093. {
  2094.     
  2095.     Byte        cdFlag;
  2096.     int            i;
  2097.     short         driveNum = 0, shiftBits = 1;
  2098.     *refNum = 0;
  2099.     cdFlag = WhereCDs(driverName);
  2100.     
  2101.     if (!HasAudioCD() || cdFlag == 0)
  2102.     {
  2103.         return (-1);
  2104.     }
  2105.     if (drive < 1 || drive > 7)
  2106.     {
  2107.         return (-1);
  2108.     }
  2109.     for (i = 0; i<7;i++)
  2110.     {
  2111.         if (cdFlag & shiftBits)
  2112.         {
  2113.             driveNum++;
  2114.             if (driveNum == drive)
  2115.             {
  2116.                 *refNum = -33 - i;
  2117.                 return (noErr);
  2118.             }
  2119.         }
  2120.         shiftBits <<= 1;
  2121.     }
  2122.     return(-1);
  2123. }
  2124. Byte WhereCDs(Str63 appleDriverName)
  2125. {
  2126.   unsigned         char where = 0;    /* assume no drives handled at beginning
  2127. */
  2128.   short         scsiAddress;
  2129.   short         drvrRefNum;
  2130.   DCtlHandle    aDCtlEntry;
  2131.   StringPtr       aDriverName;
  2132.   
  2133.   for (scsiAddress = 0; scsiAddress < 7; scsiAddress++) 
  2134.   {
  2135.     drvrRefNum = -33 - scsiAddress;
  2136.     aDCtlEntry = GetDCtlEntry(drvrRefNum);
  2137.     if (aDCtlEntry != nil) 
  2138.     {
  2139.       if ((**aDCtlEntry).dCtlFlags & dRAMBased)
  2140.       {
  2141.         aDriverName = (StringPtr) ((*(DCtlPtr)aDCtlEntry).dCtlDriver+18);
  2142.       }
  2143.       else
  2144.       {
  2145.         aDriverName = (StringPtr)((**aDCtlEntry).dCtlDriver+18);
  2146.       }
  2147.       if ( PascalCompare(aDriverName, &appleDriverName[0]) == true )
  2148.       {
  2149.             where |= (1 << scsiAddress);
  2150.       }
  2151.     }
  2152.   }
  2153.   return where;
  2154. }
  2155. Boolean HasAudioCD(void)
  2156. {
  2157.     OSErr            err;
  2158.     long            result;
  2159.     
  2160.     err = Gestalt(gestaltAudioCD, &result);
  2161.     if ((err != noErr) || !(result))
  2162.         return FALSE;
  2163.     else
  2164.         return TRUE;
  2165. }
  2166. Boolean PascalCompare(Byte *one, Byte *two)
  2167. {
  2168.     short    length;
  2169.     length = *two+1;
  2170.     if (*one != *two) return (false);
  2171.     while (length --)
  2172.         if (*one++ != *two++) return (false);
  2173.     return (true);
  2174. }
  2175.  
  2176. ---------------------------
  2177.  
  2178. >From marshall@cais.com (Preston Marshall)
  2179. Subject: PPC CDK User Comments
  2180. Date: 11 Aug 1994 14:01:12 GMT
  2181. Organization: Vanguard Research, Inc.
  2182.  
  2183. This is a list of comments and suggestions I have collected for converting
  2184. Symantec projects to the CDK environment.  Little of the content is
  2185. original, but I hoped that by collecting all of the "hints" in one place,
  2186. the process can be made easier for all.  BTW, I have no association with
  2187. Symantec.
  2188.  
  2189. Much of the input has been provided by Tom Emerson
  2190. (tree@bedford.symantec.com) of Symantec's Development Tools Group, who has
  2191. answered dozens of E-mail inquiries from me.  If CDK users would E-mail me
  2192. input to this list, I will consolidate it and repost it, as required.  I
  2193. have not included any of the material available on the Symantec 7.0.4
  2194. release, so obtain that distribution before using any of these
  2195. suggestions.  Support for the CDK is available by sending mail to
  2196. powermac@bedford.symantec.com.
  2197.  
  2198.  
  2199. Preston Marshall    Internet:  marshall@cais.com
  2200.  
  2201. For those who E-mailed me, I will put together a mailing list and
  2202. distribute this list directly as soon as I c an get to it.  
  2203.  
  2204. The list is organized into the following topic areas:
  2205.  
  2206.    TCL Changes
  2207.    Library and Include Changes
  2208.    PPCLink and Scripts
  2209.    Others
  2210. - ---------------------------------------------------------------------------------------------------
  2211. I. TCL Changes
  2212. - -------------------------------------------------------------
  2213.  
  2214. This is a bug in the handling of .o files inside the TPM.  If your source
  2215. file name with the .o appended exceeds the legal size, you will get an
  2216. error with a incorrect name.  You need to shorted long (29 char or more)
  2217. file names
  2218.  
  2219. >From Tom Emerson --
  2220.  
  2221.  CtoPstr and PtoCstr aren't supported on the PowerPC - you should use
  2222. c2pstr and p2cstr instead: the 68K libraries have been updated to include
  2223. glue for these so your code will work without further modification for both
  2224. runtime systems.  ... you could always define a macro in your
  2225. prefix:
  2226.  
  2227.    #define PtoCstr(x) p2cstr((x))
  2228.    #define CtoPstr(x) c2pstr((x))
  2229.  
  2230. TrapAvailable is a TCL function which is completely conditionalized out. 
  2231. Evidently Apple has this in their libraries, while we don't. To work
  2232. around this I modified its definition in the TCL sources as follows: I
  2233. moved the conditionalization inside the {}s of the function, and added a
  2234. #else clause containing
  2235.  
  2236.         return true;
  2237.  
  2238. This will work since all the places that it is used inside the TCL result
  2239. in a true return value. This should work until we come up with a better
  2240. solution.
  2241.  
  2242.  
  2243. II.   Library and Include Changes
  2244. - -------------------------------------------------------------
  2245.  
  2246. I had problems resolving some ansi character utilities and __setjmp.  The
  2247. problem is the 7.0.4 patch does not include have some of the modified
  2248. headers.  The changed headers check whether you are using apple's or
  2249. Symantec's libraries before redefining symbols, such as setjmp.  The disk
  2250. release includes the files.  Ignore the instructions and update your
  2251. libraries, even if you have installed the on-line patch.  I'm not sure of
  2252. the legaliity of my including them here, so I didn't.
  2253.  
  2254. To get the disks, end mail to:
  2255. powermac@bedford.symantec.com 
  2256. with name and snailmail address  The disk also contains the native
  2257. compilers and the sources to the libraries.
  2258.  
  2259. The headers should be available on-line RSN, I am told.
  2260.  
  2261. III   PPCLink and Scripts
  2262. - -------------------------------------------------------------
  2263. You probably don't want to hear this, but when linking a large (500+file)
  2264. TCL 2.0 based application I give it (PPCLink)  25MB - any less and it
  2265. dies. (Tom Emerson)
  2266.  
  2267. The .ts script must be at the project file level of the project folder. 
  2268. It can not be within a folder. 
  2269.  
  2270. PPCLink should be used with the -mf option, which will allow it to use
  2271. non-contiguous memory.  There is disagreement on whether the TOOLSERVER
  2272. size should then be reduced to  2 meg.  I tried it, and still got link
  2273. errors reporting that it could not find enough contiguous memory.  When I
  2274. gave it large (40 megs) assignment directly, it linked fine.  
  2275.  
  2276.  
  2277. IV Others
  2278. - -------------------------------------------------------------
  2279.  
  2280. I misinterpreted the Readme stuff with 7.0.4 and removed the Quickdraw
  2281. init.  The proper treatment is:
  2282.  
  2283. The libraries don't initialize Quickdraw, they define the global
  2284. QDGlobals so you don't have to. Previously you had to declare the global
  2285.  
  2286.         QDGlobals       qd;
  2287.  
  2288. (Quickdraw.h declares this as an extern.) Now this is declared in the
  2289. libraries so you don't have to think about it.  (Tom Emerson)
  2290.  
  2291. -- 
  2292. ___________________________________________________________________
  2293. |     Preston Marshall           -       marshall@cais.com        |
  2294. |     Vanguard Research, Inc.    -                                |
  2295. |     10306 Eaton Pl.            -       The opinions are mine,   |
  2296. |     Farifax, Va 22111          -       my employer doesn't care |
  2297. ___________________________________________________________________
  2298.  
  2299. ---------------------------
  2300.  
  2301. >From laurent@pop3.demon.co.uk (Laurent Humbert)
  2302. Subject: Problem with FSRead-WriteNoCache
  2303. Date: Sun, 31 Jul 1994 19:54:14 GMT
  2304. Organization: SW15 Software
  2305.  
  2306. I modified my application to call FSWrite/ReadNoCache, from Apple's
  2307. MoreFile package, but after running some tests, I can't see any difference.
  2308. Does it really bypass the cache ?
  2309.  
  2310. Basically, my application sometimes needs to execute a very intensive
  2311. read/write loop. Between each file access, I call my SpinBeachBallCursor
  2312. function, but I noticed that if the Disk Cache Size (as set in the Memory
  2313. control panel), is big, then after a while, the cursor can stop spinning
  2314. for several long seconds, time for the cache to get written to disk, I
  2315. assume. This is very annoying as it really looks as if my program crashed.
  2316.  
  2317. Calling FlushVol is obviously not a solution as it would slow things down,
  2318. and I don't really want to install a VBL to spin the cursor.
  2319.  
  2320. Any ideas ?
  2321.  
  2322. Cheers,
  2323.  
  2324. Laurent Humbert
  2325. laurent@pop3.demon.co.uk
  2326.  
  2327. __
  2328.  
  2329. +++++++++++++++++++++++++++
  2330.  
  2331. >From jumplong@aol.com (Jump Long)
  2332. Date: 1 Aug 1994 01:49:03 -0400
  2333. Organization: America Online, Inc. (1-800-827-6364)
  2334.  
  2335. In article <AA61B1E6.C3B9@humbert.demon.co.uk>, laurent@pop3.demon.co.uk
  2336. (Laurent Humbert) writes:
  2337.  
  2338. >I modified my application to call FSWrite/ReadNoCache, from Apple's
  2339. >MoreFile package, but after running some tests, I can't see any
  2340. difference.
  2341. >Does it really bypass the cache ?
  2342.  
  2343. Since I wrote that code, I guess I should answer this question...
  2344.  
  2345. The noCache bit is really mis-named. It's real name should be the
  2346. pleaseDontCache bit. The particular file system that handles the Read or
  2347. Write request may ignore the bit in some or all cases.
  2348.  
  2349. What good is it then?  It is your only way to tell the file system that
  2350. you'd just as soon not have the data cached and in many cases, your
  2351. request for no caching *is* taken.
  2352.  
  2353. In your case, you're probably using an HFS volume so you need to know what
  2354. the HFS file system does with the noCache bit. HFS respects the noCache
  2355. bit on any block-aligned I/O.  However, since HFS uses block disk devices,
  2356. it must perform all reads and writes to the driver in 512-byte blocks. If
  2357. *your* requests to the File Manager are not block aligned, then HFS will
  2358. use cache blocks as temporary buffers when it needs to read or write a
  2359. partial block.
  2360.  
  2361. For example, let's say you write 2048 bytes to a file starting at offset
  2362. 10 into the file.  The file system first needs to modify the last 502
  2363. bytes of the file's first block so it *reads* the block into a cache
  2364. buffer, modifies the last 502 bytes of the cache buffer with your data,
  2365. and then marks that cache buffer "dirty" so it will be flushed with the
  2366. next file or volume flush.  Then the file system needs to write 2 full
  2367. blocks to the disk. If you've set the noCache bit, the file system writes
  2368. those full blocks directly to disk bypassing the cache.  Next, the file
  2369. system needs to modify the first 10 bytes of the 4th block of the file, so
  2370. it reads that block into a cache buffer, modifies the first 10 bytes of
  2371. the cache buffer, and then marks that cache buffer "dirty".  Notice,
  2372. that's 2 reads (unless the blocks are already in the cache), 1 or more
  2373. writes directly to the disk driver, and 2 deferred writes to the disk
  2374. driver (when the cached blocks are flushed) for your one write request to
  2375. the File Manager.
  2376.  
  2377. So, what can you do if you want to keep your file data out of the File
  2378. System cache?  Use the noCache bit so that block aligned I/O won't be
  2379. cached and (you guessed it), make all of your file I/O in multiples of
  2380. 512-bytes starting at a 512-byte boundary in the file (0, 512, 1024,
  2381. etc.).
  2382.  
  2383. One other thing, the larger you make your I/O operations, the better
  2384. performance you'll get.  I'm working on a Tech Note where I'll try to
  2385. explain all of this much more concisely than I did here.
  2386.  
  2387. - Jim Luther
  2388.  
  2389.  
  2390. +++++++++++++++++++++++++++
  2391.  
  2392. >From laurent@pop3.demon.co.uk (Laurent Humbert)
  2393. Date: Tue, 2 Aug 1994 00:49:24 GMT
  2394. Organization: SW15 Software
  2395.  
  2396. In article <31i2cf$flf@search01.news.aol.com>,
  2397.  jumplong@aol.com (Jump Long) wrote:
  2398.  
  2399. >In your case, you're probably using an HFS volume so you need to know what
  2400. >the HFS file system does with the noCache bit. HFS respects the noCache
  2401. >bit on any block-aligned I/O.  However, since HFS uses block disk devices,
  2402. >it must perform all reads and writes to the driver in 512-byte blocks. If
  2403. >*your* requests to the File Manager are not block aligned, then HFS will
  2404. >use cache blocks as temporary buffers when it needs to read or write a
  2405. >partial block.
  2406.  
  2407. [example]
  2408.  
  2409. >So, what can you do if you want to keep your file data out of the File
  2410. >System cache?  Use the noCache bit so that block aligned I/O won't be
  2411. >cached and (you guessed it), make all of your file I/O in multiples of
  2412. >512-bytes starting at a 512-byte boundary in the file (0, 512, 1024,
  2413. >etc.).
  2414.  
  2415. Thanks a lot for the explanation. That' all new to me. Your tech note will
  2416. sure be welcome.
  2417.  
  2418. No wonder FSWriteNoCache doesn't seem to work in my application: I have an
  2419. index table loaded in memory that allows my program to read and write an
  2420. absolute minimum number of bytes, the problem being that sometimes the user
  2421. might want to do some kind of batch operation and hundreds/thousands of
  2422. records have to be updated to disk, typically changing only one _bit_ per
  2423. record.
  2424.  
  2425. I'll have to think about it. Maybe in my loops I can also make a call to
  2426. FlushVol from time to time so that the beachball cursor doesn't seem to
  2427. freeze if the System is configured with a big Disk Cache.  Or maybe it's
  2428. time to make a few more things backgroundable in my program :)
  2429.  
  2430. Cheers,
  2431.  
  2432. Laurent Humbert
  2433. laurent@pop3.demon.co.uk
  2434.  
  2435.  
  2436.  
  2437.  
  2438. +++++++++++++++++++++++++++
  2439.  
  2440. >From Cameron Esfahani <dirty@apple.com>
  2441. Date: Mon, 1 Aug 1994 06:17:30 GMT
  2442. Organization: Apple Computer, Inc.
  2443.  
  2444. In article <AA61B1E6.C3B9@humbert.demon.co.uk> Laurent Humbert,
  2445. laurent@pop3.demon.co.uk writes:
  2446. > I modified my application to call FSWrite/ReadNoCache, from Apple's
  2447. > MoreFile package, but after running some tests, I can't see any difference.
  2448. > Does it really bypass the cache ?
  2449. > Basically, my application sometimes needs to execute a very intensive
  2450. > read/write loop. Between each file access, I call my SpinBeachBallCursor
  2451. > function, but I noticed that if the Disk Cache Size (as set in the Memory
  2452. > control panel), is big, then after a while, the cursor can stop spinning
  2453. > for several long seconds, time for the cache to get written to disk, I
  2454. > assume. This is very annoying as it really looks as if my program crashed.
  2455. > Calling FlushVol is obviously not a solution as it would slow things down,
  2456. > and I don't really want to install a VBL to spin the cursor.
  2457. > Any ideas ?
  2458. > Cheers,
  2459. > Laurent Humbert
  2460. > laurent@pop3.demon.co.uk
  2461.  
  2462. What you are experiencing is the cache being flushed out to disk. 
  2463. It is possible that other people are accessing the file-system
  2464. while you are executing your loop.  Do you give time to other apps
  2465. in your loop?  If so, and they are accessing the file-system, they
  2466. could be causing the flush.
  2467.  
  2468. There is another possibility.  You haven't made it very clear, but
  2469. do you read some blocks from a file, modify them (or not) and then
  2470. write them to another file, setting the readNoCache bit?  If so,
  2471. then you really haven't accomplished much.  You should set the
  2472. readNoCache bit on the read also.  By the time you get to the
  2473. write, the blocks are already in the cache from the read, so the
  2474. dirty blocks will also be in the cache.
  2475.  
  2476. Why don't you post your read/write code and I can look at it.
  2477.  
  2478. Cameron Esfahani
  2479. dirty@apple.com
  2480. The Devil's Eye
  2481.  
  2482. ---------------------------
  2483.  
  2484. >From bj@staff.cc.purdue.edu (Ben Jackson)
  2485. Subject: Talking to the network (TCP) -- how?
  2486. Date: 11 Aug 1994 22:03:10 GMT
  2487. Organization: Purdue University
  2488.  
  2489. I've skimmed the last thousand or so articles in this group and I've
  2490. read several FAQ's with info about MacTCP.  Nothing I read said
  2491. anything about how to go about creating and using a TCP stream on a
  2492. Mac.  I got the source to NCSA Telnet and a few small network
  2493. utilities, and they each seem to implement TCP themselves!  Is there
  2494. any socket-like interface available?  Is there any way to to create and
  2495. use a TCP stream in under 30k of source?  What about DNS (ie how do I
  2496. look up hosts)?
  2497.  
  2498. I'm not a Mac developer; I'm just interested in writing a Mac client for
  2499. a workstation lab monitoring package I'm working on.  I've written the
  2500. MS Windows client using WINSOCK, and I was hoping the Mac version would
  2501. be equally easy.
  2502.  
  2503. Please email.  I'll summarize if I get any information I understand.  :-)
  2504. --
  2505. Ben Jackson, bj@cc.purdue.edu
  2506.  
  2507. +++++++++++++++++++++++++++
  2508.  
  2509. >From hanrek@cts.com (Mark Hanrek)
  2510. Date: Thu, 11 Aug 1994 19:33:07 -0800
  2511. Organization: The Information Workshop
  2512.  
  2513. In article <32e76u$d5v@mozo.cc.purdue.edu>, bj@staff.cc.purdue.edu (Ben
  2514. Jackson) wrote:
  2515.  
  2516. > I've skimmed the last thousand or so articles in this group and I've
  2517. > read several FAQ's with info about MacTCP.  Nothing I read said
  2518. > anything about how to go about creating and using a TCP stream on a
  2519. > Mac.  I got the source to NCSA Telnet and a few small network
  2520. > utilities, and they each seem to implement TCP themselves!  Is there
  2521. > any socket-like interface available?  Is there any way to to create and
  2522. > use a TCP stream in under 30k of source?  What about DNS (ie how do I
  2523. > look up hosts)?
  2524. > I'm not a Mac developer; I'm just interested in writing a Mac client for
  2525. > a workstation lab monitoring package I'm working on.  I've written the
  2526. > MS Windows client using WINSOCK, and I was hoping the Mac version would
  2527. > be equally easy.
  2528.  
  2529. To everyone,
  2530.  
  2531. It is unbelievable to me how many people do not consider drawing from
  2532. example source code.
  2533.  
  2534. It is clear to me, first of all, that when people make such mistakes, it
  2535. is not their fault.  Even though so many are quick to call such people
  2536. "clueless".
  2537.  
  2538. It is the fault of the methods we use that predispose people to waste so
  2539. much damned time being forced to pursue random paths toward success in
  2540. programming.
  2541.  
  2542. We aren't lions on the Savannah who must prove their skill at surviving
  2543. through the greatest hardships.
  2544.  
  2545. It is like pulling teeth to get computer people to see that the game of "I
  2546. know and you are going to have to figure out how to find out for yourself"
  2547. is absurd.
  2548.  
  2549. Then it always triggers a flame war amongst supposedly bright computer
  2550. people when you suggest that the Internet newsgroup is the problem.
  2551.  
  2552. - -
  2553.  
  2554. The solution is a modern electronic forum.
  2555.  
  2556. Forums have a memory.
  2557.  
  2558. And they have an arrow that points to "Start Here".
  2559.  
  2560. Obviously whatever arrow there is supposed to be on the internet, it's not
  2561. working.
  2562.  
  2563.  
  2564. Mark Hanrek
  2565. The Information Workshop
  2566.  
  2567. +++++++++++++++++++++++++++
  2568.  
  2569. >From hanrek@cts.com (Mark Hanrek)
  2570. Date: Thu, 11 Aug 1994 19:46:31 -0800
  2571. Organization: The Information Workshop
  2572.  
  2573. In article <32e76u$d5v@mozo.cc.purdue.edu>, bj@staff.cc.purdue.edu (Ben
  2574. Jackson) wrote:
  2575.  
  2576. > I've skimmed the last thousand or so articles in this group and I've
  2577. > read several FAQ's with info about MacTCP.  Nothing I read said
  2578. > anything about how to go about creating and using a TCP stream on a
  2579. > Mac.  I got the source to NCSA Telnet and a few small network
  2580. > utilities, and they each seem to implement TCP themselves!  Is there
  2581. > any socket-like interface available?  Is there any way to to create and
  2582. > use a TCP stream in under 30k of source?  What about DNS (ie how do I
  2583. > look up hosts)?
  2584. > I'm not a Mac developer; I'm just interested in writing a Mac client for
  2585. > a workstation lab monitoring package I'm working on.  I've written the
  2586. > MS Windows client using WINSOCK, and I was hoping the Mac version would
  2587. > be equally easy.
  2588.  
  2589. Ben,
  2590.  
  2591. You'll find the answers to your questions in example source code.  
  2592.  
  2593. You will find example source code in issue #10 of "develop" (I think) that
  2594. demonstrates TCP through the construction of a netnews reader.  Also, you
  2595. will find example source code in the "networking" section of the snippets
  2596. area, all available at...
  2597.  
  2598.    ftp://ftp.apple.com/
  2599.  
  2600. You will also find other more simple kinds of examples in some of the
  2601. newsreaders that are accompanied by their source code. There are a
  2602. surprisingly large number of these.   You will be able to access such
  2603. things at the "sumex" and "umich" archives, but you can get to all of them
  2604. at once at...
  2605.  
  2606.    ftp://nic.switch.ch/
  2607.  
  2608. There are also some things in the c.s.m.p. digests.
  2609.  
  2610. You will also want to look through the resources offered in... 
  2611.  
  2612.    comp.sys.mac.comm
  2613.  
  2614. Finally, there is some leading edge TCP stuff at...
  2615.  
  2616.    ftp://seeding.apple.com/
  2617.  
  2618. - ---
  2619.  
  2620. As you can see, you skipped a ton of things.  Don't feel bad about this,
  2621. as it is not your fault, but the fault of the system.  Later on, try to
  2622. make the system better for the next guy.
  2623.  
  2624. Get to know your resources, then help others get to know them too.
  2625.  
  2626. Good luck to ya.
  2627.  
  2628.  
  2629. Mark Hanrek
  2630. The Information Workshop
  2631.  
  2632. +++++++++++++++++++++++++++
  2633.  
  2634. >From oster@netcom.com (David Phillip Oster)
  2635. Date: Fri, 12 Aug 1994 14:02:27 GMT
  2636. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  2637.  
  2638.  
  2639. But, most of the example of using MacTCP are crap. Nothing you should
  2640. use in any production program. When things go wrong on a network, and
  2641. the nature of networks is that things _always_ go wrong sooner or later,
  2642. the network code will retry a number of times.  This means that
  2643. occasionally, system calls will take orders of magnitude more time
  2644. than they normally do. For this reason, any program that does network
  2645. i/o, or even uses the serial port, should always, always, always use
  2646. asynchronous i/o, so the user interface won't block when these network
  2647. errors happen. Even if your program doesn't have a user interface, another
  2648. program running at the same time might, and if you hang, you'll hang
  2649. up the user.
  2650.  
  2651. It isn't enough for a forum to have a memory. We need away of attaching
  2652. peer review, pointers to revisions, and criticism&praise to the
  2653. source code in the archives.
  2654.  
  2655.  
  2656. +++++++++++++++++++++++++++
  2657.  
  2658. >From resnick@uiuc.edu (Pete Resnick)
  2659. Date: Fri, 12 Aug 1994 11:10:46 -0500
  2660. Organization: University of Illinois at Urbana-Champaign
  2661.  
  2662. In article <osterCuFDo3.MC9@netcom.com>, oster@netcom.com (David Phillip
  2663. Oster) wrote:
  2664.  
  2665. >But, most of the example of using MacTCP are crap. Nothing you should
  2666. >use in any production program. When things go wrong on a network, and
  2667. >the nature of networks is that things _always_ go wrong sooner or later,
  2668. >the network code will retry a number of times.  This means that
  2669. >occasionally, system calls will take orders of magnitude more time
  2670. >than they normally do. For this reason, any program that does network
  2671. >i/o, or even uses the serial port, should always, always, always use
  2672. >asynchronous i/o, so the user interface won't block when these network
  2673. >errors happen. Even if your program doesn't have a user interface, another
  2674. >program running at the same time might, and if you hang, you'll hang
  2675. >up the user.
  2676.  
  2677. (*LOUD APPLAUSE HEARD FROM THE GALLERY*)
  2678.  
  2679. Bravo!
  2680.  
  2681. If you call any device driver synchronously, you're doing it wrong.
  2682.  
  2683. pr
  2684. -- 
  2685. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  2686. Doctoral Student - Philosophy Department, Gregory Hall, UIUC
  2687. System manager - Cognitive Science Group, Beckman Institute, UIUC
  2688. Internet: resnick@uiuc.edu
  2689.  
  2690. +++++++++++++++++++++++++++
  2691.  
  2692. >From mouse@engc.bu.edu (Matt Mick)
  2693. Date: 12 Aug 1994 20:06:45 GMT
  2694. Organization: Boston University
  2695.  
  2696. ** WRONG **  The Newswatcher source has asynchronous i/o examples!  I 
  2697. use it all the time!
  2698.  
  2699. --matt
  2700.  
  2701. Pete Resnick (resnick@uiuc.edu) wrote:
  2702. : In article <osterCuFDo3.MC9@netcom.com>, oster@netcom.com (David Phillip
  2703. : Oster) wrote:
  2704.  
  2705. : >But, most of the example of using MacTCP are crap. Nothing you should
  2706. : >use in any production program. When things go wrong on a network, and
  2707. : >the nature of networks is that things _always_ go wrong sooner or later,
  2708. : >the network code will retry a number of times.  This means that
  2709. : >occasionally, system calls will take orders of magnitude more time
  2710. : >than they normally do. For this reason, any program that does network
  2711. : >i/o, or even uses the serial port, should always, always, always use
  2712. : >asynchronous i/o, so the user interface won't block when these network
  2713. : >errors happen. Even if your program doesn't have a user interface, another
  2714. : >program running at the same time might, and if you hang, you'll hang
  2715. : >up the user.
  2716.  
  2717. : (*LOUD APPLAUSE HEARD FROM THE GALLERY*)
  2718.  
  2719. : Bravo!
  2720.  
  2721. : If you call any device driver synchronously, you're doing it wrong.
  2722.  
  2723. : pr
  2724. : -- 
  2725. : Pete Resnick        (...so what is a mojo, and why would one be rising?)
  2726. : Doctoral Student - Philosophy Department, Gregory Hall, UIUC
  2727. : System manager - Cognitive Science Group, Beckman Institute, UIUC
  2728. : Internet: resnick@uiuc.edu
  2729.  
  2730. --
  2731.                     __  __
  2732.    ____ ___  ____ _/ /_/ /_    Matt Mick      M.S. Student in BioMedical Eng.
  2733.   / __ `__ \/ __ `/ __/ __/                   Boston Univ., Boston MA
  2734.  / / / / / / /_/ / /_/ /_      
  2735. /_/ /_/ /_/\__,_/\__/\__/      Internet:  mouse@bu.edu    AOL:  mattmick
  2736.  
  2737. +++++++++++++++++++++++++++
  2738.  
  2739. >From hanrek@cts.com (Mark Hanrek)
  2740. Date: Fri, 12 Aug 1994 13:46:05 -0800
  2741. Organization: The Information Workshop
  2742.  
  2743. In article <osterCuFDo3.MC9@netcom.com>, oster@netcom.com (David Phillip
  2744. Oster) wrote:
  2745.  
  2746. > It isn't enough for a forum to have a memory. We need away of attaching
  2747. > peer review, pointers to revisions, and criticism & praise to the
  2748. > source code in the archives.
  2749.  
  2750. Yes, yes, yes!!!!
  2751.  
  2752. There are intelligent people around!!!!!
  2753.  
  2754. Man-o-man.  You made my day!!
  2755.  
  2756. Thanks, David.  And, Pete.  Without the ability to attach and update, it's
  2757. like one step forward and one step back.
  2758.  
  2759. It also allows for "accumulation of knowledge and refinement" so that it
  2760. doesn't always seem like subjects are starting from the beginning all the
  2761. time. :) Such as the subject of what to call the next offshoot of
  2762. comp.sys.mac.*.
  2763.  
  2764. Okay, let's see....  a modern forum should be.... attachable, and...
  2765. updatable,...  and allow peer review....
  2766.  
  2767. Got it.
  2768.  
  2769.  
  2770. Thanks. :)
  2771.  
  2772. Mark
  2773.  
  2774. +++++++++++++++++++++++++++
  2775.  
  2776. >From rmah@panix.com (Robert Mah)
  2777. Date: Fri, 12 Aug 1994 19:07:07 -0500
  2778. Organization: One Step Beyond
  2779.  
  2780. hanrek@cts.com (Mark Hanrek) wrote:
  2781.  
  2782. ) oster@netcom.com (David Phillip Oster) wrote:
  2783. ) > It isn't enough for a forum to have a memory. We need away of attaching
  2784. ) > peer review, pointers to revisions, and criticism & praise to the
  2785. ) > source code in the archives.
  2786. ) Yes, yes, yes!!!!
  2787. ) There are intelligent people around!!!!!
  2788. ) Man-o-man.  You made my day!!
  2789. ) Thanks, David.  And, Pete.  Without the ability to attach and update,
  2790. ) it's like one step forward and one step back.
  2791. ) It also allows for "accumulation of knowledge and refinement" so that
  2792. ) it doesn't always seem like subjects are starting from the beginning
  2793. ) all the time. :) Such as the subject of what to call the next offshoot
  2794. ) of comp.sys.mac.*.
  2795. ) Okay, let's see....  a modern forum should be.... attachable, and...
  2796. ) updatable,...  and allow peer review....
  2797.  
  2798. That's all very nice and I too would like to see such things...
  2799.  
  2800. But who's going to spend the money to make it happen?
  2801.  
  2802. THAT is the real issue.  We have the technology (or most of it), the 
  2803. question is who is going to donate 10's of thousands of dollars of
  2804. equipment and comm expenses.  Volunteers?
  2805.  
  2806. Cheers,
  2807. Rob
  2808. _____________________________________________________________________
  2809. Robert S. Mah           Software Development          +1.212.947.6507
  2810. One Step Beyond        and Network Consulting          rmah@panix.com
  2811.  
  2812. +++++++++++++++++++++++++++
  2813.  
  2814. >From hanrek@cts.com (Mark Hanrek)
  2815. Date: Fri, 12 Aug 1994 17:58:23 -0800
  2816. Organization: The Information Workshop
  2817.  
  2818. > That's all very nice and I too would like to see such things...
  2819. > But who's going to spend the money to make it happen?
  2820. > THAT is the real issue.  We have the technology (or most of it), the 
  2821. > question is who is going to donate 10's of thousands of dollars of
  2822. > equipment and comm expenses.  Volunteers?
  2823.  
  2824.  
  2825. Bringing greater awareness to this issue is one way of doing it.
  2826.  
  2827. The more people who become dissatisfied with the way things are with a
  2828. newsgroup, instead of accepting it, the more people who will be thinking
  2829. about the problems, subsequently solving the issues that come up.
  2830.  
  2831. Your question is legitimate.
  2832.  
  2833. What is interesting is though you have asked it, and I have clarified
  2834. something about it, it will only make a difference to you, because in a
  2835. couple of days, the subject will potentially start from the beginning
  2836. again.
  2837.  
  2838. This makes this medium only good for one thing... constantly brewing
  2839. dissatisfaction over it.  
  2840.  
  2841. Unfortunately, it pretty much dissallows for the development of consensus,
  2842. and resolve, and even leadership.  Leadership is often needed to develop
  2843. consensus in the first place -- a viscious circle.
  2844.  
  2845. It's a toughie no matter which way we slice it.
  2846.  
  2847.  
  2848. Mark Hanrek
  2849. The Information Workshop
  2850.  
  2851. +++++++++++++++++++++++++++
  2852.  
  2853. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  2854. Date: Sat, 13 Aug 1994 16:54:09 +1200 (NZST)
  2855. Organization: (none)
  2856.  
  2857. bj@staff.cc.purdue.edu (Ben Jackson) writes:
  2858. > I've skimmed the last thousand or so articles in this group and I've
  2859. > read several FAQ's with info about MacTCP.  Nothing I read said
  2860. > anything about how to go about creating and using a TCP stream on a
  2861. > Mac.  I got the source to NCSA Telnet and a few small network
  2862. > utilities, and they each seem to implement TCP themselves!  Is there
  2863. > any socket-like interface available?  Is there any way to to create and
  2864. > use a TCP stream in under 30k of source?  What about DNS (ie how do I
  2865. > look up hosts)?
  2866.  
  2867. Get the source for NewsWatcher 2.0b9 <ftp://ftp.acns.nwu.edu/pub/newswatcher/>
  2868. It has several examples of small bits of code doing an incidental ftp transfer
  2869. and stuff like that.
  2870.  
  2871. -- Bruce
  2872.  
  2873. +++++++++++++++++++++++++++
  2874.  
  2875. >From peter.lewis@info.curtin.edu.au (Peter N Lewis)
  2876. Date: Sun, 14 Aug 1994 15:38:52 +0800
  2877. Organization: NCRPDA, Curtin University
  2878.  
  2879. >: In article <osterCuFDo3.MC9@netcom.com>, oster@netcom.com (David Phillip
  2880. >: Oster) wrote:
  2881. >
  2882. >: >But, most of the example of using MacTCP are crap. Nothing you should
  2883. >: >use in any production program. When things go wrong on a network, and
  2884. >: >the nature of networks is that things _always_ go wrong sooner or later,
  2885. >: >the network code will retry a number of times.  This means that
  2886. >: >occasionally, system calls will take orders of magnitude more time
  2887. >: >than they normally do. For this reason, any program that does network
  2888. >: >i/o, or even uses the serial port, should always, always, always use
  2889. >: >asynchronous i/o, so the user interface won't block when these network
  2890. >: >errors happen. Even if your program doesn't have a user interface, another
  2891. >: >program running at the same time might, and if you hang, you'll hang
  2892. >: >up the user.
  2893.  
  2894. I'm not entirely sure which code you're talking about.  NewsWatcher
  2895. doesn't do that, Finger doesn't do that, Eudora doesn't, even Telnet
  2896. doesn't.  So exactly which code is it that you are referring to?
  2897.  
  2898. >Pete Resnick (resnick@uiuc.edu) wrote:
  2899.  
  2900. >: (*LOUD APPLAUSE HEARD FROM THE GALLERY*)
  2901. >
  2902. >: Bravo!
  2903. >
  2904. >: If you call any device driver synchronously, you're doing it wrong.
  2905.  
  2906. Sorry to disagree with you Pete, but that's not true.  There is no
  2907. problems at all with using syncronous TCPReceives if you check that the
  2908. characters are available before you call the code, then it's guarenteed to
  2909. return immediately.  You wont get as high throughput as with chained io
  2910. completions, but a lot fo code doesn't need maximal throughput (eg a
  2911. backup program where you don't want to toast the machine while the user is
  2912. working on it).
  2913.    Peter.
  2914. -- 
  2915. Peter N Lewis <peter.lewis@info.curtin.edu.au> - Macintosh TCP fingerpainter
  2916.  
  2917. +++++++++++++++++++++++++++
  2918.  
  2919. >From resnick@uiuc.edu (Pete Resnick)
  2920. Date: Mon, 15 Aug 1994 00:02:49 -0500
  2921. Organization: University of Illinois at Urbana-Champaign
  2922.  
  2923. In article <peter.lewis-1408941538520001@rocky.curtin.edu.au>,
  2924. peter.lewis@info.curtin.edu.au (Peter N Lewis) wrote:
  2925.  
  2926. >>: In article <osterCuFDo3.MC9@netcom.com>, oster@netcom.com (David Phillip
  2927. >>: Oster) wrote:
  2928. >>
  2929. >>: >But, most of the example of using MacTCP are crap. Nothing you should
  2930. >>: >use in any production program. [...A]ny program that does network
  2931. >>: >i/o, or even uses the serial port, should always, always, always use
  2932. >>: >asynchronous i/o, so the user interface won't block when these network
  2933. >>: >errors happen. Even if your program doesn't have a user interface, another
  2934. >>: >program running at the same time might, and if you hang, you'll hang
  2935. >>: >up the user.
  2936. >
  2937. >I'm not entirely sure which code you're talking about.  NewsWatcher
  2938. >doesn't do that, Finger doesn't do that, Eudora doesn't, even Telnet
  2939. >doesn't.  So exactly which code is it that you are referring to?
  2940.  
  2941. How about all of the Snippets in the Apple Sample Code? They all do
  2942. synchronous I/O. I believe the original NewsWatcher code (not the stuff
  2943. that John Norstad wrote) which was out for public distribution also used
  2944. synchronous I/O. Basically, it's the stuff that's coming out of Apple
  2945. that's garbage. I have seen you use PBControlSync on many an occasion too,
  2946. but I forgive you. :-)
  2947.  
  2948. >>Pete Resnick (resnick@uiuc.edu) wrote:
  2949. >
  2950. >>: If you call any device driver synchronously, you're doing it wrong.
  2951. >
  2952. >Sorry to disagree with you Pete, but that's not true.  There is no
  2953. >problems at all with using syncronous TCPReceives if you check that the
  2954. >characters are available before you call the code, then it's guarenteed to
  2955. >return immediately.
  2956.  
  2957. No, it isn't guaranteed. Now, it turns out that you and I both know
  2958. something of the internals of the MacTCP device driver, that it does not
  2959. service queued requests serially, but instead things get ripped off the
  2960. queue and are handled whenever the driver deems it "appropriate" to do so.
  2961. But this just happens to be inside knowledge of how the MacTCP driver
  2962. works. There is nothing in the documentation that says this. For all you
  2963. know, the driver could be servicing some other request when your call
  2964. comes through and it could take a long time (relatively speaking) for your
  2965. TCPRcv call to complete. It's just not deterministic. And for the serial
  2966. driver, such an assumption would be *dead wrong*. If you know there are
  2967. characters available and you make a synchronous call to PBRead on the
  2968. serial driver, some call sitting in front of you in the queue could take a
  2969. virtual eternity to complete and hang the machine for your user. The best
  2970. policy is don't chance it.
  2971.  
  2972. >You wont get as high throughput as with chained io
  2973. >completions, but a lot fo code doesn't need maximal throughput (eg a
  2974. >backup program where you don't want to toast the machine while the user is
  2975. >working on it).
  2976.  
  2977. Now, I never mentioned chained I/O. All I am talking about is calling the
  2978. driver asynchronously. If you want to set ioCompletion to nil and sit in a
  2979. loop like:
  2980.  
  2981.     while(pb->ioResult > 0)
  2982.         WaitNextEvent(...);
  2983.  
  2984. that's up to you; as you say, throughput will suffer, but sometimes you
  2985. don't care about that. But I am convinced, and will defend to the end,
  2986. that there's no good reason for production code ever to set that async
  2987. flag in the Device Manager routines to false.
  2988.  
  2989. pr
  2990. -- 
  2991. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  2992. Doctoral Student - Philosophy Department, Gregory Hall, UIUC
  2993. System manager - Cognitive Science Group, Beckman Institute, UIUC
  2994. Internet: resnick@uiuc.edu
  2995.  
  2996. ---------------------------
  2997.  
  2998. >From mdiehr@ucsd.edu (Michael C. Diehr)
  2999. Subject: What fonts are always available?
  3000. Date: 26 Jul 1994 21:50:51 GMT
  3001. Organization: University of California at San Diego
  3002.  
  3003. I'm developing an after dark module that uses text, and I was wondering if
  3004. (with system 7.0 or later) there is a base-case set of fonts & font sizes
  3005. I can count on being available.
  3006.  
  3007. If not, can I put font resources in my After Dark module's resource fork
  3008. and have them work?  Would this be violating anyone's copyrights (standard
  3009. apple fonts).
  3010.  
  3011. thanks!
  3012.  
  3013. +++++++++++++++++++++++++++
  3014.  
  3015. >From bobo@reed.edu (Eric Bowman)
  3016. Date: 26 Jul 1994 22:44:32 GMT
  3017. Organization: Reed College,  Portland, Oregon
  3018.  
  3019. In article <mdiehr-2607941452170001@mdiehr.extern.ucsd.edu>,
  3020. Michael C. Diehr <mdiehr@ucsd.edu> wrote:
  3021. >I'm developing an after dark module that uses text, and I was wondering if
  3022. >(with system 7.0 or later) there is a base-case set of fonts & font sizes
  3023. >I can count on being available.
  3024.  
  3025. You really should let the user choose from whatever fonts are available 
  3026. if at all possible.
  3027.  
  3028. cheers,
  3029. bobo
  3030.  
  3031. +++++++++++++++++++++++++++
  3032.  
  3033. >From susanlesch@aol.com (SusanLesch)
  3034. Date: 26 Jul 1994 19:15:13 -0400
  3035. Organization: America Online, Inc. (1-800-827-6364)
  3036.  
  3037.   Re article <mdiehr-2607941452170001@mdiehr.extern.ucsd.edu>,
  3038.   mdiehr@ucsd.edu (Michael C. Diehr):
  3039.   
  3040.   Chicago 12, Geneva 9, Geneva 12, and Monaco 9 are the only fonts
  3041.   guaranteed to be on a normal U.S. System. The Mac reserved fonts
  3042.   have not changed with System 7.
  3043.   
  3044.   Some "standard Apple" fonts like Helvetica and Palatino are
  3045.   licensed to you through Apple from Linotype. Courier, Times, and
  3046.   the TrueType versions of Chicago, Geneva and Monaco are licensed
  3047.   to you by Apple.
  3048.   
  3049.   To the best of my understanding, U.S. law would allow you to
  3050.   redistribute bitmaps of these fonts, but not any outlines.
  3051.  
  3052. +++++++++++++++++++++++++++
  3053.  
  3054. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  3055. Date: Wed, 27 Jul 1994 01:02:56 GMT
  3056. Organization: Apple Computer
  3057.  
  3058. Michael C. Diehr, mdiehr@ucsd.edu writes:
  3059. > If not, can I put font resources in my After Dark module's resource fork
  3060. > and have them work?  Would this be violating anyone's copyrights (standard
  3061. > apple fonts).
  3062.  
  3063. Putting fonts anywhere other than in the System folder is dangerous. The
  3064. reason is that, after your app/XCMD/After Dark module/etc. closes up shop,
  3065. the font resources are released but there may still be handles to them in
  3066. internal Font Manager caches. These handles are stale and will cause Bad
  3067. Things to happen if the Font Manager decides to use them.
  3068.  
  3069. It sucks, but that's the way it works. If your program _has_ to have a
  3070. particular nonstandard font to display properly, you have to supply a
  3071. suitcase and tell the user to install the font.
  3072.  
  3073. QuickDraw GX eliminates this problem with GX fonts. But I believe it's still
  3074. with us for traditional Mac fonts.
  3075.  
  3076. --Jens Alfke
  3077.   jens_alfke@powertalk              Rebel girl, rebel girl,
  3078.             .apple.com              Rebel girl you are the queen of my world
  3079.  
  3080. +++++++++++++++++++++++++++
  3081.  
  3082. >From gurgle@dnai.com (Pete Gontier)
  3083. Date: 26 Jul 1994 18:48:25 GMT
  3084. Organization: Integer Poet Software
  3085.  
  3086. In article <mdiehr-2607941452170001@mdiehr.extern.ucsd.edu>
  3087. mdiehr@ucsd.edu (Michael C. Diehr) writes:
  3088.  
  3089. > I'm developing an after dark module that uses text, and I was wondering if
  3090. > (with system 7.0 or later) there is a base-case set of fonts & font sizes
  3091. > I can count on being available.
  3092.  
  3093. Resources related to Chicago, Geneva, and Monaco are in the ROM of my
  3094. Q800 and my System 7.1 file. That's it. You can usually assume Times
  3095. and Courier and some other really common fonts exist, but you still
  3096. need to verify their presence and do something appropriate (like refuse
  3097. to run) if they're not.
  3098.  
  3099. > If not, can I put font resources in my After Dark module's resource fork
  3100. > and have them work?  Would this be violating anyone's copyrights (standard
  3101. > apple fonts).
  3102.  
  3103. IANAL, but I believe the standard dogma is that you will be able to
  3104. fight off legal claims that you stole bitmap fonts but not fonts which
  3105. are also "programs", like PostScript and TrueType fonts. Of course,
  3106. this assumes you want to do any legal fighting at all. I wouldn't do
  3107. anything without a piece of paper from whoever made the fonts granting
  3108. you permission to use them.
  3109.  
  3110. There are technical issues, too. For example, rename the fonts you
  3111. include in your AD module with leading '.' characters so that they
  3112. don't show up in menus created by AddResMenu. And otherwise be careful
  3113. someone else doesn't get hold of one of your fonts, or Bad Things might
  3114. happen when your module closes.
  3115.  
  3116. --
  3117.  
  3118. Pete Gontier // Integer Poet Software // gurgle@dnai.com
  3119.  
  3120. "Clear-cutting removes all trees... to create new habitats for
  3121. wildlife. P&G uses this economically and environmentally sound method
  3122. because it most closely mimics nature's own processes. Clear-cutting
  3123. also opens the floor to sunshine, thus stimulating growth and providing
  3124. food for animals."
  3125.  
  3126.     -- Procter & Gamble's "Decision Earth" free school curriculum
  3127.  
  3128. +++++++++++++++++++++++++++
  3129.  
  3130. >From ashbridg@fmi.ch (Kevin Ashbridge)
  3131. Date: Thu, 28 Jul 1994 15:15:06 GMT
  3132. Organization: Ciba-Geigy Ltd.,Basel,Switzerland
  3133.  
  3134. In article <3143kg$of1@scratchy.reed.edu>
  3135. bobo@reed.edu (Eric Bowman) writes:
  3136.  
  3137. > In article <mdiehr-2607941452170001@mdiehr.extern.ucsd.edu>,
  3138. > Michael C. Diehr <mdiehr@ucsd.edu> wrote:
  3139. > >I'm developing an after dark module that uses text, and I was wondering if
  3140. > >(with system 7.0 or later) there is a base-case set of fonts & font sizes
  3141. > >I can count on being available.
  3142. > You really should let the user choose from whatever fonts are available 
  3143. > if at all possible.
  3144.  
  3145. As far as I understand it, the English-language Finder fonts (Chicago
  3146. 12 and Geneva 9&12, Monaco 9) are available in every version of System
  3147. 7.
  3148.  
  3149. Kevin.
  3150.  
  3151. +++++++++++++++++++++++++++
  3152.  
  3153. >From wdh@netcom.com (Bill Hofmann)
  3154. Date: Sun, 31 Jul 1994 22:16:09 GMT
  3155. Organization: Fresh Software
  3156.  
  3157. In article <1994Jul28.151506.3615@ciba-geigy.ch>, ashbridg@fmi.ch (Kevin
  3158. Ashbridge) wrote:
  3159.  
  3160. > In article <3143kg$of1@scratchy.reed.edu>
  3161. > bobo@reed.edu (Eric Bowman) writes:
  3162. > > In article <mdiehr-2607941452170001@mdiehr.extern.ucsd.edu>,
  3163. > > Michael C. Diehr <mdiehr@ucsd.edu> wrote:
  3164. > > >I'm developing an after dark module that uses text, and I was wondering if
  3165. > > >(with system 7.0 or later) there is a base-case set of fonts & font sizes
  3166. > > >I can count on being available.
  3167. > > 
  3168. > > You really should let the user choose from whatever fonts are available 
  3169. > > if at all possible.
  3170. > As far as I understand it, the English-language Finder fonts (Chicago
  3171. > 12 and Geneva 9&12, Monaco 9) are available in every version of System
  3172. > 7.
  3173. Well, everyone's right here.  It's nice to let the user set fonts if it's
  3174. appropriate (create a menu using AddResMenu(mh, 'FONT')).  If you want to
  3175. choose  or set particular fonts, you should save the font name in a
  3176. resource, and use GetFNum() to get the font ID.  
  3177.  
  3178. Another option is to use a few script manager verbs which will return
  3179. various combinations of FontID/FontSize for standard system, std
  3180. application, small font, large font, etc.  I've used these with good
  3181. results on a passel of international systems.
  3182.  
  3183. -Bill
  3184.  
  3185. -- 
  3186. Bill Hofmann                                   wdh@netcom.com
  3187. Fresh Software and Instructional Design        voice: +1 510 524 0852
  3188. 1640 San Pablo Ave #C, Berkeley CA 94702 USA   fax:   +1 510 524 0853
  3189.  
  3190. ---------------------------
  3191.  
  3192. >From pfiglio@ohstpy.mps.ohio-state.edu (Pete Figliozzi)
  3193. Subject: [Q] Universal Headers
  3194. Date: 31 Jul 94 12:37:25 -0400
  3195. Organization: The Ohio State University, Department of Physics
  3196.  
  3197.  
  3198. What's the deal with these Universal Headers I keep hearing about?
  3199.  
  3200. Thanks,
  3201.  
  3202. Pete
  3203.  
  3204. pfiglio@mps.ohio-state.edu
  3205.  
  3206.  
  3207. +++++++++++++++++++++++++++
  3208.  
  3209. >From nick@pitt.edu ( nick.c )
  3210. Date: Tue, 2 Aug 94 01:14:15 GMT
  3211. Organization: The Pitt, Chemistry
  3212.  
  3213. In Article <1994Jul31.123726.5359@ohstpy.mps.ohio-state.edu>,
  3214. pfiglio@ohstpy.mps.ohio-state.edu (Pete Figliozzi) wrote:
  3215.  
  3216. >What's the deal with these Universal Headers I keep hearing about?
  3217.  
  3218.     As I understand it, they're a collection of header files
  3219.   also called "universal interface" that are made by Apple
  3220.   and ship with Symantec's environments, CodeWarrior, d e v e l o p,
  3221.   the developer mailing and I don't know what else.  The idea
  3222.   (as I understand it) is to give folks a standard set of routines
  3223.   so that you can access from any environment, and across
  3224.   various platforms.  The most frequent use I can think of is
  3225.   adjusting LoMem variables.  By using these routines, you can
  3226.   adjust LoMem variables consistently, and if Apple later changes
  3227.   the rom memory location, they just update the headers, and
  3228.   you don't have to change your application.
  3229.  
  3230.     This is probably an oversimplification, but that's as much
  3231.   as I've been able to figure out.  Oh, and Symantec has another
  3232.   set of headers they used to use, but they recommend that you
  3233.   start using the universal headers, MW doesn't give you a choice.
  3234.  
  3235.                                         -- nick
  3236.  
  3237.  
  3238. Disclaimer: Just my opinion.
  3239.  
  3240.    _/   _/  _/  _/_/_/   _/   _/ "Sea Shells to C shells,  Waikiki to
  3241.   _/_/ _/  _/  _/   _/  _/_/_/     the Internet, a wave, is a wave..."
  3242.  _/ _/_/  _/  _/       _/ _/          CIS: 71232,766  eWorld: nick  
  3243. _/   _/  _/   _/_/_/  _/   _/            Internet: nick@pitt.edu
  3244.  
  3245.  
  3246. +++++++++++++++++++++++++++
  3247.  
  3248. >From tree@bedford.symantec.com (Tom Emerson)
  3249. Date: 3 Aug 1994 10:36:31 GMT
  3250. Organization: Symantec Development Tools Group
  3251.  
  3252. In article <nick.1126177695A@usenet.pitt.edu>, nick@pitt.edu ( nick.c ) wrote:
  3253.  
  3254. > In Article <1994Jul31.123726.5359@ohstpy.mps.ohio-state.edu>,
  3255. > pfiglio@ohstpy.mps.ohio-state.edu (Pete Figliozzi) wrote:
  3256. > >What's the deal with these Universal Headers I keep hearing about?
  3257. >     As I understand it, they're a collection of header files
  3258. >   also called "universal interface" that are made by Apple
  3259. >   and ship with Symantec's environments, CodeWarrior, d e v e l o p,
  3260. >   the developer mailing and I don't know what else.  The idea
  3261. >   (as I understand it) is to give folks a standard set of routines
  3262. >   so that you can access from any environment, and across
  3263. >   various platforms.  The most frequent use I can think of is
  3264. >   adjusting LoMem variables.  By using these routines, you can
  3265. >   adjust LoMem variables consistently, and if Apple later changes
  3266. >   the rom memory location, they just update the headers, and
  3267. >   you don't have to change your application.
  3268.  
  3269. Well, actually this isn't correct. The universal interfaces were created
  3270. to allow developers to use a single, consistent set of interfaces when
  3271. building applications for both the 68K and PowerPC based Macintoshes.
  3272. Through ETO #14 the headers are not universal between development
  3273. environments - they are written with MPW in mind and as such have required
  3274. some modification for our compilers. I think MetroWerks has made minor
  3275. changes as well.
  3276.  
  3277. With regards to low-memory globals, you've always had a portable method of
  3278. accessing them through the "SysEqu.h" header where each global is
  3279. #define'd to its address. Using them was more involved than going through
  3280. our LoMem.h (note that absence of the 'w') but portable across Symantec
  3281. and Apple environments. What the universal "LowMem.h" gives you over
  3282. SysEqu.h is a functional wrapper around each global to support
  3283. compatibility with both 68K and PowerPC architectures.
  3284.  
  3285. Both MetroWerks and Symantec have been working with Apple at making the
  3286. universal interfaces "universal" across development environments. These
  3287. should be coming down the pipe RSN.
  3288.  
  3289. >     This is probably an oversimplification, but that's as much
  3290. >   as I've been able to figure out.  Oh, and Symantec has another
  3291. >   set of headers they used to use, but they recommend that you
  3292. >   start using the universal headers, MW doesn't give you a choice.
  3293.  
  3294. The other set of headers are Apple's latest 68K (non-universal)
  3295. interfaces, which we include for backwards compatibility for people
  3296. porting their applications to 7.0 from previous versions of the
  3297. environment. These are not the default set of interfaces used to build the
  3298. precompiled headers.
  3299.  
  3300.    -tre
  3301.  
  3302. -- 
  3303. Tom Emerson                                              Software Engineer
  3304. Development Tools Group                               Symantec Corporation
  3305.                           tree@bedford.symantec.com
  3306.   "I dreamed I had to take a test, in a Dairy Queen, on another planet."
  3307.  
  3308. +++++++++++++++++++++++++++
  3309.  
  3310. >From neil_ticktin@xplain.com (Neil Ticktin)
  3311. Date: Tue, 9 Aug 1994 06:38:28 GMT
  3312. Organization: MacTech Magazine/Xplain Corporation
  3313.  
  3314. >> In Article <1994Jul31.123726.5359@ohstpy.mps.ohio-state.edu>,
  3315. >> pfiglio@ohstpy.mps.ohio-state.edu (Pete Figliozzi) wrote:
  3316. >> 
  3317. >> >What's the deal with these Universal Headers I keep hearing about?
  3318.  
  3319.  
  3320. Pete,
  3321.  
  3322. Check out the August issue (I think) of MacTech Magazine -- it puts the
  3323. whole concept of the new headers into perspective.
  3324.  
  3325. Hope it helps,
  3326.  
  3327. Neil
  3328.  
  3329. - ---------------------------------------------------------------------
  3330.            Neil Ticktin, MacTech Magazine (formerly MacTutor)
  3331. PO Box 250055, Los Angeles, CA 90025 * 310-575-4343 * Fax: 310-575-0925
  3332.  For more info, anonymous ftp to ftp.netcom.com and cd to /pub/xplain
  3333.   custservice@xplain.com * editorial@xplain.com * adsales@xplain.com
  3334. marketing@xplain.com * accounting@xplain.com * pressreleases@xplain.com
  3335.    progchallenge@xplain.com * publisher@xplain.com * info@xplain.com
  3336.  
  3337. ---------------------------
  3338.  
  3339. >From anbrown@husc9.harvard.edu (anthony brown)
  3340. Subject: best c++ book...
  3341. Date: 10 Aug 1994 23:54:16 GMT
  3342. Organization: Harvard University, Cambridge, Massachusetts
  3343.  
  3344. I know that this question has probably been ascked before, but I was 
  3345. wondering which would be the best book on C++ programming on the mac.
  3346.  
  3347. I was thinking about getting the dave mark learn c++ on the macintosh.  I 
  3348. have also seen a bunch of books for symentech c++ programming.
  3349.  
  3350. Could anyone recommend a book?
  3351.  
  3352. I will be using symantech c++ 6.0.1 to learn, then after I get c++ down, 
  3353. I'm switching to codewarrior. 
  3354.  
  3355. Anthony
  3356. --
  3357. *********************************************************************
  3358. *                                                                   *
  3359. *  Anthony Brown, Macintosh Programming Intern, Harvard Universtiy  *
  3360. *                                                                   *
  3361. *  "Classic Rock Music Stations,  The 70's are calling,             *
  3362. *   They want their 8 - Tracks back!"                    *
  3363. *                                                                   *
  3364. *   Dolphin's Rule!! Undefeated 17 - 0  The Perfect Team 1972-73    *
  3365. *                                    * 
  3366. *********************************************************************
  3367.  
  3368.  
  3369. +++++++++++++++++++++++++++
  3370.  
  3371. >From nick+@pitt.edu ( nick.c )
  3372. Date: Thu, 11 Aug 94 00:47:46 GMT
  3373. Organization: The Pitt, Chemistry
  3374.  
  3375. In Article <32bpb8$fq2@scunix2.harvard.edu>, anbrown@husc9.harvard.edu
  3376. (anthony brown) wrote:
  3377.  
  3378. >I know that this question has probably been ascked before, but I was 
  3379. >wondering which would be the best book on C++ programming on the mac.
  3380. >
  3381. >I was thinking about getting the dave mark learn c++ on the macintosh.  I 
  3382. >have also seen a bunch of books for symentech c++ programming.
  3383.  
  3384.     Symantec.  no 'h'.
  3385.  
  3386.     Dave Mark's book is a good place to start, friendly, mac based
  3387.       and focused on the language.  Bjarne Stroustrup's book 
  3388.       _The C++ Programming Language_ is the basis for C++, and
  3389.       a great reference but tough to start with.  I've appended 
  3390.       some posts that I had saved on my HD regarding C++ book
  3391.       recommendations.
  3392.  
  3393.  
  3394.  
  3395. ==========
  3396.  
  3397. Path: newsfeed.pitt.edu!gatech!willis1.cis.uab.edu!news.lsu.edu!zachary
  3398. From: zachary@bit.csc.lsu.edu (John Zachary)
  3399. Newsgroups: comp.sys.mac.programmer
  3400. Subject: Re: CodeWarrior Gold 4
  3401. Date: 9 Aug 1994 20:10:20 GMT
  3402. Organization: Dept. of Computer Science, LSU, Baton Rouge
  3403. References: <31ru9t$25l@geraldo.cc.utexas.edu>
  3404.  <31uk5a$k1m@search01.news.aol.com>
  3405.  <325ll6$dcg@usenet.INS.CWRU.Edu>
  3406.  
  3407. In article <325ll6$dcg@usenet.INS.CWRU.Edu> mab22@po.CWRU.Edu (Michael A.
  3408. Balfour) writes:
  3409. >>  I'd avoid the overly technical books such as Stroustrup's  The C++
  3410. >>Programming Language, ARM and always avoid K&R.  The generic books such as
  3411. >
  3412. >I disagree with this.  If you have experience in Pascal or another high
  3413. >level language (even C) and you'd like to learn C++, I'd recommend The
  3414. >C++ Programming Language by Bjarne Stroustrup.  I'm still reading
  3415. >through it, but for every page I've read so far, I've learned something
  3416. >new.  It's not for someone completely new to programming, but for a
  3417. >programmer trying to learn a new language I think it's a great book!
  3418. >
  3419. >Mike Balfour
  3420. >CWRU Grad Student
  3421.  
  3422.  
  3423.  
  3424.  
  3425. I totally agree. Another book I would recommend is "Advanced C++ Programming
  3426. Styles and Idioms" by James Coplien, ISBN 0-201-54855-0. I learned from
  3427. (and am still learning from) both Stroustup's and Coplien's book. Coplien's
  3428. discussion on virtual functions and inheritance is particularly  clear
  3429. and concise, IMHO.
  3430.  
  3431.  
  3432. Don't let the term "advanced" scare you off. 
  3433.  
  3434. -- 
  3435. _________________________________________________________________
  3436. John Morris Zachary, Jr.                (zachary@bit.csc.lsu.edu)
  3437. Louisiana State University    (zachary@telerobotics.jpl.nasa.gov)
  3438. _________________________________________________________________
  3439.  
  3440.  
  3441. =============
  3442.  
  3443.  
  3444. From: jbrewer@wri.com (John Brewer)
  3445. Newsgroups: comp.sys.mac.programmer
  3446. Subject: Re: Favorite C++ Book?
  3447. Date: 16 Apr 94 16:41:49 GMT
  3448. References: <jake-130494225036@csacbl6.cern.ch>
  3449. Organization: Wolfram Research, Inc.
  3450.  
  3451. In article <jake-130494225036@csacbl6.cern.ch> Bob Jacobsen,
  3452. jake@dxal13.cern.ch writes:
  3453. >What books do people recommend for C++ on the Mac?
  3454.  
  3455. I'd recommend some general C++ books to start out with.  Once you've
  3456. mastered the syntax and the key concepts of the language, then you can
  3457. branch out into platform-specific things like GUI frameworks.  Trying to
  3458. do everything at once will result in information overload.
  3459.  
  3460. If I were teaching a C++ class right now, I'd have the following books be
  3461. required reading:
  3462. Lippman, Stanley _The C++ Primer_ (If you don't know C) OR
  3463. Pohl, Ira(?) _C++ for C Programmers_ (If you do know C)
  3464. Budd, Timothy _An Introduction to Object Oriented Programming_
  3465.  
  3466. The following would be recommended supplemental reading:
  3467. Meyers, Scott _Effective C++_
  3468.  
  3469. You'll probably also want to pick up one or both of the following for
  3470. reference:
  3471. Stroustrup, Bjarne _The C++ Programming Language_
  3472. Ellis & Stroustrup _The Annotated C++ Reference Manual_
  3473.  
  3474. The reason I recommend either Lippman or Pohl is that, while Lippman is
  3475. probably the better book, it assumes you have no knowledge of C.  Since
  3476. Ihave over a decade of experience with C, I resent being told what a
  3477. "break" statement is again.  I also find that when I try to skip over
  3478. the stuff I already know, I invariably skip some new stuff by mistake. 
  3479. Pohl assumes you know C, and therefore only covers the differences.  I
  3480. appreciate this approach.
  3481.  
  3482. Budd is a general book on object-oriented programming.  It deals with
  3483. primarily with general concepts, not syntax, and has examples in C++,
  3484. Objective C, Object Pascal, and Smalltalk.  It introduces the concepts
  3485. of classes and inheritance, as well as responsibility-driven design and
  3486. CRC cards.
  3487.  
  3488. Meyers is the best _second_ book on C++ that I know of.  It contains a
  3489. lot of general tips for writing better code.  The introduction alone
  3490. explained copy constructors better than some entire books.
  3491.  
  3492. I don't recommend Stroustrup as an introduction to C++, as it is way too
  3493. terse, but you really need it and/or the ARM as a language reference.
  3494.  
  3495. Good luck!
  3496.  
  3497. John Brewer
  3498. Wolfram Research, Inc.
  3499. (but speaking for myself)
  3500.  
  3501. ==============
  3502.  
  3503.  
  3504.      Interet: nick@pitt.edu         _/   _/  _/  _/_/_/   _/   _/  
  3505.       eWorld: nick                 _/_/ _/  _/  _/   _/  _/_/_/    
  3506.          CIS: 71232,766           _/ _/_/  _/  _/       _/ _/      
  3507.                                  _/   _/  _/   _/_/_/  _/   _/     
  3508.     
  3509.            "Science is nothing but perception" - Plato
  3510.  
  3511.  
  3512. +++++++++++++++++++++++++++
  3513.  
  3514. >From howard@netcom.com (Howard Berkey)
  3515. Date: Thu, 11 Aug 1994 19:46:36 GMT
  3516. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  3517.  
  3518. In article <32bpb8$fq2@scunix2.harvard.edu> anbrown@husc9.harvard.edu (anthony brown) writes:
  3519. >I know that this question has probably been ascked before, but I was 
  3520. >wondering which would be the best book on C++ programming on the mac.
  3521. >
  3522.  
  3523. I may get flamed for it, but I'll reiterate my opinion:  there are no
  3524. good books for learning C++ programming for any platform.
  3525.  
  3526. Your best bet is to pick up a good book on C++, i.e. the ARM, and to
  3527. pick up a good book on object oriented programming, like "Object
  3528. Oriented Programming: an evolutionary approach" by Cox and Novobilski,
  3529. or any other good OOP book.  Read the OOP book first.
  3530.  
  3531.  
  3532. >Could anyone recommend a book?
  3533. >
  3534. >I will be using symantech c++ 6.0.1 to learn, then after I get c++ down, 
  3535. >I'm switching to codewarrior. 
  3536. >
  3537.  
  3538. Do not use SC++ 6.x to learn C++.  At least update to the 7.x compiler
  3539. first.  There should be free updaters available on the net.
  3540.  
  3541. -H-
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548. -- 
  3549. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3550. Howard Berkey                                             howard@netcom.com   
  3551. Segmentation Fault (core dumped)
  3552.  
  3553. +++++++++++++++++++++++++++
  3554.  
  3555. >From nick+@pitt.edu ( nick.c )
  3556. Date: Thu, 11 Aug 94 20:31:46 GMT
  3557. Organization: The Pitt, Chemistry
  3558.  
  3559. In Article <howardCuDyxp.8oA@netcom.com>, howard@netcom.com (Howard Berkey)
  3560. wrote:
  3561.  
  3562. >Do not use SC++ 6.x to learn C++.  At least update to the 7.x compiler
  3563. >first.  There should be free updaters available on the net.
  3564.  
  3565.    ... at devtools.symantec.com and sumex-aim.stanford.edu.
  3566.  
  3567.  
  3568.      Interet: nick@pitt.edu         _/   _/  _/  _/_/_/   _/   _/  
  3569.       eWorld: nick                 _/_/ _/  _/  _/   _/  _/_/_/    
  3570.          CIS: 71232,766           _/ _/_/  _/  _/       _/ _/      
  3571.                                  _/   _/  _/   _/_/_/  _/   _/     
  3572.     
  3573.            "Science is nothing but perception" - Plato
  3574.  
  3575.  
  3576. +++++++++++++++++++++++++++
  3577.  
  3578. >From howard@netcom.com (Howard Berkey)
  3579. Date: Fri, 12 Aug 1994 05:58:36 GMT
  3580. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  3581.  
  3582. In article <nick+.1127024746C@usenet.pitt.edu> nick+@pitt.edu ( nick.c ) writes:
  3583. >In Article <howardCuDyxp.8oA@netcom.com>, howard@netcom.com (Howard Berkey)
  3584. >wrote:
  3585. >
  3586. >>Do not use SC++ 6.x to learn C++.  At least update to the 7.x compiler
  3587. >>first.  There should be free updaters available on the net.
  3588. >
  3589. >   ... at devtools.symantec.com and sumex-aim.stanford.edu.
  3590. >
  3591. >
  3592.  
  3593.  
  3594. Yep, thanks.  With any version greater than 6.0 you should be OK;
  3595. there were enough bugs in the point-oh version to make it very
  3596. frustrating to use to try to learn C++. 
  3597.  
  3598. ('you' referring to the original poster, of course).
  3599.  
  3600.  
  3601. -H-
  3602. -- 
  3603. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3604. Howard Berkey                                             howard@netcom.com   
  3605. Segmentation Fault (core dumped)
  3606.  
  3607. ---------------------------
  3608.  
  3609. >From ez046766@dale.ucdavis.edu ()
  3610. Subject: testing if a sound is done
  3611. Date: Mon, 1 Aug 1994 19:29:07 GMT
  3612. Organization: University of California, Davis
  3613.  
  3614. Thanks for all the help with playing sounds asynchronously! :)  I found some source code and used it, and it's working great!  But now I need one more thing, I need to test if a sound is done playing.  I've tried:
  3615.  
  3616. if( SoundDone() )
  3617.     SndPlay( myChannel, mySoundHandle, true );
  3618.  
  3619. but it seems like SoundDone() returns true even when a sound is playing, because I get a whole bunch of sounds going one after the other.
  3620.  
  3621. So am I using SoundDone() incorrectly, or do I test to see if sounds are done playing a different way? Any help would be greatly appreciated!!
  3622.  
  3623.    ....   ...  ( ..    .......
  3624.        ..     .   ...    ..         Sean Logan
  3625.      .......         ..     ...
  3626.    .....   .   .  ....   .          ez046766@dale.ucdavis.edu
  3627.     ..   .     |\                 
  3628.  ...           ; `------.  
  3629.              .'         ,~~   
  3630.           @ /  .-----,;'          
  3631.        @   @  @@     '           
  3632. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3633.  
  3634. +++++++++++++++++++++++++++
  3635.  
  3636. >From spencerl@crl.com (Spencer Low)
  3637. Date: 1 Aug 1994 14:33:52 -0700
  3638. Organization: LowTek Creations
  3639.  
  3640. (Please wrap your messages to 75 columns if possible. Makes it a whole 
  3641. lot easier to quote your stuff. Thanks :-)
  3642.  
  3643. Perhaps _SoundDone returns true, since the sound is done in the sense 
  3644. that SndPlay has returned (since it's asynchronous). Have you thought 
  3645. about using a completion routine that sets a flag? Then you could even be 
  3646. sound specific (i.e. if (FireSoundDone()) ...).
  3647.  
  3648. Spencer
  3649. -- 
  3650. ________________________________________________________________________
  3651.     Spencer Low ------- LowTek Creations ------- spencerl@crl.com
  3652.  
  3653. +++++++++++++++++++++++++++
  3654.  
  3655. >From cfranz@home.malg.imp.com (Christian Franz)
  3656. Date: Tue, 02 Aug 1994 15:18:28 +0000
  3657. Organization: Union Bank of Switzerland, CH
  3658.  
  3659. In article <CtvFGK.n4M@ucdavis.edu>, ez046766@dale.ucdavis.edu () wrote:
  3660.  
  3661. > Thanks for all the help with playing sounds asynchronously! :)  I found
  3662. some source code and used it, and it's working great!  But now I need one
  3663. more thing, I need to test if a sound is done playing.  I've tried:
  3664. > if( SoundDone() )
  3665. >         SndPlay( myChannel, mySoundHandle, true );
  3666. > but it seems like SoundDone() returns true even when a sound is playing,
  3667. because I get a whole bunch of sounds going one after the other.
  3668.  
  3669. I usually install a little callback procedure that sets a boolean flag for
  3670. the sound channel. Before starting the sound, I set the StillRunning flag 
  3671. to true. Then, in the callback proc, I set it to false.
  3672. Therefore, all my program has to do is to scan all allocated sound channels
  3673. (in an array of ExtendedSoundChannelH) to find those who have run out.
  3674.  
  3675. In case I don't sound too clear about it, the StillRunning flag is riding
  3676. piggyback on the normal sound channel data structure, much like the window
  3677. information rides on the GrafPort data struct.
  3678.  
  3679. > So am I using SoundDone() incorrectly, or do I test to see if sounds are
  3680. done playing a different way? Any help would be greatly appreciated!!
  3681. >
  3682.  
  3683. >    .....   .   .  ....   .          ez046766@dale.ucdavis.edu
  3684.  
  3685. Cheers,
  3686. Christian
  3687.  
  3688. -- 
  3689. Christian Franz                    *       Union Bank of Switzerland, CH
  3690. cfranz@home.malg.imp.com     <- at home ->               +41-1-261 26 96
  3691.                       -= Project Final Frontier =-
  3692.  
  3693.  
  3694. +++++++++++++++++++++++++++
  3695.  
  3696. >From Darrin Cardani <Darrin.Cardani@AtlantaGA.NCR.COM>
  3697. Date: Tue, 2 Aug 1994 13:40:50 GMT
  3698. Organization: AT&T Global Information Solutions, Atlanta
  3699.  
  3700. >In article <31jpo0$58f@crl5.crl.com> Spencer Low writes: 
  3701. >(Please wrap your messages to 75 columns if possible. Makes it a whole 
  3702. >lot easier to quote your stuff. Thanks :-)
  3703. >
  3704. >Perhaps _SoundDone returns true, since the sound is done in the sense 
  3705. >that SndPlay has returned (since it's asynchronous). Have you thought 
  3706. >about using a completion routine that sets a flag? Then you could even be 
  3707. >sound specific (i.e. if (FireSoundDone()) ...).
  3708.  
  3709. You could also try SndChannelStatus (); I believe it tells you when a sound
  3710. is done.
  3711.  
  3712. Darrin
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720. +++++++++++++++++++++++++++
  3721.  
  3722. >From reed@medicine.wustl.edu (Thomas Reed)
  3723. Date: Tue, 02 Aug 1994 10:29:38 -0500
  3724. Organization: Washington University
  3725.  
  3726. In article <CtvFGK.n4M@ucdavis.edu>, ez046766@dale.ucdavis.edu () wrote:
  3727.  
  3728. >Thanks for all the help with playing sounds asynchronously! :)  I found
  3729. some source code and used it, and it's working great!  But now I need one
  3730. more thing, I need to test if a sound is done playing.
  3731.  
  3732. It doesn't sound like the code you found did a very good job.  It should
  3733. define a completion routine that will run when the sound completes.  You
  3734. can use the completion routine to set a flag to say the sound is done.  Of
  3735. course, if you want continous, uninterupted sound, like looping music or
  3736. something like that, you have to do things very slightly differently.
  3737.  
  3738. If you're interested in some better source code, I've got some.  I won't
  3739. claim that my code is perfect, or even near perfect.  But it gets the job
  3740. done, and it's not unstable.  It just isn't very flexible.  (Mainly
  3741. because it did what I needed it to, so I didn't bother to refine it
  3742. further.)  In the source code for my shareware solitaire game, you can
  3743. find a custom sound library.  I believe that the only place the code is
  3744. available right now is here:
  3745.  
  3746.   ftp://thomas_mac.wustl.edu/Public/for_ftp/Solitaire_code.sit
  3747.  
  3748. It was done in THINK C 5.0.
  3749.  
  3750. Hope this helps!  Let me know if you have any questions about my code...
  3751.  
  3752. -Thomas
  3753.  
  3754. =====================================================
  3755. Thomas Reed                     Washington University
  3756. reed@telesphere.wustl.edu           Medical School
  3757. reed@medicine.wustl.edu            Saint Louis, MO
  3758. - ---------------------------------------------------
  3759. Clothes make the man.  Naked people have little or no
  3760. influence on society.  -- Mark Twain
  3761. =====================================================
  3762.  
  3763. Opinions posted are not the opinions of Wash. U.
  3764.  
  3765. ---------------------------
  3766.  
  3767. End of C.S.M.P. Digest
  3768. **********************
  3769.  
  3770.  
  3771.