home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Information / Digests / CSMP Digest / volume 3 / csmp-digest-v3-052 / doubleCR.1 < prev   
Encoding:
Text File  |  1995-12-31  |  135.3 KB  |  3,804 lines

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