home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-130.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  46.8 KB  |  1,317 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Fri, 03 Jul 92       Volume 1 : Issue 130
  2.  
  3. Today's Topics:
  4.  
  5.     Summary: Center Alerts?
  6.     GWorlds and Off Screen Bitmaps....
  7.     yacc for Think C 5.0?
  8.     Proper way to copy file
  9.     ?How to tell locked file?
  10.     Troubles with TCL CStdPopupPane
  11.     Postscript files - Printing -
  12.     Info about AppMaker v1.2 and MacApp
  13.     MPW C Error Funnies
  14.     high-speed serial communications (again)
  15.  
  16.  
  17.  
  18. -------------------------------------------------------
  19.  
  20. From: jryan@adobe.com (Jim Ryan)
  21. Subject: Summary: Center Alerts?
  22. Organization: Adobe Systems Incorporated
  23. Date: Mon, 18 May 1992 20:57:09 GMT
  24.  
  25. Here's the C code snipet that I used to center alerts... it's not pretty, 
  26. but it works.  If anyone has any suggestions to better this code, please 
  27. let me know.  Thanks to all who pointed me in the right direction with 
  28. the excellent advice!
  29.  
  30. //--------------------------------------------------------------------------
  31. void CenterAlert(int alertID)
  32. {
  33.     Rect     **theRectHandle;
  34.     Rect     *theRectPointer;
  35.     int     width, height;
  36.     
  37.     // get a handle
  38.     if ((theRectHandle = (Rect **)GetResource('ALRT', alertID))) {
  39.     
  40.         // dereference handle
  41.         HLock(theRectHandle);
  42.         theRectPointer = *theRectHandle;
  43.         HUnlock(theRectHandle);
  44.         
  45.         // get the alert's dimensions
  46.         width = theRectPointer->right - theRectPointer->left;
  47.         height = theRectPointer->bottom - theRectPointer->top;
  48.         
  49.         // change the alert's bounds in memory
  50.         theRectPointer->top = 20 + gDragRect.top + ((gDragRect.bottom - 
  51.                                                     gDragRect.top) - height) / 3;
  52.         theRectPointer->bottom = theRectPointer->top + height;
  53.         theRectPointer->left = gDragRect.left + ((gDragRect.right - 
  54.                                                     gDragRect.left) - width) / 2;
  55.         theRectPointer->right = theRectPointer->left + width;
  56.         
  57.         // let go of the sucker
  58.         ReleaseResource(theRectHandle);
  59.     }
  60. }
  61. //--------------------------------------------------------------------------
  62.  
  63. jr
  64.  
  65. +++++++++++++++++++++++++++
  66.  
  67. From: Meessen@slig.ucl.ac.be (Christophe Meessen)
  68. Date: 19 May 92 08:14:01 GMT
  69. Organization: Universite Catholique de Louvain (Belgium)
  70.  
  71. some comments:
  72.  
  73. In article <1992May18.205709.1977@adobe.com>, jryan@adobe.com (Jim Ryan)
  74. writes:
  75. > Here's the C code snipet that I used to center alerts... it's not pretty, 
  76. > but it works.  If anyone has any suggestions to better this code, please 
  77. > let me know.  Thanks to all who pointed me in the right direction with 
  78. > the excellent advice!
  79. > //--------------------------------------------------------------------------
  80. > void CenterAlert(int alertID)
  81. > {
  82. >     Rect     **theRectHandle;
  83. >     Rect     *theRectPointer;
  84. >     int     width, height;
  85. >     
  86. >     // get a handle
  87. >     if ((theRectHandle = (Rect **)GetResource('ALRT', alertID))) {
  88. >     
  89. >         // dereference handle
  90. >         HLock(theRectHandle);
  91.  
  92. You don't realy need to lock the bloc because none of the following
  93. instructions will move blocs in memory.
  94.  
  95. >         theRectPointer = *theRectHandle;
  96. >         HUnlock(theRectHandle);
  97.  
  98. theRectPointer is a pointer on the bloc. Unlocking the bloc may change this
  99. pointer into a dangling pointer. Unlocking should be done when the pointer
  100. is no more used. BTW it isn't necessary in this code.
  101.  
  102. >         
  103. >         // get the alert's dimensions
  104. >         width = theRectPointer->right - theRectPointer->left;
  105. >         height = theRectPointer->bottom - theRectPointer->top;
  106. >         
  107. >         // change the alert's bounds in memory
  108. >         theRectPointer->top = 20 + gDragRect.top + ((gDragRect.bottom - 
  109. >                                                     gDragRect.top) - height) / 3;
  110.  
  111. gDragRect is a program global variable. To use this code, we must declare
  112. this global and set it's value. What value ?
  113. Better use the screenBits.bounds which is a system global variable. It will
  114. give the same result and the user won't have to care about gDragRect.
  115. Note1: 20 is the Menu_Bar_height
  116. Note2: this alert is not verticaly centered. 
  117.  
  118.                _______________________________________...s.top = 0
  119.             |_____Menu____________________________|
  120.             |                  .                  |
  121.             |          _________________..........|...(s.bottom - height)/3
  122.             |          |       .       |          |
  123.             |..........|.......x.......|..........|...s.bottom / 3
  124.             |          |       .       |          |
  125.             |          |       .       |          |
  126.             |          |       .<-1/2->|          |
  127.             |          |_______________|          |
  128.             |                  .                  |
  129.             |                  .                  |
  130.             |                  .<------1/2------->|
  131.             |                  .                  |
  132.             |                  .                  |
  133.                |_____________________________________|...s.bottom
  134.  
  135.  
  136. On all screens screenBits.bounds.top = screenBits.bounds.left = 0. We may
  137. ignore the menu_bar_height in the positioning of the Alert. We can than
  138. compute the Alert rect with the following functions: 
  139.  
  140. theRectPointer->top = ( screenBits.bounds.bottom - height ) / 3;
  141. theRectPointer->bottom = theRectPointer->top + height;
  142. theRectPointer->left = ( screenBits.bounds.left - width ) / 2;
  143. theRectPointer->right = theRectPointer->left + width;
  144.  
  145. >         theRectPointer->bottom = theRectPointer->top + height;
  146. >         theRectPointer->left = gDragRect.left + ((gDragRect.right - 
  147. >                                                     gDragRect.left) - width) / 2;
  148. >         theRectPointer->right = theRectPointer->left + width;
  149. >         
  150. >         // let go of the sucker
  151. >         ReleaseResource(theRectHandle);
  152. >     }
  153. > }
  154. > //--------------------------------------------------------------------------
  155. > jr
  156.  
  157.  
  158. Chris
  159.  
  160. +++++++++++++++++++++++++++
  161.  
  162. From: keith@taligent.com (Keith Rollin)
  163. Date: 19 May 92 23:07:22 GMT
  164. Organization: Taligent
  165.  
  166. In article <1992May18.205709.1977@adobe.com>, jryan@adobe.com (Jim Ryan) writes:
  167. > Here's the C code snipet that I used to center alerts... it's not pretty, 
  168. > but it works.  If anyone has any suggestions to better this code, please 
  169. > let me know.  Thanks to all who pointed me in the right direction with 
  170. > the excellent advice!
  171. > ...
  172. >         theRectPointer->top = 20 + gDragRect.top + ((gDragRect.bottom - 
  173. >                                                     gDragRect.top) - height) / 3;
  174.  
  175. Are you using 20 to take into account the height of the menubar? If so, call
  176. GetMBarHeight() instead.
  177.  
  178. - --
  179. Keith Rollin
  180. Phantom Programmer
  181. Taligent, Inc.
  182.  
  183. +++++++++++++++++++++++++++
  184.  
  185. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  186. Organization: NCRPDA, Curtin University
  187. Date: Thu, 21 May 1992 01:27:09 GMT
  188.  
  189. In article <1992May18.205709.1977@adobe.com>, jryan@adobe.com (Jim Ryan) writes:
  190.  
  191. > //--------------------------------------------------------------------------
  192. > void CenterAlert(int alertID)
  193. > {
  194. >     Rect     **theRectHandle;
  195. >     Rect     *theRectPointer;
  196. >     int     width, height;
  197. >     
  198. >     // get a handle
  199. >     if ((theRectHandle = (Rect **)GetResource('ALRT', alertID))) {
  200. >     
  201. >         // dereference handle
  202. >         HLock(theRectHandle);
  203. >         theRectPointer = *theRectHandle;
  204. >         HUnlock(theRectHandle);
  205. >         
  206. >         // get the alert's dimensions
  207. >         width = theRectPointer->right - theRectPointer->left;
  208. >         height = theRectPointer->bottom - theRectPointer->top;
  209. >         
  210. >         // change the alert's bounds in memory
  211. >         theRectPointer->top = 20 + gDragRect.top + ((gDragRect.bottom - 
  212. >                                                     gDragRect.top) - height) / 3;
  213. >         theRectPointer->bottom = theRectPointer->top + height;
  214. >         theRectPointer->left = gDragRect.left + ((gDragRect.right - 
  215. >                                                     gDragRect.left) - width) / 2;
  216. >         theRectPointer->right = theRectPointer->left + width;
  217. >         
  218. >         // let go of the sucker
  219. >         ReleaseResource(theRectHandle);
  220. >     }
  221. > }
  222.  
  223. Two comments on this code.  First, when you dereference a handle like that,
  224. you need to keep it locked for as long as you have the dereferenced 
  225. value stored in a local variable.  So the HUnlock should be just before
  226. the ReleaseResource.
  227.  
  228. Second (and totally the opposite :), you don't need to lock the handle
  229. unless you are going to call a procedure that can move memory.  A safe
  230. bet is to assume that any toolbox call except BlockMove and FSRead/Write
  231. (perhaps someone could give a list of all calls which Apple guarentees
  232. will never move memory, since the list of traps which can is ever growing).
  233. Also note that any procedure call you make to a different segment may
  234. move memory - this is particularly important if you use objects which
  235. are implemented as handles....  Anyway, a very safe assumption is that
  236. straight arithmetic stuff like you have in the above code will not move 
  237. memory, so the HLock and HUnlock is redundant, but if you really want
  238. to use it, put the HUnlock at the bottom just before the ReleaseResource.
  239.  
  240. A third comment is on the validity of that code - if you release the 
  241. resource surely the handle will (or could?) be disposed and all your 
  242. work will be wasted... shouldn't you wait til after the Alert call
  243. before you release it?
  244.  
  245. Have fun all,
  246.    Peter.
  247.  
  248. ______________________________________________________________________
  249. Peter N Lewis, NCRPDA, Curtin University      peter@cujo.curtin.edu.au
  250. GPO Box U1987, Perth WA 6001, AUSTRALIA            FAX: +61 9 367 8141
  251.  
  252.  
  253.  
  254. +++++++++++++++++++++++++++
  255.  
  256. From: mxmora@unix.SRI.COM (Matt Mora)
  257. Date: 19 May 92 17:20:14 GMT
  258. Organization: SRI International, Menlo Park, California
  259.  
  260. In article <1992May18.205709.1977@adobe.com> jryan@adobe.com (Jim Ryan) writes:
  261. >Here's the C code snipet that I used to center alerts... it's not pretty, 
  262. >but it works.  If anyone has any suggestions to better this code, please 
  263. >let me know.  Thanks to all who pointed me in the right direction with 
  264. >the excellent advice!
  265.  
  266. >        // let go of the sucker
  267. >        ReleaseResource(theRectHandle);
  268.                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  269.  
  270. This code actually works? It was my understanding to read in the alert
  271. data into a handle, adjust the rect coordinates and then call alert.
  272. The alert call will then deal with the preloaded resources.
  273.  
  274.  
  275.  
  276.  
  277. Matt
  278.  
  279. - -- 
  280. ___________________________________________________________
  281. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  282. SRI International           |  my unix  mxmora@unix.sri.com
  283. ___________________________________________________________
  284.  
  285. +++++++++++++++++++++++++++
  286.  
  287. From: jryan@adobe.com (Jim Ryan)
  288. Organization: Adobe Systems Incorporated
  289. Date: Wed, 27 May 1992 00:04:25 GMT
  290.  
  291. > >        // let go of the sucker
  292. > >        ReleaseResource(theRectHandle);
  293. >                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  294. > This code actually works? It was my understanding to read in the alert
  295. > data into a handle, adjust the rect coordinates and then call alert.
  296. > The alert call will then deal with the preloaded resources.
  297. > Matt
  298.  
  299. Unbelievable as it may appear, it works... I found that if I didn't let go, 
  300. then all hell would break loose if the alert was immediately called again... 
  301. like it would not show up the second call, it would be 20x20000 the next , the
  302.  next time it wouldn't appear, etc, etc.  How, why, I have no idea...
  303.  
  304. jr
  305.  
  306. +++++++++++++++++++++++++++
  307.  
  308. From: jryan@adobe.com (Jim Ryan)
  309. Organization: Adobe Systems Incorporated
  310. Date: Wed, 27 May 1992 20:47:08 GMT
  311.  
  312. I lied.... I was fooled by the ResEdit feature that centers windows 
  313. under System 7.  Matt is correct, releasing the resource will cause the 
  314. alert to NOT 
  315. be centered.  My problem with calling the alert multiple times seems 
  316. to have vanished, as it appears to work now.  Hmmm.  Thanks to Matt 
  317. for pointing the problem out!
  318.  
  319. jr
  320.  
  321. +++++++++++++++++++++++++++
  322.  
  323. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  324. Organization: Royal Institute of Technology, Stockholm, Sweden
  325. Date: Thu, 28 May 1992 10:32:13 GMT
  326.  
  327. > jryan@adobe.com (Jim Ryan) writes:
  328.  
  329.    under System 7.  Matt is correct, releasing the resource will cause the 
  330.    alert to NOT 
  331.    be centered.  My problem with calling the alert multiple times seems 
  332.    to have vanished, as it appears to work now.  Hmmm.  Thanks to Matt 
  333.  
  334.  
  335. However, I still have, and have had for some time, the same
  336. problem with GetResource - set rectangle - Alert failing
  337. and giving me strange alert rects outside the screen. This
  338. is using the Think Class Library code... so I scrapped that
  339. and only use System 7 auto-position (we are system 7
  340. dependant anyway)
  341.  
  342. - -- 
  343. h++ - new and improved !
  344.  
  345. A Bus Station is where buses stop. A Train Station is where
  346. trains stop. On my desk, there is a Work Station.
  347.  
  348. +++++++++++++++++++++++++++
  349.  
  350. From: Meessen@slig.ucl.ac.be  (Christophe Meessen)
  351. Organization: Universite Catholique de Louvain (Belgium)
  352. Date: Tue, 2 Jun 1992 13:42:19 GMT
  353.  
  354. I submit here the source code as I tested it. It's a compilation of all
  355. remarks. 
  356.  
  357. I tested it on a Classic OS 7.0, Mac Plus OS 6.5 with an A4 Radius screen
  358. and a SE30 OS 6.5 with the Apple 21' b&w screen. 
  359.  
  360. It is OS 7.0 independent !
  361.  
  362.  
  363.  
  364. //--------------------------------------------------------------------------
  365.  void CenteredAlert(int alertID)
  366.  {
  367.        Rect     **theRectHandle;
  368.        Rect     *theRectPointer;
  369.        int     width, height;
  370.      
  371.        // get a handle
  372.        if ((theRectHandle = (Rect **)GetResource('ALRT', alertID))) {
  373.      
  374.              // dereference handle
  375.              theRectPointer = *theRectHandle;
  376.          
  377.              // get the alert's dimensions
  378.              width = theRectPointer->right - theRectPointer->left;
  379.              height = theRectPointer->bottom - theRectPointer->top;
  380.          
  381.              // change the alert's bounds in memory
  382.              theRectPointer->top = ( GetMBarHeight() +
  383. qd.screenBits.bounds.bottom -
  384.                                                                   height) /
  385. 3;
  386.              theRectPointer->bottom = theRectPointer->top + height;
  387.              theRectPointer->left = (qd.screenBits.bounds.right - width) / 2;
  388.              theRectPointer->right = theRectPointer->left + width;
  389.          
  390.              // show the alert
  391.              Alert( alertID,NULL );
  392.          
  393.              // let go of the sucker
  394.              ReleaseResource(theRectHandle);
  395.           }
  396.  }
  397.  
  398. main(){
  399.  
  400.    InitGraf((Ptr) &qd.thePort);
  401.    InitFonts();
  402.    InitWindows();
  403.    InitMenus();
  404.    TEInit();
  405.    InitDialogs(nil);
  406.    InitCursor();
  407.     
  408.    CenteredAlert    ( 128 );
  409. }
  410.  
  411. Bien cordialement,
  412.  
  413.                            Christophe MEESSEN
  414.  
  415. ---------------------------
  416.  
  417. From: danny@utkux1.utk.edu (Danny McCampbell)
  418. Subject: GWorlds and Off Screen Bitmaps....
  419. Organization: University of Tennessee
  420. Date: Wed, 27 May 1992 19:25:45 GMT
  421.  
  422. Could someone please give me a piece of Code that will let me create and
  423. use offscreen GWorlds.
  424.  
  425. I cannot to save my life get Tech Note 120's code to work.
  426.  
  427. All I want to do is copy a color picture to the GWorld and back on
  428. screen to get rid of the flicker.
  429.  
  430. Thanks.
  431.  
  432. Danny    
  433.  
  434. +++++++++++++++++++++++++++
  435.  
  436. From: parsogd@wkuvx1.bitnet (Geoffrey Parsons, WKU)
  437. Date: 1 Jun 92 16:23:39 GMT
  438. Organization: Western Kentucky University, Bowling Green, KY
  439.  
  440. In article <1992May27.192545.12646@utkux1.utk.edu>, danny@utkux1.utk.edu (Danny McCampbell) writes:
  441. > Could someone please give me a piece of Code that will let me create and
  442. > use offscreen GWorlds.
  443. > I cannot to save my life get Tech Note 120's code to work.
  444. > All I want to do is copy a color picture to the GWorld and back on
  445. > screen to get rid of the flicker.
  446.  
  447.   If you are using system 7 (and don't need sys6 support) then I would
  448. suggest looking it to the GWorld (NewGWorld) routines in IM6. I too have
  449. messed around with the technote crap to no avail. These routines seem to
  450. work fine for me.
  451.  
  452. Cheers,
  453. Geoffrey Parsons
  454.  
  455. +++++++++++++++++++++++++++
  456.  
  457. From: leue@crd.ge.com (Bill Leue)
  458. Date: 2 Jun 92 12:49:27 GMT
  459. Organization: General Electric Research & Development
  460.  
  461. Also, Scott Knaster and Keith Rollins's new Book, "Macintosh Programming
  462. Secrets, 2nd Edition" has some nice code showing how to use GWorlds for
  463. various jobs, including saving parts of the screen underneath dialogs
  464. and the like for faster screen repair.
  465.  
  466. - -Bill Leue
  467. leue@crd.ge.com
  468.  
  469. Disclaimer:  No, Keith's NOT giving me a commission for plugs - I just like
  470. the book!
  471.  
  472. +++++++++++++++++++++++++++
  473.  
  474. From: Sherman@128.147.155.27 (Sherman Uitzetter)
  475. Date: 2 Jun 92 14:29:27 GMT
  476. Organization: NMRI Pittsburgh
  477.  
  478.  
  479.  
  480.      The GWorld routines in IM6 will work with system 6.0.7 and greater.
  481.  
  482.  
  483. - -Sherman.
  484.  
  485. ---------------------------
  486.  
  487. From: tequila@ccwf.cc.utexas.edu (Mario Garcia)
  488. Subject: yacc for Think C 5.0?
  489. Date: 27 May 92 21:57:13 GMT
  490. Organization: The University of Texas at Austin, Austin TX
  491.  
  492. Hello again,
  493.  
  494. After reading Kernighan & Pike's excellent discussion of yacc (_The UNIX
  495. Programming Environment_, chapter 8) and trying out a few things on the
  496. unix machine, I thought it would be really neat to have something similar
  497. to work on my mac.  I tried Bison but the code it generates is not compatible
  498. with Think-C 5.0, and I don't haveW.  Is there a stand-alone yacc derivative
  499. that generates ANSI compatible code?  Thanks for any leads on this.
  500.  
  501. - -------------------------------------------------------------------------------
  502. Mario L. Garcia                                     1212 Guadalupe Apt. 802
  503. Mathematics Student                                 Austin, TX 78701
  504. The University of Texas at Austin                   (512)479-8621
  505. e-mail tequila@ccwf.cc.utexas.edu
  506. - -------------------------------------------------------------------------------
  507.  
  508.  
  509. +++++++++++++++++++++++++++
  510.  
  511. From: mike@uunet!tellab5!odgate (Mike J. Kelly)
  512. Organization: Odesta Corporation
  513. Date: Fri, 29 May 1992 20:21:31 GMT
  514.  
  515. tequila@ccwf.cc.utexas.edu (Mario Garcia) writes:
  516.  
  517. >Hello again,
  518.  
  519. >After reading Kernighan & Pike's excellent discussion of yacc (_The UNIX
  520. >Programming Environment_, chapter 8) and trying out a few things on the
  521. >unix machine, I thought it would be really neat to have something similar
  522. >to work on my mac.  I tried Bison but the code it generates is not compatible
  523. >with Think-C 5.0, and I don't haveW.  Is there a stand-alone yacc derivative
  524. >that generates ANSI compatible code?  Thanks for any leads on this.
  525.  
  526. >-------------------------------------------------------------------------------
  527. >Mario L. Garcia                                     1212 Guadalupe Apt. 802
  528. >Mathematics Student                                 Austin, TX 78701
  529. >The University of Texas at Austin                   (512)479-8621
  530. >e-mail tequila@ccwf.cc.utexas.edu
  531. >-------------------------------------------------------------------------------
  532.  
  533. There is an MPW tool called MacYACC available from Abraxas Software in
  534. Portland.  The code it generates should be compatible with Think C; we
  535. compile it in Think C after massaging it a bit with a MPW script to make
  536. it comply with some internal coding issues not relevant here.
  537.  
  538. Abraxas Software, 1-800-347-5214 or 503-244-5253.
  539. - -- 
  540. - --
  541. Mike Kelly               Odesta Corporation, Northbrook, Illinois, USA
  542. ...!clout!odgate!mike    - Until odesta.com is registered.
  543. odgate!mike@clout.uucp   - From the Internet.
  544.  
  545. +++++++++++++++++++++++++++
  546.  
  547. From: eldred@rrunner.jpl.nasa.gov (Dan Eldred)
  548. Date: 3 Jun 92 02:10:17 GMT
  549. Organization: Jet Propulsion Laboratory
  550.  
  551. In article <1992May29.202131.8873@uunet!tellab5!odgate> mike@uunet!tellab5!odgate (Mike J. Kelly) writes:
  552. >tequila@ccwf.cc.utexas.edu (Mario Garcia) writes:
  553. >
  554. >>Hello again,
  555. >
  556. >>After reading Kernighan & Pike's excellent discussion of yacc (_The UNIX
  557. >>Programming Environment_, chapter 8) and trying out a few things on the
  558. >>unix machine, I thought it would be really neat to have something similar
  559. >>to work on my mac.  I tried Bison but the code it generates is not compatible
  560. >>with Think-C 5.0, and I don't haveW.  Is there a stand-alone yacc derivative
  561. >>that generates ANSI compatible code?  Thanks for any leads on this.
  562. >
  563. I've been using Bison with Think C 4.0 and I have successfully compiled
  564. a number of smallish examples, as well as a huge language grammer (it
  565. compiles the gram.y file but the code's still being worked on).  Haven't
  566. tried Bison with Think C 5.0 yet but I doubt there will be any problems,
  567. except perhaps that some of the checking (e.g. prototypes) may have to
  568. be relaxed.
  569.  
  570. Included is other response:
  571. >
  572. >There is an MPW tool called MacYACC available from Abraxas Software in
  573. >Portland.  The code it generates should be compatible with Think C; we
  574. >compile it in Think C after massaging it a bit with a MPW script to make
  575. >it comply with some internal coding issues not relevant here.
  576. >
  577. >Abraxas Software, 1-800-347-5214 or 503-244-5253.
  578. >-- 
  579. >--
  580.  
  581. - --Dan Eldred, eldred@rrunner.jpl.nasa.gov
  582.  
  583. ---------------------------
  584.  
  585. Subject: Proper way to copy file
  586. From: skinner@oread.cc.ukans.edu
  587. Date: 28 May 92 01:01:51 CST
  588. Organization: University of Kansas Academic Computing Serces
  589.  
  590.  
  591. What is the proper way to go about copying a file.  I have a
  592. file reference number and know how to go about getting
  593. a path name but am unsure how to procede.  I tried using
  594. PBHFileCopy but can't seem to get the field of the
  595. paramaBlockRec filled in correctly (error -50).  I bit of
  596. help would be much appreciated.
  597.  
  598. For the purposes of having it in the archives in a month
  599. or so, I will post my results.
  600.  
  601. Thanks.
  602.  
  603. +++++++++++++++++++++++++++
  604.  
  605. From: mxmora@unix.SRI.COM (Matt Mora)
  606. Date: 2 Jun 92 21:17:08 GMT
  607. Organization: SRI International, Menlo Park, California
  608.  
  609. In article <1992May28.010151.1@oread.cc.ukans.edu> skinner@oread.cc.ukans.edu writes:
  610.  
  611. >What is the proper way to go about copying a file.  I have a
  612. >file reference number and know how to go about getting
  613. >a path name but am unsure how to procede.  I tried using
  614. >PBHFileCopy but can't seem to get the field of the
  615. >paramaBlockRec filled in correctly (error -50).  I bit of
  616. >help would be much appreciated.
  617.  
  618. That call is only support on a few volumes like appleshare servers.
  619. You need to check the volume to see if it supports that call.
  620. Other wise you have to do the copy yourself.
  621.  
  622. If you didn't already get an answer to this question , email me and I'll
  623. send you some code that does what you want. Since this question was
  624. asked a little while ago (by myself I think) I don't want to post
  625. the answer again.
  626.  
  627. Matt
  628.  
  629.  
  630. - -- 
  631. ___________________________________________________________
  632. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  633. SRI International           |  my unix  mxmora@unix.sri.com
  634. ___________________________________________________________
  635.  
  636. ---------------------------
  637.  
  638. From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
  639. Subject: ?How to tell locked file?
  640. Date: 28 May 92 13:30:21 GMT
  641. Organization: MSD
  642.  
  643. I have a simple problem:
  644.  
  645. How do I tell if the file I'm opening is a locked file?  The definition
  646. of locked could fall under a number of different cases: the file could
  647. be on a locked volume (CD-ROM or locked floppy), it could be locked via
  648. that little checkboxie in the Finder, or it could be on an AppleShare
  649. volume that doesn't give me write access (is this the same as case 1?).
  650.  
  651. In any event, I need to determine if the file is un-updatable.  The only
  652. way I can determine to do this is to check both the volume and the
  653. file separately to see if they are locked.  Is there a better way?
  654.  
  655. chuck
  656.  
  657. (                       --chuck mcmath-
  658.                     mcmath@csb1.nlm.nih.gov
  659.   MSD, Inc. * National Library of Medicine * National Institutes of Health
  660.                        Bethesda, MD 20894
  661.  
  662. +++++++++++++++++++++++++++
  663.  
  664. From: REEKES@applelink.apple.com (Jim Reekes)
  665. Date: 28 May 92 23:57:34 GMT
  666. Organization: Apple Computer, Inc.
  667.  
  668. In article <1992May28.133021.3824@nlm.nih.gov>, mcmath@csb1.nlm.nih.gov (Chuck McMath) writes:
  669. > I have a simple problem:
  670. > How do I tell if the file I'm opening is a locked file?  The definition
  671. > of locked could fall under a number of different cases: the file could
  672. > be on a locked volume (CD-ROM or locked floppy), it could be locked via
  673. > that little checkboxie in the Finder, or it could be on an AppleShare
  674. > volume that doesn't give me write access (is this the same as case 1?).
  675. > In any event, I need to determine if the file is un-updatable.  The only
  676. > way I can determine to do this is to check both the volume and the
  677. > file separately to see if they are locked.  Is there a better way?
  678.  
  679.  
  680. I think the best way to determine if a file is "writable" is to open
  681. the file and then set the EOF to the current EOF. 
  682.  
  683. The problem really is that you can never tell if the state of writability
  684. has changed since the last time you checked.  So, my advice is to just
  685. check by always handling errors returned by the File System.  You may
  686. want to check once up front telling the user that the file cannot be
  687. modified by getting the current EOF and then attempting to set it to
  688. the same EOF mark.  But if the permission status of the file has changed
  689. after then check, you may get errors when you attempt to update the file
  690. later.
  691.  
  692.  
  693. - -----------------------------------------------------------------------
  694. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  695.                              |          Sound Manager Expert
  696. Apple Computer, Inc.         | "All opinions expressed are mine, and do
  697. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  698. Cupertino, CA 95014          |       employer, Apple Computer Inc."
  699.  
  700. +++++++++++++++++++++++++++
  701.  
  702. From: brod@jessica.stanford.edu (Brodie Lockard)
  703. Date: 3 Jun 92 06:43:38 GMT
  704. Organization: Academic Information Resources
  705.  
  706. In article <1992May28.133021.3824@nlm.nih.gov> mcmath@csb1.nlm.nih.gov (Chuck McMath) writes:
  707.  
  708. >How do I tell if the file I'm opening is a locked file? 
  709.  
  710. I do a GetFInfo followed by a SetFInfo.
  711.  
  712. Brodie Lockard      brod@jessica.stanford.edu
  713.  
  714. ---------------------------
  715.  
  716. From: gregt@function.mps.ohio-state.edu (Gregory M Ferrar)
  717. Subject: Troubles with TCL CStdPopupPane
  718. Organization: Department of Mathematics, The Ohio State University
  719. Date: Fri, 29 May 1992 21:53:39 GMT
  720.  
  721. I'm trying to write a program using Think C 5.0, TCL 1.1.2, using popup menus.
  722. I'm using a Quadra 700, running System 7.0.1 with TuneUp 1.0.  When a new
  723. document is created, I set up the window and install the popup menu as follows:
  724.  
  725.    /* Create the problem subtype popup menu pane */
  726.    subtype_menu_pane = new (CStdPopupPane);
  727.    subtype_menu_pane->IStdPopupPane(133, the_window, document,
  728.                                      kAutoSize, kAutoSize, 37, 22);
  729.  
  730. The popup menu is stored in MENU resource #133.  This works fine.  But if I
  731. change the 133 above to 134, and change the MENU id to 134, it fails.  It
  732. correctly draws and pops up the menu, but it doesn't update the menu to the
  733. new selection, as it does when the MENU id is 133.
  734.  
  735. The only IDs which seem to work are 128, 129, 131, and 133 (though I can't say
  736. I've tried all 65536 of them).
  737.  
  738. Any ideas why this isn't working?  There's nothing strange about the menu, and
  739. changing the menu doesn't help.  If I put two popups in the window, one with
  740. ID 133 and the other 134, the 133 works but the 134 doesn't.
  741.  
  742.   -Greg Ferrar (gregt@function.mps.ohio-state.edu)
  743.  
  744.  
  745. +++++++++++++++++++++++++++
  746.  
  747. From: keith@taligent.com (Keith Rollin)
  748. Date: 1 Jun 92 00:27:47 GMT
  749. Organization: Taligent
  750.  
  751. In article <1992May29.215339.24140@zaphod.mps.ohio-state.edu>,
  752. gregt@function.mps.ohio-state.edu (Gregory M Ferrar) writes:
  753. > I'm trying to write a program using Think C 5.0, TCL 1.1.2, using popup menus.
  754. > I'm using a Quadra 700, running System 7.0.1 with TuneUp 1.0.  When a new
  755. > document is created, I set up the window and install the popup menu as
  756. follows:
  757. >    /* Create the problem subtype popup menu pane */
  758. >    subtype_menu_pane = new (CStdPopupPane);
  759. >    subtype_menu_pane->IStdPopupPane(133, the_window, document,
  760. >                                      kAutoSize, kAutoSize, 37, 22);
  761. > The popup menu is stored in MENU resource #133.  This works fine.  But if I
  762. > change the 133 above to 134, and change the MENU id to 134, it fails.  It
  763. > correctly draws and pops up the menu, but it doesn't update the menu to the
  764. > new selection, as it does when the MENU id is 133.
  765. > The only IDs which seem to work are 128, 129, 131, and 133 (though I can't say
  766. > I've tried all 65536 of them).
  767. > Any ideas why this isn't working?  There's nothing strange about the menu, and
  768. > changing the menu doesn't help.  If I put two popups in the window, one with
  769. > ID 133 and the other 134, the 133 works but the 134 doesn't.
  770.  
  771.  
  772. Make sure that _both_ the MENU ID and the resource ID of your MENU resource are
  773. 134. TCL assumes that both numbers are the same, as does the popupmenu CDEF in
  774. System 7.
  775.  
  776. - --
  777. Keith Rollin
  778. Phantom Programmer
  779. Taligent, Inc.
  780.  
  781.  
  782. ---------------------------
  783.  
  784. From: jharvey@csulx.weber.edu (Justin Harvey)
  785. Subject: Postscript files - Printing -
  786. Organization: Weber State University, Ogden Utah
  787. Date: Fri, 29 May 92 23:04:53 GMT
  788.  
  789. I'd like to know if anyone can tell me how to print postscript files
  790. on a Macintosh connected to a Laserwriter?
  791.  
  792. +-----------------------------------------+
  793. |             Justin Harvey               |
  794. - -------------------------------------------
  795. |          6734-a Marguerite St.          |
  796. |            Juneau, AK 99801             |
  797. | jharvey@darknova.acf-lab.alaska.edu  &  |
  798. | jharvey@csulx.weber.edu  (News account) |
  799. |          University of Alaska           |
  800. +-----------------------------------------+
  801.  
  802. +++++++++++++++++++++++++++
  803.  
  804. From: brett_lindenbach@qms1.life.uiuc.edu (brett lindenbach)
  805. Date: 31 May 92 15:18:00 GMT
  806. Organization: microbiology, univ. illinois
  807.  
  808. In article <1992May29.230453.22235@fcom.cc.utah.edu>, jharvey@csulx.weber.edu (Justin Harvey) writes:
  809. > I'd like to know if anyone can tell me how to print postscript files
  810. > on a Macintosh connected to a Laserwriter?
  811. Indeed, I do (one of the few questions on this group I can answer). There 
  812. exists a utility from Apple called Laserwriter Utility. It should be found
  813. on the ftp site: ftp.apple.com login:anon. pswd:e-address. This application
  814. permits one to dump directly to the printer. However, it only works for Apple
  815. printers. I have an hp laserjet ///, and here's what I do:
  816.      - load document into MSWord
  817.      - select whole document (option-command-m)
  818.      - pull-down FORMAT menu to "Define All Styles"
  819.        (this appears only if you select it with "Commands...")
  820.      - select the postscript style, and APPLY to document
  821.      - print
  822. Best o'luck... BDL
  823.  
  824. +++++++++++++++++++++++++++
  825.  
  826. From: rrichter@link.ph.gmr.com (Roy Richter PH/32)
  827. Date: 1 Jun 92 15:26:31 GMT
  828. Organization: GM Research, Warren, Mi
  829.  
  830. |> In article <1992May29.230453.22235@fcom.cc.utah.edu>, jharvey@csulx.weber.edu (Justin Harvey) writes:
  831. |> > 
  832. |> > I'd like to know if anyone can tell me how to print postscript files
  833. |> > on a Macintosh connected to a Laserwriter?
  834. |> > 
  835.  
  836. I'd like to do this from within my program.  Having read Inside Macintosh
  837. (that model of exposition and clarity, if not usefulness) I gather I need
  838. to do some down-and-dirty printer driver stuff.  I was hoping more for
  839. a "transparent" mode I could put the Print Manager into.  I'm doing
  840. simple stuff, like trying to put an RGB or CYMK bitmap out to a
  841. PostScript printer.  I've already done the RIP-ing, and I find if I go
  842. through QuickDraw I need to wait for another conversion to PostScript.
  843. Also, many of thes items are native CYMK images, so it would save those
  844. conversions to RGB, too.
  845.  
  846. Any Help?  Pointer to "this is the classic Tech Note" or book?
  847. - --
  848. Roy Richter                  Internet: rrichter@ph.gmr.com
  849. Physics Dept, GM Research    UUCP:     rphroy!rrichter
  850.  
  851. +++++++++++++++++++++++++++
  852.  
  853. From: zben@ni.umd.edu (Charles B. Cranston)
  854. Organization: UM Home for the Terminally Analytical
  855. Date: Mon, 1 Jun 1992 15:58:36 GMT
  856.  
  857. In article <1992May29.230453.22235@fcom.cc.utah.edu>, jharvey@csulx.weber.edu (Justin Harvey) writes:
  858.  
  859. > I'd like to know if anyone can tell me how to print postscript files
  860. > on a Macintosh connected to a Laserwriter?
  861.  
  862. Adobe provided a program called SendPS that (among other functions) downloaded
  863. an arbitrary text file via AppleTalk to LaserWriters.  It was at level 2.0 last
  864. time I saw.  Amanda Walker wrote an MPW Tool called SendPS that did the same
  865. thing (but since it was a tool you could redirect the diagnostic output to a
  866. file or window a la Unix etc).
  867.  
  868. Both of these programs suffered in the System 7 conversion because they fetch
  869. the PAP (Printer Access Protocol) routines from the LaserWriter file, which is
  870. no longer in the System Folder where they are looking.  If you move LaserWriter
  871. from Extensions (or wherever it lives now) back to the root System Folder they
  872. start working again.  Updated versions would be much appreciated.
  873.  
  874. If you really want to write it yourself I suggest you use this PAP manager
  875. interface.  You will find info on it in Best of Mactutor Volume II pages 97
  876. and 179...
  877.  
  878.  
  879. +++++++++++++++++++++++++++
  880.  
  881. From: mxmora@unix.SRI.COM (Matt Mora)
  882. Date: 2 Jun 92 21:32:40 GMT
  883. Organization: SRI International, Menlo Park, California
  884.  
  885. In article <1992Jun1.155836.19961@ni.umd.edu> zben@ni.umd.edu (Charles B. Cranston) writes:
  886.  
  887. >If you really want to write it yourself I suggest you use this PAP manager
  888. >interface.  You will find info on it in Best of Mactutor Volume II pages 97
  889. >and 179...
  890.  
  891. How does MS word do it then? Can't you just open/create a picture
  892. stuff in all postscript using piccomments and then print the pict
  893. to the printer? Or does this only work for one page?
  894.  
  895. Matt
  896.  
  897.  
  898.  
  899. - -- 
  900. ___________________________________________________________
  901. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  902. SRI International           |  my unix  mxmora@unix.sri.com
  903. ___________________________________________________________
  904.  
  905. +++++++++++++++++++++++++++
  906.  
  907. From: de19@umail.umd.edu (Dana S Emery)
  908. Date: 3 Jun 92 05:52:27 GMT
  909. Organization: Personal
  910.  
  911. In article <35603@unix.SRI.COM>, mxmora@unix.SRI.COM (Matt Mora) writes:
  912.  
  913. > How does MS word do it then? Can't you just open/create a picture
  914. > stuff in all postscript using piccomments and then print the pict
  915. > to the printer? 
  916.  
  917. > Or does this only work for one page?
  918.  
  919. You got it, pic per page.  Also, your PS had better be handling both its own
  920. Mac-encoding and font downloading, as support of the picts' postscript is NOT 
  921. automatic, so the App must parse the PS for font utilization and actually 
  922. print some real character (not a space, overly clever LW driver optimizes 
  923. lone spaces out) somewhere that won't image (?what to do for wall-wall 
  924. printers?, how about thumbnails?).
  925.  
  926. Ben and I have thrashed this out, doing a printer driver substitute  is
  927. really the best way.  It should also be a lot faster, as the LW driver does
  928. a lot of armwaving to pipe that PS out the port.
  929.  
  930. ---------------------------
  931.  
  932. From: tfiske@qualcom.qualcomm.com (T.J. Fiske)
  933. Subject: Info about AppMaker v1.2 and MacApp
  934. Date: 29 May 92 23:25:34 GMT
  935. Organization: Qualcomm, Inc., San Diego, CA
  936.  
  937. I just read in the latest version of the APDA catalog of a 
  938. program called AppMaker v1.2 that is a prototyping tool that
  939. will allow you to prototype in THINK Class Library and also
  940. in MacAPP.  Does any one know if this means that you could
  941. load up code from THINK Class Library, then convert it to work
  942. with MacAPP.
  943.  
  944. I have code that is in the Think Class Library, that I desperately
  945. need in a MacApp Format.  If anyone has an alternate solution, I'd
  946. love to hear it.
  947.  
  948. Thanks,
  949.  
  950.     -- T.J. Fiske
  951.  
  952. +++++++++++++++++++++++++++
  953.  
  954. From: ksand@apple.com (Kent Sandvik)
  955. Date: 31 May 92 22:33:50 GMT
  956. Organization: MacDTS Mongols
  957.  
  958. In article <tfiske.707181934@qualcom>, tfiske@qualcom.qualcomm.com (T.J. Fiske)
  959. writes:
  960. > I just read in the latest version of the APDA catalog of a 
  961. > program called AppMaker v1.2 that is a prototyping tool that
  962. > will allow you to prototype in THINK Class Library and also
  963. > in MacAPP.  Does any one know if this means that you could
  964. > load up code from THINK Class Library, then convert it to work
  965. > with MacAPP.
  966. > I have code that is in the Think Class Library, that I desperately
  967. > need in a MacApp Format.  If anyone has an alternate solution, I'd
  968. > love to hear it.
  969.  
  970. You could load in general resources, but I don't personally see 
  971. any way to load real TCL code, and AppMaker automagically converts
  972. it to MacApp 3.0 code. However if you use AppMaker as the generator
  973. for interfaces, you could create either TCL or MacApp code, depending
  974. on the phase of the moon, the political climate at the office, or
  975. due to whatever legal, inofficial or official reason.
  976. - --
  977.                                               Cheers, Kent
  978.  
  979.  
  980.  
  981. ---------------------------
  982.  
  983. From: Chewy@cup.portal.com (Paul Frederick Snively)
  984. Subject: MPW C Error Funnies
  985. Date: Sun, 31 May 92 15:48:17 PDT
  986. Organization: The Portal System (TM)
  987.  
  988. My personal favorite:
  989.  
  990. `You can't: change the type of a constant, win an argument with the IRS, or
  991. satisfy this compiler.'
  992.  
  993. Paul Snively
  994.  
  995. +++++++++++++++++++++++++++
  996.  
  997. From: marks@imagen.com (mark salter)
  998. Date: 1 Jun 92 17:39:40 GMT
  999. Organization: imagen
  1000.  
  1001. Chewy@cup.portal.com (Paul Frederick Snively) writes:
  1002.  
  1003. >My personal favorite:
  1004.  
  1005. >`You can't: change the type of a constant, win an argument with the IRS, or
  1006. >satisfy this compiler.'
  1007.  
  1008. >Paul Snively
  1009.  
  1010.  
  1011. Try this:
  1012.  
  1013. extern void void_proc(void);
  1014.  
  1015. main()
  1016. {
  1017.     (void) void_proc();
  1018. }
  1019.  
  1020.  
  1021. Results in this message:
  1022. Error 245 Can't cast a void type to type void (because the ANSI spec. says so, thats why)
  1023.  
  1024. Only thing is, I can't find a prohibition of this anywhere and every other ANSI
  1025. compiler on every other platform I've tried compiles this just fine.
  1026.  
  1027. Mark Salter
  1028.  
  1029. +++++++++++++++++++++++++++
  1030.  
  1031. From: jfw@ksr.com (John F. Woods)
  1032. Date: 1 Jun 92 18:00:55 EDT
  1033.  
  1034. marks@imagen.com (mark salter) writes:
  1035. >Chewy@cup.portal.com (Paul Frederick Snively) writes:
  1036. >Try this:
  1037. >extern void void_proc(void);
  1038. >main()
  1039. >{
  1040. >    (void) void_proc();
  1041. >}
  1042. >Results in this message:
  1043. >Error 245 Can't cast a void type to type void (because the ANSI spec. says so, thats why)
  1044.  
  1045. >Only thing is, I can't find a prohibition of this anywhere and every other
  1046. >ANSI compiler on every other platform I've tried compiles this just fine.
  1047.  
  1048. There's a reason for that.            (_italics_ *bold*)
  1049.  
  1050. "3.2.2.2 void
  1051.    The (nonexistant) value of a _void_expression_ (an expression that has type
  1052. *void*) shall not be used in any way, and implicit or explicit conversions
  1053. (except to *void*) shall not be applied to such an expression."
  1054.  
  1055. Note that a void expression MAY be cast (converted) to void.  MPW C is in for a
  1056. spanking.
  1057.  
  1058.  
  1059. ---------------------------
  1060.  
  1061. From: peterc@moebius.cubetech.com (Peter Creath)
  1062. Subject: high-speed serial communications (again)
  1063. Date: Fri, 29 May 92 22:29:34 CDT
  1064. Organization: Cube Technologies
  1065.  
  1066. A while ago I said Apple oughtta come out with some universal way
  1067. to allow the Mac to handle 115.2k serial port speeds.
  1068.  
  1069. Somebody mentioned that this wasn't possible in a standard sense because
  1070. (if I understand it correctly) AppleTalk gets its 200k speed by using
  1071. multiple channels, rather than one 200k data channel.
  1072.  
  1073. However, MacLink Plus connects to an IBM at 115.2k.  That would mean
  1074. that it is actually getting the serial port to go 115.2k.  I've worked
  1075. with IBM's and there's no way you can get the UART to blast out or
  1076. receive more than one data channel, so it's GOTTA be going down one
  1077. channel.
  1078.  
  1079. In summary, how the hell did they do that?
  1080.  
  1081. Can Apple come out with a update to the Comm Toolbox or a Snippet
  1082. so all the programmers out there can write a safe high-speed serial
  1083. app?
  1084.  
  1085. - ----------------------------------------------------------------------------
  1086. Peter Creath                 "When I was a boy I was told that anybody could
  1087. peterc@moebius.cubetech.com   become president; I'm beginning to believe it."
  1088.                                                            -- Clarence Darrow
  1089.  
  1090. +++++++++++++++++++++++++++
  1091.  
  1092. From: leonardr@ccs.itd.umich.edu
  1093. Organization: Campus Computing Sites, University of Michigan-Ann Arbor
  1094. Date: Sun, 31 May 92 04:24:59 GMT
  1095.  
  1096. In article <dx3uv972.4oo6d5@moebius.cubetech.com> peterc@moebius.cubetech.com (Peter Creath)  writes:
  1097. >However, MacLink Plus connects to an IBM at 115.2k.  That would mean
  1098. >that it is actually getting the serial port to go 115.2k.  I've worked
  1099. >with IBM's and there's no way you can get the UART to blast out or
  1100. >receive more than one data channel, so it's GOTTA be going down one
  1101. >channel.
  1102. >
  1103. >In summary, how the hell did they do that?
  1104. >
  1105.     You may have noticed that MacLink comes with a special cable along
  1106. with a "black box" which attaches to the cable for those "high speed transfers".
  1107. That "black box" provides an external clock to the SCC, like the wires in 
  1108. the LocalTalk boxes.  that is the ONLY way to get above 57.6Kb with the Mac's
  1109. current SCC & serial driver - external clocking!
  1110.  
  1111. >Can Apple come out with a update to the Comm Toolbox or a Snippet
  1112. >so all the programmers out there can write a safe high-speed serial
  1113. >app?
  1114. >
  1115.     Apple needs to do some more work on interrupt handling when AppleTalk
  1116. is in use first, then some work on making the serial driver a bit more robust
  1117. and THEN maybe we could at least do 57.6Kb.
  1118.  
  1119.  
  1120. - -- 
  1121. - -----------------------------------------------------------------------
  1122. Leonard Rosenthol          Internet: leonardr@ccs.itd.umich.edu
  1123. Director of Advanced Technology   AppleLink: MACgician
  1124. Aladdin Systems, inc.          GEnie:     MACgician
  1125.  
  1126. +++++++++++++++++++++++++++
  1127.  
  1128. From: ksand@apple.com (Kent Sandvik)
  1129. Date: 31 May 92 22:45:39 GMT
  1130. Organization: MacDTS Mongols
  1131.  
  1132. In article <1992May31.042459.9@terminator.cc.umich.edu>,
  1133. leonardr@ccs.itd.umich.edu writes:
  1134. > In article <dx3uv972.4oo6d5@moebius.cubetech.com> > >Can Apple come out with a
  1135. update to the Comm Toolbox or a Snippet
  1136. > >so all the programmers out there can write a safe high-speed serial
  1137. > >app?
  1138. > >
  1139. >     Apple needs to do some more work on interrupt handling when AppleTalk
  1140. > is in use first, then some work on making the serial driver a bit more robust
  1141. > and THEN maybe we could at least do 57.6Kb.
  1142.  
  1143. True, the problem really has to do with interrupt level handling, and not
  1144. enough cycles for successfully handling huge speeds, unless you either
  1145. have an external clock, a special hard and ICs with buffering, or many
  1146. other similar *outside* solutions. The trick is to raise the overall
  1147. level of the standard hardware, and trust me, this is a serious problem
  1148. we are trying to resolve due to the higher and higher speeds end users
  1149. will use with communication services.
  1150. - --
  1151.                                               Cheers, Kent
  1152.  
  1153.  
  1154.  
  1155. +++++++++++++++++++++++++++
  1156.  
  1157. From: jackb@mdd.comm.mot.com (Jack Brindle)
  1158. Date: 1 Jun 92 03:37:55 GMT
  1159. Organization: Motorola, Mobile Data Division - Seattle, WA
  1160.  
  1161. In article <1992May31.042459.9@terminator.cc.umich.edu> leonardr@ccs.itd.umich.edu writes:
  1162. >In article <dx3uv972.4oo6d5@moebius.cubetech.com> peterc@moebius.cubetech.com (Peter Creath)  writes:
  1163. >>However, MacLink Plus connects to an IBM at 115.2k.  That would mean
  1164. >>that it is actually getting the serial port to go 115.2k.  I've worked
  1165. >>with IBM's and there's no way you can get the UART to blast out or
  1166. >>receive more than one data channel, so it's GOTTA be going down one
  1167. >>channel.
  1168. >>
  1169. >>In summary, how the hell did they do that?
  1170. >>
  1171. >    You may have noticed that MacLink comes with a special cable along
  1172. >with a "black box" which attaches to the cable for those "high speed transfers".
  1173. >That "black box" provides an external clock to the SCC, like the wires in 
  1174. >the LocalTalk boxes.
  1175.  
  1176. Leonard! Of all people, you should know better than this! First, the
  1177. LocalTalk boxes do not supply clock. LocalTalk uses the SCC's DPLL to
  1178. decode the clock from the transmitted FM0 coded data string. It also
  1179. generates it on transmit. This is easy since LocalTalk is not full duplex,
  1180. and the clock generator can be reprogrammed for the needed clock rates
  1181. for both tx and rx.
  1182.  
  1183. >                     that is the ONLY way to get above 57.6Kb with the Mac's
  1184. >current SCC & serial driver - external clocking!
  1185.  
  1186. This is true. The current asynchronous mode SCC driver cannot go above 
  1187. 57.6Kb. The SCC certainly can go above it, most notably in synchronous
  1188. mode (LocalTalk is but one example of this). The SCC does need help to
  1189. go faster in asynchronous mode. Obviously, though it is doable.
  1190.  
  1191. >>Can Apple come out with a update to the Comm Toolbox or a Snippet
  1192. >>so all the programmers out there can write a safe high-speed serial
  1193. >>app?
  1194. >>
  1195. >    Apple needs to do some more work on interrupt handling when AppleTalk
  1196. >is in use first, then some work on making the serial driver a bit more robust
  1197. >and THEN maybe we could at least do 57.6Kb.
  1198.  
  1199. This is not the only problem. (soapbox time...) The only mechanism that
  1200. Apple has given us for controlling the use of serial ports is through
  1201. the Communications Resource Manager of the CTB. Unfortunately, this
  1202. does not manage the hardware at all. It only manages software drivers.
  1203. So, if I install a synchronous driver using the modem port (port A),
  1204. the user can actually open a comm program and load an async driver for
  1205. the same port, reconfiguring the very hardware my driver is using. Note,
  1206. management at this level used to be in the Mac. Unfortunately, it appears
  1207. to have been removed, and in any rate, Apple told us not to use it. I
  1208. actually have gone to opening the async driver for the port I want to
  1209. use, then stealing the hardware out from under it. Calls to the "open
  1210. driver" routine will return a "driver busy" status. It would be much
  1211. easier if Apple would simply give us port management.
  1212. (stepping off the soapbox...)
  1213.  
  1214. Thanks to Leonard for another opportunity to vent my port management
  1215. frustrations... :-)
  1216.  
  1217. Jack Brindle
  1218. ham radio: wa4fib
  1219. internet: jackb@mdd.comm.mot.com
  1220.  
  1221. +++++++++++++++++++++++++++
  1222.  
  1223. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  1224. Organization: Royal Institute of Technology, Stockholm, Sweden
  1225. Date: Mon, 1 Jun 1992 20:13:03 GMT
  1226.  
  1227. .cc.umich.edu> leonardr@ccs.itd.umich.edu writes:
  1228.  
  1229.        You may have noticed that MacLink comes with a special cable along
  1230.    with a "black box" which attaches to the cable for those "high speed transfers".
  1231.    That "black box" provides an external clock to the SCC, like the wires in 
  1232.    the LocalTalk boxes.  that is the ONLY way to get above 57.6Kb with the Mac's
  1233.    current SCC & serial driver - external clocking!
  1234.  
  1235.  
  1236. LocalTalk does NOT use external clocking. The SCC can go at 240 kBPS
  1237. using async clocking (no external clock) or at 1 MBPS using external
  1238. clocking.
  1239.  
  1240.    >Can Apple come out with a update to the Comm Toolbox or a Snippet
  1241.    >so all the programmers out there can write a safe high-speed serial
  1242.    >app?
  1243.    >
  1244.        Apple needs to do some more work on interrupt handling when AppleTalk
  1245.    is in use first, then some work on making the serial driver a bit more robust
  1246.    and THEN maybe we could at least do 57.6Kb.
  1247.  
  1248. Uh... the driver already does 57.6 kbps supported... And Apple
  1249. HAS done a lot about the serial drivers and LocalTalk load -
  1250. you just have to pay for it (Q900/950 and IIfx have this fix,
  1251. it's in hardware)
  1252.  
  1253. The problem with localtalk is that the interrupt handling the
  1254. incoming character HAS TO KEEP ON READING until the block has
  1255. arrived; there's no time for interrupt-handling things at
  1256. localtalk speeds. So you stay with interrupts disabled for a
  1257. long time when using LocalTalk.
  1258.  
  1259. - -- 
  1260. h++ - new and improved !
  1261.  
  1262. A Bus Station is where buses stop. A Train Station is where
  1263. trains stop. On my desk, there is a Work Station.
  1264.  
  1265. +++++++++++++++++++++++++++
  1266.  
  1267. From: peterc@moebius.cubetech.com (Peter Creath)
  1268. Date: Sun, 31 May 92 22:53:04 CDT
  1269. Organization: Cube Technologies
  1270.  
  1271.  
  1272. In article <1992May31.042459.9@terminator.cc.umich.edu> (comp.sys.mac.programmer), leonardr@ccs.itd.umich.edu writes:
  1273. >     Apple needs to do some more work on interrupt handling when AppleTalk
  1274. > is in use first, then some work on making the serial driver a bit more robust
  1275. > and THEN maybe we could at least do 57.6Kb.
  1276.  
  1277. ZTerm handles it just dandily.  My Telebit has no problem zooming
  1278. along at 57.6k.  I just want 115.2k so that when my WorldBlazer arrives
  1279. I can go at ITs top speed...
  1280.  
  1281. (not that I'm going to get throughput above 57.6k anyway, but it's
  1282. just a nice feeling)
  1283.  
  1284. - ----------------------------------------------------------------------------
  1285. Peter Creath                 "When I was a boy I was told that anybody could
  1286. peterc@moebius.cubetech.com   become president; I'm beginning to believe it."
  1287.                                                            -- Clarence Darrow
  1288.  
  1289. ---------------------------
  1290.  
  1291. End of C.S.M.P. Digest
  1292. **********************
  1293.