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

  1. Received-Date: Thu, 22 Sep 1994 15:08:40 +0200
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-060
  4. To: csmp-digest@ens.fr
  5. Date: Thu, 22 Sep 1994 15:08:30 +0200 (MET DST)
  6. X-Mailer: ELM [version 2.4 PL23]
  7. Mime-Version: 1.0
  8. Content-Type: text/plain; charset=ISO-8859-1
  9. Content-Transfer-Encoding: 8bit
  10. Errors-To: listman@ens.fr
  11. Reply-To: pottier@clipper.ens.fr
  12. X-Sequence: 65
  13.  
  14. C.S.M.P. Digest             Thu, 22 Sep 94       Volume 3 : Issue 60
  15.  
  16. Today's Topics:
  17.  
  18.         Books to learn assembly language on Mac?
  19.         FYI: Fun Bug with CustomGetFile
  20.         How to call 68K lib from PPC code?
  21.         PROBLEM: Serial Port Programming & PowerBooks
  22.         Using CLUTs to simulate page flipping?
  23.         Why is AppleScript type checking absent?
  24.         [Q] _PBCatSearch vs Recursive Indexed _PBGetCatInfo
  25.  
  26.  
  27.  
  28. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  29. (pottier@clipper.ens.fr).
  30.  
  31. The digest is a collection of article threads from the internet newsgroup
  32. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  33. regularly and want an archive of the discussions.  If you don't know what a
  34. newsgroup is, you probably don't have access to it.  Ask your systems
  35. administrator(s) for details.  If you don't have access to news, you may
  36. still be able to post messages to the group by using a mail server like
  37. anon.penet.fi (mail help@anon.penet.fi for more information).
  38.  
  39. Each issue of the digest contains one or more sets of articles (called
  40. threads), with each set corresponding to a 'discussion' of a particular
  41. subject.  The articles are not edited; all articles included in this digest
  42. are in their original posted form (as received by our news server at
  43. nef.ens.fr).  Article threads are not added to the digest until the last
  44. article added to the thread is at least two weeks old (this is to ensure that
  45. the thread is dead before adding it to the digest).  Article threads that
  46. consist of only one message are generally not included in the digest.
  47.  
  48. The digest is officially distributed by two means, by email and ftp.
  49.  
  50. If you want to receive the digest by mail, send email to listserv@ens.fr
  51. with no subject and one of the following commands as body:
  52.     help                        Sends you a summary of commands
  53.     subscribe csmp-digest Your Name    Adds you to the mailing list
  54.     signoff csmp-digest            Removes you from the list
  55. Once you have subscribed, you will automatically receive each new
  56. issue as it is created.
  57.  
  58. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  59. Questions related to the ftp site should be directed to
  60. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  61. digest are available there.
  62.  
  63. Also, the digests are available to WAIS users.  To search back issues
  64. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  65. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  66.  
  67.  
  68. -------------------------------------------------------
  69.  
  70. >From gmei@hoh.mbl.edu (Guang Mei)
  71. Subject: Books to learn assembly language on Mac?
  72. Date: Thu, 1 Sep 1994 01:23:43 GMT
  73. Organization: Marine Biological Laboratory
  74.  
  75. Hi:
  76.  
  77. I need to learn assembly language on Mac and I cann't find any book(s) to
  78. start with. Could any one recommend any good book(s) to read? I have no
  79. assembly language programming experience before so the book should be for
  80. beginners.
  81.  
  82. Please post your answer here or e-mail your response to  gmei@hoh.mbl.edu
  83.  
  84. Thanks.
  85.  
  86. -- 
  87. - -----------
  88. Guang Mei   gmei@hoh.mbl.edu     Tel:(508)548-3705 ext 374
  89. Program of Architectural Dynamics in Living Cells
  90. Marine Biological Laboratory, Woods Hole, MA 02543
  91.  
  92. +++++++++++++++++++++++++++
  93.  
  94. >From kenlong@netcom.com (Ken Long)
  95. Date: Fri, 2 Sep 1994 00:27:35 GMT
  96. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  97.  
  98. Several options:
  99.  
  100. First, call your closest Motorola representative and have him send you a 
  101. catalog of their publications.
  102.  
  103. Then, check your local phone book - there's probably an ad for Ophamp 
  104. Technical Books in it, listing their 800 number.  Call and get their free 
  105. catalog.  You can then choose some appropriate books.  If their number 
  106. and ad are not there, call 1-800-555-1212, and get it from Information - 
  107. they are in Los Angeles.
  108.  
  109. Next, some books you may already have may have brief assembler info on 
  110. them (to read while waiting for a real book).  The MacsBug Reference and 
  111. Debugging Guide has 35 pages of assembler primer, and may also recommend 
  112. books.  Scott Knaster's "blue book" has some info on it.
  113.  
  114. Inside Mac has "Assembly Language notes" throughout.
  115.  
  116. Get an assembler programming environment and some example source and 
  117. start working with it.  Then when you get some books you can become more 
  118. adept at it.  You'd have to get an envronment anyway, regardless of 
  119. whether you got a book, if you want to program in assembler, so get that 
  120. part over with.  I don't know what's available for PPC's, but there are a 
  121. few 68k ones out there.  It may be too early to get into PPC assmbler 
  122. with ease.  Likely there are not many books on it, except from Motorola.
  123.  
  124. Does that help?
  125.  
  126. -Ken-
  127.  
  128. +++++++++++++++++++++++++++
  129.  
  130. >From khatt@shell.portal.com (Judy Ann Kettenhofen)
  131. Date: 3 Sep 1994 01:04:28 GMT
  132. Organization: Portal Communications Company -- 408/973-9111 (voice) 408/973-8091 (data)
  133.  
  134. Guang Mei (gmei@hoh.mbl.edu) wrote:
  135. : Hi:
  136.  
  137. : I need to learn assembly language on Mac and I cann't find any book(s) to
  138.  
  139. About 4-5 years ago I considered co-writing a book on 680x0 Asm.
  140. I was informed that I'd have a hard time finding a publisher, because
  141. asm books just weren't that much in demand.  A number of asm books
  142. I own currently are out of print (these are 680x0), so it's difficult
  143. to recommend a book that you will be able to find.
  144.  
  145. What are you trying to accomplish?  Are you attempting to write
  146. a complete program in asm or do you just need to write a little
  147. piece?
  148.  
  149. So....your learning tasks can be chunked like this:
  150.  
  151. 1. Understanding, generally, about machine language, memory
  152. addressing and so forth.
  153. 1.5 Become familiar with the major types of addressing modes
  154. and cpu models (i.e., 680x0 uses a set of general purpose
  155. registers; 80x86 has registers which must be used for specific
  156. purposes.)
  157.  
  158. 2. Become familiar with 680x0 instruction set & addressing modes.
  159. Your task will be made immeasurably simpler if you start with
  160. just the 68000 stuff.  With the advent of the 68020, Motorola
  161. added several new addressing modes which have a variety of
  162. permutations, such that the number of permutations is greater
  163. than the number of 68000 addressing modes.
  164.  
  165. 3. Learning specifically what it means to program in asm on
  166. the Mac.  This means becoming familiar with the Macintosh
  167. runtime model; e.g., jump tables, a5 offsets, loading segments,
  168. etc.  The MPW Assembler, for instance, makes certain assumptions
  169. which make it somewhat easier to program in asm on the Mac by
  170. in essence hiding information from you, especially when it comes
  171. to a5 offsets.
  172.  
  173. 4. If you use the MPW Asm, there are possibly other idiosyn-
  174. crasies with which you will want to become familiar. Most of
  175. these can be found by looking at the various directives.  IN
  176. particular, the MPW Asm will optimize your asm instructions to
  177. equivalent faster instructions unless you explicitly tell it
  178. not to.
  179.  
  180. Good Luck,
  181.  
  182. --Judy
  183.  
  184. PS Anyone use the "OPT SYNON" directive in the MPW Asm that was
  185. put in in MPW 3.3?
  186.  
  187. --former MPW Asm hack.
  188.  
  189. : start with. Could any one recommend any good book(s) to read? I have no
  190. : assembly language programming experience before so the book should be for
  191. : beginners.
  192.  
  193. : Please post your answer here or e-mail your response to  gmei@hoh.mbl.edu
  194.  
  195. : Thanks.
  196.  
  197. : -- 
  198. : -------------
  199. : Guang Mei   gmei@hoh.mbl.edu     Tel:(508)548-3705 ext 374
  200. : Program of Architectural Dynamics in Living Cells
  201. : Marine Biological Laboratory, Woods Hole, MA 02543
  202.  
  203. +++++++++++++++++++++++++++
  204.  
  205. >From bouldin@enh.nist.gov (Charles Bouldin)
  206. Date: 4 Sep 1994 13:19:13 GMT
  207. Organization: NIST
  208.  
  209. In article <kenlongCvH7xz.yv@netcom.com>, kenlong@netcom.com (Ken Long) wrote:
  210.  
  211. > Several options:
  212. > First, call your closest Motorola representative and have him send you a 
  213. > catalog of their publications.
  214.  
  215. Also, very old by now, but "The complete book of Macintosh assembly language"
  216. by Dan Weston is quite complete. Probably out of print, but you might find
  217. an old copy somewhere. ISBN # 0-673-18379-3 from Scott, Foresman and Co.
  218.  
  219. +++++++++++++++++++++++++++
  220.  
  221. >From khatt@shell.portal.com (Judy Ann Kettenhofen)
  222. Date: 4 Sep 1994 21:33:59 GMT
  223. Organization: Portal Communications Company -- 408/973-9111 (voice) 408/973-8091 (data)
  224.  
  225. Charles Bouldin (bouldin@enh.nist.gov) wrote:
  226. : In article <kenlongCvH7xz.yv@netcom.com>, kenlong@netcom.com (Ken Long) wrote:
  227.  
  228. : > Several options:
  229. : > 
  230. : > First, call your closest Motorola representative and have him send you a 
  231. : > catalog of their publications.
  232. : > 
  233.  
  234. : Also, very old by now, but "The complete book of Macintosh assembly language"
  235. : by Dan Weston is quite complete. Probably out of print, but you might find
  236. : an old copy somewhere. ISBN # 0-673-18379-3 from Scott, Foresman and Co.
  237.  
  238. When Dan's book came out, it was definitely a great book.
  239. However, there have been enough changes in programming the Mac
  240. using his examples can now lead to frustration.  If it weren't
  241. for that, I would recommend his book enthusiastically and without
  242. hesitation. Incidentally, he also wrote a vol II of that book.
  243.  
  244. +++++++++++++++++++++++++++
  245.  
  246. >From wdh@fresh.com (Bill Hofmann)
  247. Date: Wed, 7 Sep 1994 15:37:36 GMT
  248. Organization: Fresh Software
  249.  
  250.  
  251. Personally, I'd do these things:
  252. 1. Buy a 68000 manual (note I said 68000, not 68020 or 68030 or 68040).
  253.    Why? 68000 assembler is fairly simple, it gets hairier and hairier as 
  254.    you go on.  
  255. 2. Buy a PowerPC manual (after all, it's a Mac).  
  256. 3. Buy any CS textbook in assembler programming that looks relatively practical
  257. 4. Work through it.
  258. 5. Forget it all and use C or C++: it's much more portable, easier to learn,
  259.    quicker to develop,etc.
  260. 6. When, after developing what you've developed, if there are sections that
  261.    *really* need assembler (as opposed to a better algorithm), then you can
  262.    code those sections in assembler.
  263.  
  264. I've done more than my share of assembler, and personally, I'd just as soon
  265. beat my head against a brick wall.
  266. -- 
  267. Bill Hofmann                                   wdh@fresh.com
  268. Fresh Software and Instructional Design        voice: +1 510 524 0852
  269. 1640 San Pablo Ave #C Berkeley CA 94702 USA    fax:   +1 510 524 0853
  270.  
  271. +++++++++++++++++++++++++++
  272.  
  273. >From patc@teleport.com (Pat Caudill)
  274. Date: Thu, 8 Sep 94 03:57:21 GMT
  275. Organization: Teleport - Portland's Public Access (503) 220-1016
  276.  
  277.  
  278. You might ask at Powell's Bookstore (Technical books). They have a fairly
  279. large technical section (it's got it's own building). Their catalog is on
  280. line on the net. Send email to "ping@technicalal.powells.portland.or.us" and
  281. you will get accessing information. I dont work for them, just one of the
  282. browsers there.
  283.  
  284. Pat Caudill
  285.  
  286. ---------------------------
  287.  
  288. >From sped@lfso.ifa.hawaii.edu (Byron Han)
  289. Subject: FYI: Fun Bug with CustomGetFile
  290. Date: Tue, 6 Sep 1994 20:52:29 GMT
  291. Organization: Institute for Astronomy, Hawaii
  292.  
  293. If you write a custom hook proc so that you can select a folder or an
  294. alias (like ResEdit does) and you try to select an alias on the desktop,
  295. standard file will munge your vRefNum/dirID returned in the sfFile
  296. filsspec field...
  297.  
  298. Try selecting an alias on the desktop with ResEdit and you will see what
  299. I mean.  Also writing a snippet of code to reproduce is trivial as well.
  300.  
  301. Solution is safe off the sfFile structure when sfOpenAlias is received
  302. in your hookProc (and you transmogrify the item to sfOpenItem) and to
  303. restore the sfFile structure at lastCall time...
  304.  
  305.  
  306.  
  307. +++++++++++++++++++++++++++
  308.  
  309. >From dazuma@cco.caltech.edu (Daniel Azuma)
  310. Date: Wed, 07 Sep 1994 08:08:14 -0700
  311. Organization: California Institute of Technology
  312.  
  313. sped@lfso.ifa.hawaii.edu (Byron Han) wrote:
  314.  
  315. > If you write a custom hook proc so that you can select a folder or an
  316. > alias (like ResEdit does) and you try to select an alias on the desktop,
  317. > standard file will munge your vRefNum/dirID returned in the sfFile
  318. > filsspec field...
  319.  
  320. Yup, that one's been around for a while-- I first ran into it several
  321. years ago, soon after System 7 came out. It happens only if you try to
  322. select an ALIAS on the DESKTOP of a NON-STARTUP volume. (Selecting an
  323. alias on the desktop of the startup volume works fine.)
  324.  
  325. What's going on is, the vRefNum/dirID ALWAYS specifies the desktop folder
  326. on the startup volume in this case. To see this happen, create two aliases
  327. with the same name on the desktop, one on the startup volume, and one on
  328. another volume. Now try to use a program that supports opening aliases
  329. (like ResEdit or FileTyper) to open the alias on the non-startup volume.
  330. It will open the startup-volume alias instead.
  331.  
  332. One would think Apple could have fixed this by now. Geez.
  333.  
  334. Dan
  335.  
  336. - ----------------------------------------------------------------
  337.   Daniel Azuma            | "Rejoice in the Lord always; again I
  338.   Caltech                 |  will say, Rejoice..."
  339.   dazuma@cco.caltech.edu  |              --Philippians 4:4
  340. - ----------------------------------------------------------------
  341.  
  342. ---------------------------
  343.  
  344. >From sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  345. Subject: How to call 68K lib from PPC code?
  346. Date: Mon, 5 Sep 94 23:22:46 BST
  347. Organization: Network Analysis Ltd
  348.  
  349. I'm working on a a port of a largish appl to native PPC. The 68K
  350. version calls a third party 68K lib to which we do not have the
  351. sources. How can we call this 68K lib from native PPC code? I've read
  352. chp 2 of "Inside Mac: PPC System Software" and I understand how to
  353. create a UPP and call it, but how do I get the 68K code into memory?
  354. The PPC linker won't slurp it in, of course.
  355.  
  356. The only thing I can think of is to make a 68K code resource, which
  357. links with the 68K lib, and provide some glue that creates UPPs on
  358. the PPC and calls the lib funcs directly on the 68K. Is there a
  359. better way? Or am I horribly confused, and there's a really easy way
  360. to do this that is so obvious it isn't worth mentioning in Inside Mac
  361. (say "yes", please...).
  362.  
  363. Sak Wathanasin
  364. Network Analysis Limited
  365. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  366.  
  367. Internet: sw@network-analysis-ltd.co.uk 
  368. uucp:     ...!uknet!nan!sw                       AppleLink: NAN.LTD
  369. Phone: (+44) 203 419996 Mobile:(+44) 850 587411  Fax: (+44) 203 690690
  370.  
  371. +++++++++++++++++++++++++++
  372.  
  373. >From h+@nada.kth.se (Jon W{tte)
  374. Date: Tue, 06 Sep 1994 11:59:45 +0200
  375. Organization: Royal Institute of Something or other
  376.  
  377. In article <100338.92m668@Ph.network-analysis-ltd.co.uk>,
  378. sw@network-analysis-ltd.co.uk (Sak Wathanasin) wrote:
  379.  
  380. >I'm working on a a port of a largish appl to native PPC. The 68K
  381. >version calls a third party 68K lib to which we do not have the
  382. >sources. How can we call this 68K lib from native PPC code? I've read
  383. >chp 2 of "Inside Mac: PPC System Software" and I understand how to
  384. >create a UPP and call it, but how do I get the 68K code into memory?
  385. >The PPC linker won't slurp it in, of course.
  386.  
  387. You have to build a standalone code resource out of the 68k 
  388. library. If the 68k library doesn't come in a standalone 
  389. version, you're hosed.
  390.  
  391. If the library is "Word Solutions Engine" by DataPak, they've 
  392. done the UPP part already, and are willing to sell it to you 
  393. for $400. Could be cheaper than your time to do the same, could 
  394. be more expensive, depending on how good (and expensive :-) you 
  395. are.
  396.  
  397. Cheers,
  398.  
  399.                 / h+
  400.  
  401.  
  402. --
  403.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  404.  
  405.   "Have a bearable day."
  406.  
  407.  
  408. +++++++++++++++++++++++++++
  409.  
  410. >From sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  411. Date: Wed, 7 Sep 94 13:15:23 BST
  412. Organization: Network Analysis Ltd
  413.  
  414.  
  415. In article <9668AA920A31.4F78@klkmac010.nada.kth.se> 
  416. (comp.sys.mac.programmer), h+@nada.kth.se (Jon W{tte) writes:
  417.  
  418. > In article <100338.92m668@Ph.network-analysis-ltd.co.uk>,
  419. > sw@network-analysis-ltd.co.uk (Sak Wathanasin) wrote:
  420. > >I'm working on a a port of a largish appl to native PPC. The 68K
  421. > >version calls a third party 68K lib to which we do not have the
  422. > >sources. How can we call this 68K lib from native PPC code?....
  423. > You have to build a standalone code resource out of the 68k 
  424. > library. If the 68k library doesn't come in a standalone 
  425. > version, you're hosed.
  426.  
  427. Not sure what you mean by a "standalone version" - it's just an MPW
  428. ".o" file. I have had a private response from someone at Apple who
  429. confirmed that making a code resource out of the lib is indeed the
  430. way to go about it.
  431.  
  432. > If the library is "Word Solutions Engine" by DataPak, 
  433.  
  434. It isn't, worse luck.
  435.  
  436. > they've 
  437. > done the UPP part already, and are willing to sell it to you 
  438. > for $400. Could be cheaper than your time to do the same, could 
  439. > be more expensive, depending on how good (and expensive :-) you 
  440. > are.
  441.  
  442. I charge a bit more than $400 (:-)....
  443.  
  444. Many thanks to everyone who responded.
  445.  
  446. Sak Wathanasin
  447. Network Analysis Limited
  448. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  449.  
  450. Internet: sw@network-analysis-ltd.co.uk 
  451. uucp:     ...!uknet!nan!sw                       AppleLink: NAN.LTD
  452. Phone: (+44) 203 419996 Mobile:(+44) 850 587411  Fax: (+44) 203 690690
  453.  
  454. +++++++++++++++++++++++++++
  455.  
  456. >From ekstrom@aggroup.com (Harold Ekstrom)
  457. Date: Wed, 07 Sep 1994 18:36:52 -0800
  458. Organization: Ag Group
  459.  
  460. In article <9668AA920A31.4F78@klkmac010.nada.kth.se>, h+@nada.kth.se (Jon
  461. W{tte) wrote:
  462.  
  463. > In article <100338.92m668@Ph.network-analysis-ltd.co.uk>,
  464. > sw@network-analysis-ltd.co.uk (Sak Wathanasin) wrote:
  465. > >I'm working on a a port of a largish appl to native PPC. The 68K
  466. > >version calls a third party 68K lib to which we do not have the
  467. > >sources. How can we call this 68K lib from native PPC code? I've read
  468. > >chp 2 of "Inside Mac: PPC System Software" and I understand how to
  469. > >create a UPP and call it, but how do I get the 68K code into memory?
  470. > >The PPC linker won't slurp it in, of course.
  471. > You have to build a standalone code resource out of the 68k 
  472. > library. If the 68k library doesn't come in a standalone 
  473. > version, you're hosed.
  474.  
  475. That's right. There was a recent MacTech article about how to do this,
  476. but I can't recall exactly what month it was. 
  477.  
  478. > If the library is "Word Solutions Engine" by DataPak, they've 
  479. > done the UPP part already, and are willing to sell it to you 
  480. > for $400. Could be cheaper than your time to do the same, could 
  481. > be more expensive, depending on how good (and expensive :-) you 
  482. > are.
  483. > Cheers,
  484. >                                 / h+
  485. > --
  486. >   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  487.  
  488.  
  489. >   "Have a bearable day."
  490. - ------------------------------------------------------------
  491. Harold Ekstrom
  492. ekstrom@aggroup.com
  493. ag group, inc.
  494. 2540 camino diablo, suite 200
  495. walnut creek, ca 94596
  496. 510-937-7900 voice
  497. 510-937-2479 fax
  498. 510-937-6704 ara
  499. ftp.aggroup.com anonymous ftp
  500.  
  501.  
  502. +++++++++++++++++++++++++++
  503.  
  504. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  505. Date: Thu, 8 Sep 1994 17:05:47 GMT
  506. Organization: The World Public Access UNIX, Brookline, MA
  507.  
  508. sw@network-analysis-ltd.co.uk (Sak Wathanasin) writes:
  509.  
  510.  
  511. >In article <9668AA920A31.4F78@klkmac010.nada.kth.se> 
  512. >(comp.sys.mac.programmer), h+@nada.kth.se (Jon W{tte) writes:
  513.  
  514. >> In article <100338.92m668@Ph.network-analysis-ltd.co.uk>,
  515. >> sw@network-analysis-ltd.co.uk (Sak Wathanasin) wrote:
  516. >> 
  517. >> >I'm working on a a port of a largish appl to native PPC. The 68K
  518. >> >version calls a third party 68K lib to which we do not have the
  519. >> >sources. How can we call this 68K lib from native PPC code?....
  520. >> 
  521. >> You have to build a standalone code resource out of the 68k 
  522. >> library. If the 68k library doesn't come in a standalone 
  523. >> version, you're hosed.
  524.  
  525. >Not sure what you mean by a "standalone version" - it's just an MPW
  526. >".o" file. I have had a private response from someone at Apple who
  527. >confirmed that making a code resource out of the lib is indeed the
  528. >way to go about it.
  529.  
  530. It has to be *linkable* into a code resource. In this case this means
  531. that you have to be able to build a dispatcher for each of the calls
  532. in the library. It also cannot use any global space (either *variables*
  533. or *constants*) unless you want to jump through hoops to create an A5
  534. world for the library to store its globals and constants in. Check
  535. out the tech note called "globals in standalone code" for more info.
  536.  
  537. -Ivan
  538. - -
  539. Ivan Cavero Belaunde (ivanski@world.std.com)
  540. Avid VideoShop Project Lead
  541. Avid Technology, Inc.
  542.  
  543. ---------------------------
  544.  
  545. >From mrichter@ifi.unizh.ch (Mathias W. Richter)
  546. Subject: PROBLEM: Serial Port Programming & PowerBooks
  547. Date: Tue, 30 Aug 1994 13:57:39 GMT
  548. Organization: Dept. of Computer Science, University of Zurich
  549.  
  550. I have a problem with an application that reads/writes data
  551. from/to an external unit (bicycle computer that collects 
  552. data) via the serial ports of the Mac.
  553.  
  554. The application runs fine on all Macs except for the PowerBooks.
  555. On PowerBooks, during
  556.  
  557.                                         error:=FSWrite(currentOut, count, Ptr(outBuffer));
  558.                                         {* outBuffer: ARRAY [1..7] OF BYTE; *}
  559.  
  560. the serial driver goes into an infinite loop somewhere in its code. 
  561. In MacsBug it looks like this:
  562.  
  563.                     _vSyncWait    MOVE.W        $0010(A0),D0
  564.                                                             BGT.S             _vSyncWait
  565.  
  566. D0 stays $01 forever...
  567.     
  568. This only happens, when I use "external modem" in the portable control 
  569. panel (which I must when using the unit to communicate with) or when
  570. I use the printer port with the "internal modem" set (which doesn´t
  571. make sense for my application, but I tried it anyway).
  572.  
  573. I am opening the serial driver with the "OpenDriver" routines and I stick
  574. to the tool box calls of the Driver Mgr. and the Serial Mgr.
  575.  
  576. On my old Macintosh Portable  (as on all other Macs incl. PowerMac) it
  577. runs just fine.
  578. The error occurs no matter which fax/etc. software is or is not 
  579. installed and it occurs independently of the make of the installed modem.
  580.  
  581. PLEASE HELP!
  582.  
  583. Mathias.
  584. - ---------------------------
  585. Dept. of CS
  586. University of Zurich
  587. Switzerland
  588. email: mrichter@ifi.unizh.ch
  589. - ---------------------------
  590.  
  591. +++++++++++++++++++++++++++
  592.  
  593. >From mxmora@unix.sri.com (Matt Mora)
  594. Date: 30 Aug 1994 08:07:58 -0700
  595. Organization: SRI International, Menlo Park, CA
  596.  
  597. In article <mrichter-300894155324@ifimac06.ifi.unizh.ch> mrichter@ifi.unizh.ch (Mathias W. Richter) writes:
  598. >I have a problem with an application that reads/writes data
  599. >from/to an external unit (bicycle computer that collects 
  600. >data) via the serial ports of the Mac.
  601.  
  602. You forgot to set the handshake.
  603.  
  604. OSErr:=SerHShake(refNum_integer,flags_SerShk);
  605.  
  606.  
  607.  
  608. Xavier
  609.  
  610. P.S. I know because I made the same mistake. :-)
  611.  
  612.  
  613.  
  614.  
  615. -- 
  616. ___________________________________________________________
  617. Matthew Xavier Mora                       Matt_Mora@sri.com
  618. SRI International                       mxmora@unix.sri.com
  619. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  620.  
  621. +++++++++++++++++++++++++++
  622.  
  623. >From h+@nada.kth.se (Jon W{tte)
  624. Date: Tue, 30 Aug 1994 22:29:16 +0200
  625. Organization: Royal Institute of Something or other
  626.  
  627. In article <mrichter-300894155324@ifimac06.ifi.unizh.ch>,
  628. mrichter@ifi.unizh.ch (Mathias W. Richter) wrote:
  629.  
  630. >data) via the serial ports of the Mac.
  631. >
  632. >The application runs fine on all Macs except for the PowerBooks.
  633.  
  634. This, if anything, SHOULD go into the FAQ. Any volounteers for 
  635. a Q&A on this?
  636.  
  637. The PowerBooks serial drivers default to handshaking ON - you 
  638. have to call SerHShk to set handshaking to what you need.
  639.  
  640. However, calling FSRead/FSWrite on the serial ports is bad 
  641. style; using asynchronous PBReads and PBWrites are better, and 
  642. doing that while also using the Threads Manager takes you to 
  643. the upper half of the coolness ladder.
  644.  
  645. Oh, and _vSyncWait is where all drivers go to die, temporarily, 
  646. until the synchronous call they wait for completes and sets the 
  647. result code of the parameter block.
  648.  
  649. Cheers,
  650.  
  651.                     / h+
  652.  
  653.  
  654. --
  655.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  656.  
  657.   Reality exists only in your imagination.
  658.  
  659.  
  660. +++++++++++++++++++++++++++
  661.  
  662. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  663. Date: Wed, 31 Aug 1994 23:18:04 +1200 (NZST)
  664. Organization: (none)
  665.  
  666. mrichter@ifi.unizh.ch (Mathias W. Richter) writes:
  667. > I have a problem with an application that reads/writes data
  668. > from/to an external unit (bicycle computer that collects 
  669. > data) via the serial ports of the Mac.
  670.  
  671. This is the standard PowerBook Serial Port Lockup FAQ.
  672.  
  673. You need to call SerHShake to turn hardware handshaking off if you
  674. don't want to use hardware handshaking.
  675.  
  676. Hardware handshaking is turned on by default when you reset the serial
  677. ports, but it just happens that on desktop Macs you can usually get away
  678. with leaving the handshaking pins unconnected.  Not so on portables.
  679.  
  680. -- Bruce
  681.  
  682. +++++++++++++++++++++++++++
  683.  
  684. >From arose@ATHENA.MIT.EDU (Alex Rosen)
  685. Date: 7 Sep 1994 17:03:14 GMT
  686. Organization: Massachusetts Institute of Technology
  687.  
  688. Here's the code I use now.  I'm certainly not a Serial Driver
  689. expert, but it works for me.  Note taht all I'm sending is a dial string
  690. ("ATDT" etc.), so I'm not worrying about flow control or async
  691. routines.
  692.  
  693. --Alex
  694.  
  695. OpenDriver("\p.AOut", &outDriver);
  696. OpenDriver("\p.AIn", &inDriver); 
  697.  
  698.     // Turn off hardware handshaking.      
  699. SerShk    shake;
  700. memset( &shake, 0, sizeof(shake) );
  701. SerHShake( outDriver, &shake );
  702. SerHShake( inDriver, &shake );
  703.         
  704.     // set baud rate and stuff
  705. SerReset(outDriver, baud300 | stop10 | noParity | data8);
  706. SerReset(inDriver, baud300 | stop10 | noParity | data8);
  707.         
  708.     // send string
  709. long count = strlen(toModemBuf);
  710. FSWrite(outDriver, &count, toModemBuf);
  711.  
  712.  
  713.  
  714. ---------------------------
  715.  
  716. >From seanmcd@ac.dal.ca
  717. Subject: Using CLUTs to simulate page flipping?
  718. Date: 1 Sep 94 21:15:11 -0300
  719. Organization: Dalhousie University, Halifax, Nova Scotia, Canada
  720.  
  721. Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  722. would involve using 16 colours in a 256 colour palette. The top and bottom
  723. nybbles of the byte would hold the values for "page 1" and "page 2". Games
  724. like Oxyd and Syndicate show that very good looking 16-colour games can be
  725. made. 
  726.  
  727. How would this work? For the byte XXXX0000, for instance, you'd make 16 of
  728. your CLUT entries (00000000, 00010000, 00100000, etc.) the same colour and
  729. so on for the 16 possible low nybble values. For the byte 0000XXXX you'd do
  730. the converse. To "flip" the pages you'd change the CLUT.
  731.  
  732. Would the fact that you could save the blit to the screen outweigh the overhead
  733. of using half-bytes and changing the CLUT? Anyone have any best guesses on
  734. this?
  735.  
  736. Sean
  737.  
  738. +++++++++++++++++++++++++++
  739.  
  740. >From Hiep Dam <starlabs@delphi.com>
  741. Date: Fri, 2 Sep 94 00:39:54 -0500
  742. Organization: Delphi (info@delphi.com email, 800-695-4005 voice)
  743.  
  744. <seanmcd@ac.dal.ca> writes:
  745.  
  746. >Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  747. >would involve using 16 colours in a 256 colour palette. The top and bottom
  748. >nybbles of the byte would hold the values for "page 1" and "page 2". Games
  749. >like Oxyd and Syndicate show that very good looking 16-colour games can be
  750. >made. 
  751.  
  752. I believe (though I can't be sure) that Arashi does this. Actually I'm
  753. pretty sure. For those not familiar with Arashi, it's basically a clone
  754. to that cool Atari game of years past, Tempest. I think Arashi uses 2
  755. 16 color "planes" within a 256 color palette, and does simulate page
  756. flipping with this.
  757.  
  758. You can find the source code to Arashi, along with the "Vector kit", at
  759. all the popular sites you find source code at. It's was originally written
  760. by the Jurri Munkki, with additional help from team members of Project
  761. Storm.
  762.  
  763. Note however that Arashi's method isn't fullproof. While it works fine
  764. on my IIsi, I get some errant "writes" to the screen on my PowerBook Duo
  765. 230 (when docked, of course).
  766.  
  767. Hiep
  768. starlabs@aol.com += starlabs@delphi.com
  769. "If we are to be labeled, I would have preferred 'Might Morphin Generation X'"
  770.  
  771. +++++++++++++++++++++++++++
  772.  
  773. >From Hugh.Fisher@anu.edu.au (Hugh Fisher)
  774. Date: Fri, 02 Sep 1994 13:46:24 +1000
  775. Organization: BAMBI, Australian National University
  776.  
  777. In article <1994Sep1.211511.27056@ac.dal.ca>, seanmcd@ac.dal.ca wrote:
  778.  
  779. > Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  780. > would involve using 16 colours in a 256 colour palette. The top and bottom
  781. > nybbles of the byte would hold the values for "page 1" and "page 2". Games
  782. > like Oxyd and Syndicate show that very good looking 16-colour games can be
  783. > made. 
  784. > How would this work? For the byte XXXX0000, for instance, you'd make 16 of
  785. > your CLUT entries (00000000, 00010000, 00100000, etc.) the same colour and
  786. > so on for the 16 possible low nybble values. For the byte 0000XXXX you'd do
  787. > the converse. To "flip" the pages you'd change the CLUT.
  788. > Would the fact that you could save the blit to the screen outweigh the overhead
  789. > of using half-bytes and changing the CLUT? Anyone have any best guesses on
  790. > this?
  791.  
  792.   I've played around with this a bit, and found two problems.
  793.  
  794.   The minor one is that if you use the Palette Manager, changing the CLUT
  795.   is *slower* than blitting to the screen. I imagine this is because of the
  796.   need to scan and update the other palettes, because it seems to depend on
  797.   on the mix of other applications open at the time.
  798.  
  799.   You can get around this by using the lower level device calls instead,
  800.   which would be real unsociable for a regular application but acceptable
  801. for 
  802.   a game I guess.
  803.  
  804.   The major one is that drawing to the screen becomes a real pain, because
  805.   you can't touch the high/low 4 bits in each pixel. You have to use
  806. logical
  807.   AND mode (or OR if you know where you are drawing is clear) and use pixel
  808.   values with the high/low bits all set. For bitmapped images, this means
  809.   keeping two copies of each.
  810.  
  811.   Of course, you could try writing your own graphic primitives...but as the
  812.   FAQ for this group explains in detail, this is a Really Bad Idea.
  813.  
  814.   My "guess" therefore is that it is a worthwhile technique if you're
  815. prepared
  816.   to put a lot of time and effort into it (maybe someone already has?) but
  817.   not if you want a quick, easy, and portable solution.
  818.  
  819.         Hugh Fisher
  820.         Biochemistry and Molecular Biology, Australian National University
  821.  
  822. +++++++++++++++++++++++++++
  823.  
  824. >From keyesea@ctrvax.vanderbilt.edu (Edward Keyes)
  825. Date: Sun, 4 Sep 1994 21:47:10 GMT
  826. Organization: Vanderbilt University
  827.  
  828. In article <B+ySeM6.starlabs@delphi.com>,
  829. Hiep Dam <starlabs@delphi.com> wrote:
  830.  
  831. > <seanmcd@ac.dal.ca> writes:
  832. >  
  833. > >Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  834. > >would involve using 16 colours in a 256 colour palette. The top and bottom
  835. > >nybbles of the byte would hold the values for "page 1" and "page 2". Games
  836. > >like Oxyd and Syndicate show that very good looking 16-colour games can be
  837. > >made. 
  838. >  
  839. > I believe (though I can't be sure) that Arashi does this. Actually I'm
  840. > pretty sure. For those not familiar with Arashi, it's basically a clone
  841. > to that cool Atari game of years past, Tempest. I think Arashi uses 2
  842. > 16 color "planes" within a 256 color palette, and does simulate page
  843. > flipping with this.
  844.  
  845. I have always thought that this method would be just superb in combination
  846. with a pair of LCD shutter glasses for a 3D effect.  Just put the left eye
  847. view in the top nybble and the right eye view in the bottom and install an
  848. interrupt routine that animates the palette in synchronization with the
  849. monitor's refresh rate while simultaneously sending the appropriate signal
  850. across a serial or ADB port to the glasses to flip the shutters.
  851.  
  852. And presto!  30+ fps true stereoscopic graphics with a lot less processor
  853. overhead than having to individually blit the left and right eye views
  854. over and over again.
  855.  
  856. Has anyone had any luck with adopting a set of those old Sega 3D glasses
  857. to the Mac for this sort of thing?
  858.  
  859. - ------  Edward Keyes (keyesea@ctrvax.vanderbilt.edu)  --------
  860. --  "This is what the LORD Almighty, the God of Israel says:  --
  861. --  'Drink, get drunk and vomit, and fall to rise no more.'"  --
  862. - --------------------------------  Jeremiah 25:27  ------------
  863.  
  864. +++++++++++++++++++++++++++
  865.  
  866. >From amanda@intercon.com (Amanda Walker)
  867. Date: Tue,  6 Sep 1994 14:55:43 -0400
  868. Organization: InterCon Systems Corporation, Herndon, VA  USA
  869.  
  870. Hiep Dam <starlabs@delphi.com> writes:
  871. > I believe (though I can't be sure) that Arashi does this. Actually 
  872. > I'm pretty sure. For those not familiar with Arashi, it's basically 
  873. > a clone to that cool Atari game of years past, Tempest. I think 
  874. > Arashi uses 2 16 color "planes" within a 256 color palette, and 
  875. > does simulate page flipping with this. 
  876.  
  877. Actually, Arashi uses two 3-bit (8 color) planes, and one 2-bit background 
  878. plane.  It also has the smoothest code for doing this sort of stuff on the Mac 
  879. that I've yet seen in the public domain.
  880.  
  881.  
  882. Amanda Walker
  883. InterCon Systems Corporation
  884.  
  885.  
  886.  
  887. +++++++++++++++++++++++++++
  888.  
  889. >From temple@itd.nrl.navy.mil (Dr. Jon Gerard Temple)
  890. Date: 6 Sep 1994 20:02:49 GMT
  891. Organization: Naval Research Laboratory
  892.  
  893. In article <9409061455.AA43720@fusion.intercon.com>
  894. amanda@intercon.com (Amanda Walker) writes:
  895.  
  896. > Hiep Dam <starlabs@delphi.com> writes:
  897. > > I believe (though I can't be sure) that Arashi does this. Actually 
  898. > > I'm pretty sure. For those not familiar with Arashi, it's basically 
  899. > > a clone to that cool Atari game of years past, Tempest. I think 
  900. > > Arashi uses 2 16 color "planes" within a 256 color palette, and 
  901. > > does simulate page flipping with this. 
  902. > Actually, Arashi uses two 3-bit (8 color) planes, and one 2-bit background 
  903. > plane.  It also has the smoothest code for doing this sort of stuff on the Mac 
  904. > that I've yet seen in the public domain.
  905.  
  906. It runs pretty smoothly, too.  I don't understand why people over at
  907. comp.sys.mac.games think it is a weak Tempest clone.  It is one of the
  908. best clones I have ever seen, and it is free, as well as a little more
  909. colorful than the original. I actually sent Juri Munkki a "fan" letter
  910. after seeing an early beta (called "STORM" then).  Tempest was one of
  911. the few games I really missed from my teen years...
  912.  
  913. +++++++++++++++++++++++++++
  914.  
  915. >From Darrin Cardani <Darrin.Cardani@AtlantaGA.NCR.COM>
  916. Date: Wed, 7 Sep 1994 17:10:59 GMT
  917. Organization: AT&T Global Information Solutions, Atlanta
  918.  
  919. >In article <34iht9$q1s@ra.nrl.navy.mil> Dr. Jon Gerard Temple writes: 
  920. [...stuff about Arashi...]
  921. >It runs pretty smoothly, too.  I don't understand why people over at
  922. >comp.sys.mac.games think it is a weak Tempest clone.  It is one of the
  923. >best clones I have ever seen, and it is free, as well as a little more
  924. >colorful than the original. I actually sent Juri Munkki a "fan" letter
  925. >after seeing an early beta (called "STORM" then).  Tempest was one of
  926. >the few games I really missed from my teen years...>
  927.  
  928. Geez! If they think Arashi is weak, they should see the
  929. piece of crap version I have on my Windows machine at
  930. work. It blinks really bad, firing doesn't work correctly.
  931. Oh well.
  932.  
  933. Darrin
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941. +++++++++++++++++++++++++++
  942.  
  943. >From jbum@netcom.com (Jim Bumgardner)
  944. Date: Wed, 7 Sep 1994 19:33:55 GMT
  945. Organization: Time Warner Interactive Group
  946.  
  947. seanmcd@ac.dal.ca wrote:
  948. : Has anyone tried using CLUTs to simulate page flipping on the Mac? This
  949. : would involve using 16 colours in a 256 colour palette. The top and bottom
  950. : nybbles of the byte would hold the values for "page 1" and "page 2". Games
  951. : like Oxyd and Syndicate show that very good looking 16-colour games can be
  952. : made. 
  953.  
  954. I wrote some sample code that uses an extension of this idea to do
  955. cross fades (cross dissolves) some months ago for a book
  956. I was working on.  I've made the code available by ftp from ftp.netcom.com
  957. in the directory pub/jbum.  The file is called CrossDissolveExample.sit
  958.  
  959. Although changing the CLUT is slower than blitting to the screen, it
  960. does allow for an extremely smooth crossfade effect which is especially
  961. effective for displaying movie credits.  The program "Credits" included
  962. with the archive demonstrates this.
  963.  
  964.  
  965. -- 
  966. --
  967. -- Jim Bumgardner                 |   jbum@netcom.com
  968. -- Time Warner Interactive
  969. -- GSC/MUd--p(-)c+++!lu+e-m*s/+n++(---)h--f!gw+t+ry++
  970.  
  971. ---------------------------
  972.  
  973. >From partingt@fwi.uva.nl (Vincent Partington)
  974. Subject: Why is AppleScript type checking absent?
  975. Date: 6 Sep 1994 08:37:27 GMT
  976. Organization: FWI, University of Amsterdam
  977.  
  978. Hi,
  979.  
  980. Why is that the AppleScript Script Editor doesn't warn me about passing the
  981. wrong type of data to requests while the 'aete' resource tells it what sort
  982. of data to expect?
  983.  
  984. The following line will compile just fine:
  985. open {file "hard disk:hello.c"}
  986. Although it should be:
  987. open {alias "hard disk:hello.c"}
  988.  
  989. Most of the time the first line will work because most handlers ask the AEM
  990. to coerce the argument into an FSSpec. But it's still wrong.
  991.  
  992. The following will also compile:
  993. open {"hard disk:hello.c"}
  994.  
  995. That won't work of course, but why won't AppleScript tell me about it?
  996. Why can't is see the open-event wants a list of aliases and either tell me
  997. it's wrong or (even better) convert it into an alias for me?
  998.  
  999. Thanks, Vincent.
  1000. -- 
  1001. appel peer banaan baksteen           ||| The Fingerware Project:
  1002. schelp zon zand rolstoel             ||| Put your code snippets in your .plan!
  1003. groen wit geel flatgebouw            ||| If you want to know more
  1004. boer postbode bouwvakker roos        ||| finger partingt@gene.fwi.uva.nl
  1005.  
  1006. +++++++++++++++++++++++++++
  1007.  
  1008. >From urge@mcl.ucsb.edu (Scott Bronson)
  1009. Date: 6 Sep 1994 19:33:45 GMT
  1010. Organization: University of California, Santa Barbara
  1011.  
  1012. In <34h9o7$t3o@hermes.fwi.uva.nl> partingt@fwi.uva.nl (Vincent Partington) writes:
  1013.  
  1014. >open {file "hard disk:hello.c"} vs. open {alias "hard disk:hello.c"}
  1015. >Most of the time the first line will work because most handlers ask the AEM
  1016. >to coerce the argument into an FSSpec. But it's still wrong.
  1017.  
  1018. No, it's correct.  The AppleScript Language Guide, p. 81, tells how
  1019. automatic coercion works.
  1020.  
  1021.  
  1022. >The following will also compile:
  1023. >open {"hard disk:hello.c"}
  1024.  
  1025. >That won't work of course, but why won't AppleScript tell me about it?
  1026. >Why can't is see the open-event wants a list of aliases and either tell me
  1027. >it's wrong or (even better) convert it into an alias for me?
  1028.  
  1029. Actually, sometimes it works.  This very script just executed perfectly
  1030. not two minutes ago...
  1031.  
  1032. tell application "Scriptable Text Editor"
  1033.         open {"Dev.CD Sep 93:Reference Library:Periodicals:develop:develop Issue 15:develop 15 code:Floaters:Source:floaters.make"}
  1034. end tell
  1035.  
  1036. My guess is that coercion from a string to an alias is automatic, although
  1037. the Language Guide does not make this obvious.  If an application's
  1038. dictionary is set up differently than the Scriptable Text Editor's,
  1039. your mileage may vary.
  1040.  
  1041. The reason the following is not flagged at compile time...
  1042.  
  1043. tell application "Scriptable Text Editor"
  1044.         open {1}
  1045. end tell
  1046.  
  1047. ...is because the open routine asks for a list, and that is exactly
  1048. what you are passing.  AppleScript doesn't worry about the contents
  1049. of the list, because they may change or be able to be coerced at run
  1050. time.
  1051.  
  1052. These are all just guesses, but I think I'm close...
  1053.  
  1054.     - Scott
  1055.  
  1056. +++++++++++++++++++++++++++
  1057.  
  1058. >From qsi@cnh.wlink.nl (Peter Kocourek)
  1059. Date: 07 Sep 94 18:15:17 +
  1060. Organization: Care Net Holland
  1061.  
  1062. Vincent Partington wrote on 06 Sep 94:
  1063.  
  1064.  VP> Why is that the AppleScript Script Editor doesn't warn me about 
  1065.  VP> passing the wrong type of data to requests while the 'aete' 
  1066.  VP> resource tells it what sort of data to expect? 
  1067.  
  1068. [snip]
  1069.  
  1070.  VP> The following will also compile: open {"hard disk:hello.c"} 
  1071.  VP> 
  1072.  VP> That won't work of course, but why won't AppleScript tell me 
  1073.  VP> about it? Why can't is see the open-event wants a list of aliases 
  1074.  VP> and either tell me it's wrong or (even better) convert it into 
  1075.  VP> an alias for me? 
  1076.  
  1077. I think it's probably related to coercion handlers; the Script Editor cannot
  1078. know which coercion handlers will be present at runtime, because applications
  1079. can install their own. So while there is no built-in handler for coercing
  1080. typeFSS to typeAlias, there could be one present by the time the application
  1081. is run.
  1082.  
  1083. So you're left with run-time type checking. I'm not particularly happy about
  1084. it myself, but I don't see any other alternative. Perhaps adding coercion
  1085. information in a resource? Then the Script Editor could take the built-in
  1086. coercions for granted, and add to that the coercion handlers the application
  1087. promises to install if it is run.
  1088.  
  1089.  
  1090. YHS:QSI!
  1091. ;Simple help instructions for fileserv via a GIGO gateway..
  1092. ; ASCII               Forces ASCII dump (ie text,etc)
  1093. ; BINARY              Forces UUENCODED binary files (autosplit)
  1094. ; DETECT              Autodetects ASCII/BINARY
  1095. ; GET filename.ext    gets a single file
  1096. ; GET filename.      gets anything starting with filename.
  1097. ; HELP                this help file
  1098. ; INDEX               Asks for the host's list of public files
  1099. ; SIZE xxx            Size per split (1500-45000)
  1100. ;Note on filenames: DOS wildcards are accepted, but not unix regex.
  1101. ;
  1102. ;
  1103. ;Questions? Email root@cnh.wlink.nl ..
  1104.  
  1105. +++++++++++++++++++++++++++
  1106.  
  1107. >From jwbaxter@olympus.net (John W. Baxter)
  1108. Date: Wed, 07 Sep 1994 17:56:10 -0700
  1109. Organization: Internet for the Olympic Peninsula
  1110.  
  1111. I believe it was in this thread earlier that I noticed a statement that a
  1112. path ("Vol:Folder:file") could be used...this is an artifact of (at least)
  1113. the Jon's Commands Scripting Addition, which installs a coercion osax
  1114. which converts from (suitable) TEXT to 'fss '.  Remove Jon's Commands (or
  1115. whatever other osax is installing the handler) and restart, and the
  1116. ability will go away (unless the target app itself installs a TEXT->fss 
  1117. handler).
  1118.  
  1119. Simple, eh?  No wonder there's no type checking.  --John
  1120.  
  1121. -- 
  1122. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1123.    "Occasionally...astronomers add a second to either June 31 or
  1124.     December 31..."   IM: OS Utilities, p 4-12
  1125.    jwbaxter@pt.olympus.net
  1126.  
  1127. +++++++++++++++++++++++++++
  1128.  
  1129. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  1130. Date: Thu, 8 Sep 1994 01:37:46 GMT
  1131. Organization: Apple Computer
  1132.  
  1133. Vincent Partington, partingt@fwi.uva.nl writes:
  1134. > Why is that the AppleScript Script Editor doesn't warn me about passing the
  1135. > wrong type of data to requests while the 'aete' resource tells it what sort
  1136. > of data to expect?
  1137.  
  1138. The data types in the 'aete' are just guidelines or documentation. There are
  1139. plenty of cases where several types can be passed to a parameter, and the
  1140. 'aete' doesn't indicate that. For that reason and others, AppleScript does
  1141. not use that information when compiling a script. It's a dynamic language
  1142. (like Smalltalk or Dylan) that does not do type checking at compile time;
  1143. this does let you make mistakes in your scripts, but it also allows you a lot
  1144. more flexibility.
  1145.  
  1146. --Jens Alfke                           jens_alfke@powertalk.apple.com
  1147.                    "A man, a plan, a yam, a can of Spam ... Bananama!"
  1148.  
  1149. ---------------------------
  1150.  
  1151. >From chris-b@cs.auckland.ac.nz (Chris Burns)
  1152. Subject: [Q] _PBCatSearch vs Recursive Indexed _PBGetCatInfo
  1153. Date: Mon, 05 Sep 1994 09:01:48 +1200
  1154. Organization: AucklandUniversity:ComputerScience:HMU
  1155.  
  1156. Hi all,
  1157.  
  1158. I'm just about to start working on a spare-time project that involves
  1159. scanning disk directories.
  1160.  
  1161. Now, there seem to be (at least) two ways fo doing this:
  1162.  
  1163. (1) _PBCatSearch (if supported)
  1164.  
  1165. (2) Indexed calls to _PBGetCatInfo, recursing when a directory is found. I'd
  1166.     probably use the modification to this algorithm suggested by John Norstad
  1167.     (this takes multiple processes creating, moving and deleting files and
  1168.     directories into account).
  1169.  
  1170. I've implemented (2) before and it was not particularly speedy on my 1GB
  1171. hard disk at work (~10,000 files!). Does anyone know if (1) is any faster?
  1172. I realize the search parameters probably make a huge difference on the
  1173. speed (partial filenames etc), but I'd probably use a "find-all" parameter
  1174. set.
  1175.  
  1176. Any help, flames or pointers appreciated,
  1177.  
  1178. Thanks In Advance,
  1179.  
  1180. Chris B
  1181. - ---------------------------------------------------------------------
  1182. NewZealand:AucklandUniversity:ComputerScience:HyperMediaUnit:ChrisBurns
  1183. Internet: chris-b@cs.auckland.ac.nz
  1184. Phone:    +64 9 373-7599 x6194
  1185. Fax:      +64 9 373-7453                         Async, therefore I am.
  1186. - ---------------------------------------------------------------------
  1187.  
  1188. +++++++++++++++++++++++++++
  1189.  
  1190. >From jumplong@aol.com (Jump Long)
  1191. Date: 5 Sep 1994 02:27:10 -0400
  1192. Organization: America Online, Inc. (1-800-827-6364)
  1193.  
  1194. In article <chris-b-0509940901480001@hmu7.cs.aukuni.ac.nz>,
  1195. chris-b@cs.auckland.ac.nz (Chris Burns) writes:
  1196.  
  1197. >I've implemented (2) before and it was not particularly speedy on my 1GB
  1198. >hard disk at work (~10,000 files!). Does anyone know if (1) is any
  1199. faster?
  1200. >I realize the search parameters probably make a huge difference on the
  1201. >speed (partial filenames etc), but I'd probably use a "find-all"
  1202. parameter
  1203. >set.
  1204.  
  1205. In general, PBCatSearch is faster. The only condition I've seen where
  1206. PBCatSearch is slower is if you are looking for *all* matches (i.e., all
  1207. files and directories) on an AppleShare volume.  The AppleShare client
  1208. asks for the CatSearch matches four at a time which doesn't shove the
  1209. information across the network as efficiently as indexed GetCatInfo calls
  1210. which are translated into afpEnumerate requests (which collect as many
  1211. directory entries as will fit into a full sized ATP response).  If you're
  1212. expecting just a few matches to specific criteria, however, PBCatSearch is
  1213. faster because all of the searching is done on the server and only the
  1214. matches are returned over the network.
  1215.  
  1216. >Any help, flames or pointers appreciated,
  1217.  
  1218. A couple of suggestions:
  1219.  
  1220. First, read the Technical Note "FL 31 - Searching Volumes-Solutions and
  1221. Problems". When I updated it a couple of years ago, I tried to cover much
  1222. of what you're asking.
  1223.  
  1224. Second, get MoreFiles v1.2.1.  I added an indexed search routine
  1225. (IndexedSearch) that is parameter block compatible and functionally
  1226. compatible with PBCatSearch except that you get to specify the directory
  1227. you want to search (for example, to search the whole volume, you just pass
  1228. fsRtDirID). I also added a glue routine (PBCatSearchSyncCompat) that calls
  1229. PBCatSearch if PBCatSearch is available and calls IndexedSearch if it's
  1230. not. MoreFiles can be found at:
  1231.  
  1232.     ftp.apple.com (IP address 130.43.2.3)
  1233.  
  1234.     /ftp/dts/mac/sc/more-files-1-2-1.hqx
  1235.  
  1236. - Jim Luther
  1237.  
  1238.  
  1239. +++++++++++++++++++++++++++
  1240.  
  1241. >From chris-b@cs.auckland.ac.nz (Chris Burns)
  1242. Date: Mon, 05 Sep 1994 19:17:00 +1200
  1243. Organization: AucklandUniversity:ComputerScience:HMU
  1244.  
  1245. In article <chris-b-0509940901480001@hmu7.cs.aukuni.ac.nz>,
  1246. chris-b@cs.auckland.ac.nz wrote:
  1247.  
  1248. > Hi all,
  1249. > I'm just about to start working on a spare-time project that involves
  1250. > scanning disk directories.
  1251.  
  1252. Well, since nobody had replied to my post for at least 2 hours :)
  1253. I wrote a quick test app.
  1254.  
  1255. Results:
  1256.  
  1257. Power Mac 8100/80, 1GB HD with 9,461 items (557.8 MB in disk)
  1258.  
  1259. _PBGetCatInfo:      ~1450 Ticks
  1260. _PBCatSearch:       ~65 Ticks
  1261.  
  1262. Wow!
  1263.  
  1264. I compiled the app with CodeWarrior CW4 and both PPC and 68K versions
  1265. performed similarly as expected (program involveds much heavy file I/O).
  1266.  
  1267. I'd be interested to see any other results...
  1268.  
  1269. Later,
  1270.  
  1271. Chris B
  1272.  
  1273. Code Follows...
  1274.  
  1275.  
  1276. ///////////////////////////////////////////////////////////////////////////////
  1277.  
  1278. void Prime_PBGetCatInfo (void);
  1279. void Enumerate_PBGetCatInfo (long CurDirID);
  1280. void Prime_PBCatSearch (void);
  1281. void Enumerate_PBCatSearch (void);
  1282.  
  1283. ///////////////////////////////////////////////////////////////////////////////
  1284.  
  1285. CInfoPBRec      gCInfoPB1;
  1286. Str255          gName;
  1287.  
  1288. ///////////////////////////////////////////////////////////////////////////////
  1289.  
  1290. void Prime_PBGetCatInfo (void)
  1291. {
  1292.     gCInfoPB1.dirInfo.ioNamePtr = gName;
  1293.     gCInfoPB1.dirInfo.ioVRefNum = -1;
  1294. }
  1295.  
  1296. ///////////////////////////////////////////////////////////////////////////////
  1297.  
  1298. void Enumerate_PBGetCatInfo (long CurDirID)
  1299. {
  1300. short   CurDirIndex = 0;
  1301. OSErr   Err;
  1302.  
  1303.     do
  1304.     {
  1305.         CurDirIndex++;
  1306.  
  1307.         gName[0] = 0;
  1308.  
  1309.         gCInfoPB1.dirInfo.ioFDirIndex = CurDirIndex;
  1310.         gCInfoPB1.dirInfo.ioDrDirID = CurDirID;
  1311.  
  1312.         Err = PBGetCatInfoSync(&gCInfoPB1);
  1313.  
  1314.         switch (Err)
  1315.         {
  1316.             case noErr:             
  1317.                 if (gCInfoPB1.dirInfo.ioFlAttrib & 16)
  1318.                     Enumerate_PBGetCatInfo(gCInfoPB1.dirInfo.ioDrDirID);
  1319.                 break;
  1320.  
  1321.             case fnfErr:
  1322.                 break;
  1323.  
  1324.             default:
  1325.                 DebugStr("\p_PBGetCatInfoSync FAILED");
  1326.                 break;
  1327.         }
  1328.     }
  1329.     while (Err == noErr);
  1330. }
  1331.  
  1332. ///////////////////////////////////////////////////////////////////////////////
  1333.  
  1334. CSParam         gCSParamPB;
  1335. CInfoPBRec      gCInfoPB2;
  1336.  
  1337. ///////////////////////////////////////////////////////////////////////////////
  1338.  
  1339. void Prime_PBCatSearch (void)
  1340. {
  1341.  
  1342.     gCSParamPB.ioNamePtr = nil;
  1343.     gCSParamPB.ioVRefNum = -1;
  1344.  
  1345.     gCSParamPB.ioMatchPtr = (FSSpecPtr)NewPtr(sizeof(FSSpec) * 1000);
  1346.     if ((gCSParamPB.ioMatchPtr == nil) || (MemError() != noErr))
  1347.         DebugStr("\p_NewPtr FAILED");
  1348.  
  1349.     gCSParamPB.ioReqMatchCount = 1000;
  1350.  
  1351.     gCSParamPB.ioSearchBits = 0;
  1352.  
  1353.     gCSParamPB.ioSearchInfo1 = (CInfoPBPtr)&gCInfoPB1;
  1354.     gCSParamPB.ioSearchInfo2 = (CInfoPBPtr)&gCInfoPB2;
  1355.  
  1356.     gCSParamPB.ioSearchTime = 0;
  1357.  
  1358.     gCSParamPB.ioCatPosition.initialize = 0;
  1359.  
  1360.     gCSParamPB.ioOptBuffer = NewPtr(16 * 1024L);
  1361.     if ((gCSParamPB.ioOptBuffer == nil) || (MemError() != noErr))
  1362.         DebugStr("\p_NewPtr FAILED");
  1363.  
  1364.     gCSParamPB.ioOptBufSize = 16 * 1024L;
  1365. }
  1366.  
  1367. ///////////////////////////////////////////////////////////////////////////////
  1368.  
  1369. void Enumerate_PBCatSearch (void)
  1370. {
  1371. OSErr   Err;
  1372.  
  1373.     do
  1374.     {
  1375.         Err = PBCatSearchSync(&gCSParamPB);
  1376.         switch (Err)
  1377.         {
  1378.             case noErr:
  1379.                 break;
  1380.  
  1381.             case eofErr:
  1382.                 break;
  1383.  
  1384.             default:
  1385.                 DebugStr("\p_PBCatSearchSync FAILED");
  1386.                 break;
  1387.         }
  1388.     }
  1389.     while (Err == noErr);
  1390. }
  1391.  
  1392. ///////////////////////////////////////////////////////////////////////////////
  1393.  
  1394. void main (void)
  1395. {
  1396. long    StartTicks;
  1397. Str255  Str1;
  1398. Str255  Str2;
  1399.  
  1400.     InitGraf(&qd.thePort);
  1401.  
  1402.     Prime_PBGetCatInfo();
  1403.     StartTicks = TickCount();
  1404.     Enumerate_PBGetCatInfo(fsRtDirID);
  1405.     NumToString(TickCount() - StartTicks,Str1);
  1406.  
  1407.     Prime_PBCatSearch();
  1408.     StartTicks = TickCount();
  1409.     Enumerate_PBCatSearch();
  1410.     NumToString(TickCount() - StartTicks,Str2);
  1411.  
  1412.     SysBeep(0);
  1413.     DebugStr(Str1);
  1414.     DebugStr(Str2);
  1415. }
  1416.  
  1417. ///////////////////////////////////////////////////////////////////////////////
  1418. - ---------------------------------------------------------------------
  1419. NewZealand:AucklandUniversity:ComputerScience:HyperMediaUnit:ChrisBurns
  1420. Internet: chris-b@cs.auckland.ac.nz
  1421. Phone:    +64 9 373-7599 x6194
  1422. Fax:      +64 9 373-7453                         Async, therefore I am.
  1423. - ---------------------------------------------------------------------
  1424.  
  1425. +++++++++++++++++++++++++++
  1426.  
  1427. >From h+@nada.kth.se (Jon W{tte)
  1428. Date: Mon, 05 Sep 1994 17:34:17 +0200
  1429. Organization: Royal Institute of Something or other
  1430.  
  1431. In article <chris-b-0509940901480001@hmu7.cs.aukuni.ac.nz>,
  1432. chris-b@cs.auckland.ac.nz (Chris Burns) wrote:
  1433.  
  1434. >I've implemented (2) before and it was not particularly speedy on my 1GB
  1435. >hard disk at work (~10,000 files!). Does anyone know if (1) is any faster?
  1436.  
  1437. PBCatSearch linearly searches the directory tree; and can be 
  1438. fast for things like name searches, but it's practically 
  1439. worthless if you want to know about file hiearchies.
  1440.  
  1441. PBGetCatInfo isn't too bad, especially if you read all the 
  1442. files FIRST, remembering which folders there were and going 
  1443. back to them after doing the scan (this is because there is 
  1444. some "next pointer" cache in the file system, it seems)
  1445.  
  1446. You should also remember how many files there are in the 
  1447. folder, and only iterate for that many if you want speed; the 
  1448. "miss" giving eofErr at the end can take magnitudes longer time 
  1449. than a "hit" for an indexed search!
  1450.  
  1451. Cheers,
  1452.  
  1453.                 / h+
  1454.  
  1455.  
  1456. --
  1457.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  1458.    This signature is kept shorter than 4 lines in the interests of UseNet
  1459.    S/N ratio.
  1460.  
  1461.  
  1462. +++++++++++++++++++++++++++
  1463.  
  1464. >From chris-b@cs.auckland.ac.nz (Chris Burns)
  1465. Date: Tue, 06 Sep 1994 10:13:49 +1200
  1466. Organization: AucklandUniversity:ComputerScience:HMU
  1467.  
  1468. In article <chris-b-0509941917000001@hmu7.cs.aukuni.ac.nz>,
  1469. chris-b@cs.auckland.ac.nz wrote:
  1470.  
  1471. > In article <chris-b-0509940901480001@hmu7.cs.aukuni.ac.nz>,
  1472. > chris-b@cs.auckland.ac.nz wrote:
  1473. > > Hi all,
  1474. > > 
  1475. > > I'm just about to start working on a spare-time project that involves
  1476. > > scanning disk directories.
  1477. > Results:
  1478. > Power Mac 8100/80, 1GB HD with 9,461 items (557.8 MB in disk)
  1479. > _PBGetCatInfo:      ~1450 Ticks
  1480. > _PBCatSearch:       ~65 Ticks
  1481.  
  1482. Well, it gets more interesting...
  1483.  
  1484. FileSharing:                    On  |    Off
  1485. - ----------------------------------+--------
  1486. PPC App:  _PBGetCatInfo:     ~5050  |  ~1450
  1487.           _PBCatSearch:        ~65  |    ~65
  1488.                                     |
  1489. 68K App:  _PBGetCatInfo:     ~5030  |  ~1480
  1490.           _PBCatSearch:        ~65  |    ~65
  1491.  
  1492. Seems like FileSharing causes a big hit on _PBGetCatInfo!
  1493.  
  1494. Later,
  1495.  
  1496. Chris B
  1497. - ---------------------------------------------------------------------
  1498. NewZealand:AucklandUniversity:ComputerScience:HyperMediaUnit:ChrisBurns
  1499. Internet: chris-b@cs.auckland.ac.nz
  1500. Phone:    +64 9 373-7599 x6194
  1501. Fax:      +64 9 373-7453                         Async, therefore I am.
  1502. - ---------------------------------------------------------------------
  1503.  
  1504. +++++++++++++++++++++++++++
  1505.  
  1506. >From chris-b@cs.auckland.ac.nz (Chris Burns)
  1507. Date: Tue, 06 Sep 1994 13:28:28 +1200
  1508. Organization: AucklandUniversity:ComputerScience:HMU
  1509.  
  1510. In article <34ednu$i8s@search01.news.aol.com>, jumplong@aol.com (Jump
  1511. Long) wrote:
  1512.  
  1513. > In general, PBCatSearch is faster. The only condition I've seen where
  1514. > PBCatSearch is slower is if you are looking for *all* matches (i.e., all
  1515. > files and directories) on an AppleShare volume.  The AppleShare client
  1516. > asks for the CatSearch matches four at a time which doesn't shove the
  1517. > information across the network as efficiently as indexed GetCatInfo calls
  1518. > which are translated into afpEnumerate requests (which collect as many
  1519. > directory entries as will fit into a full sized ATP response).  If you're
  1520. > expecting just a few matches to specific criteria, however, PBCatSearch is
  1521. > faster because all of the searching is done on the server and only the
  1522. > matches are returned over the network.
  1523.  
  1524. I tried this, and Jim is correct.
  1525.  
  1526. PPC App:  _PBGetCatInfo:     ~4820 Ticks
  1527.           _PBCatSearch:      ~5155 Ticks
  1528.  
  1529. Thanks Jim!
  1530.  
  1531. Chris B
  1532. - ---------------------------------------------------------------------
  1533. NewZealand:AucklandUniversity:ComputerScience:HyperMediaUnit:ChrisBurns
  1534. Internet: chris-b@cs.auckland.ac.nz
  1535. Phone:    +64 9 373-7599 x6194
  1536. Fax:      +64 9 373-7453                         Async, therefore I am.
  1537. - ---------------------------------------------------------------------
  1538.  
  1539. +++++++++++++++++++++++++++
  1540.  
  1541. >From jumplong@aol.com (Jump Long)
  1542. Date: 6 Sep 1994 00:07:06 -0400
  1543. Organization: America Online, Inc. (1-800-827-6364)
  1544.  
  1545. In article <9668AA910719.386758@klkmac014.nada.kth.se>, h+@nada.kth.se
  1546. (Jon W{tte) writes:
  1547.  
  1548. >You should also remember how many files there are in the 
  1549. >folder, and only iterate for that many if you want speed; the 
  1550. >"miss" giving eofErr at the end can take magnitudes longer time 
  1551. >than a "hit" for an indexed search!
  1552.  
  1553. That's not a good idea because the number of items in a directory can
  1554. change - another process or another client using a shared volume could
  1555. delete or add one or more files/directories to the folder you're indexing
  1556. through.  There also could or may be foreign file systems that don't
  1557. return the ioDrNmFls.
  1558.  
  1559. - Jim Luther
  1560.  
  1561. +++++++++++++++++++++++++++
  1562.  
  1563. >From h+@nada.kth.se (Jon W{tte)
  1564. Date: Tue, 06 Sep 1994 11:59:27 +0200
  1565. Organization: Royal Institute of Something or other
  1566.  
  1567. In article <34gpta$82s@search01.news.aol.com>,
  1568. jumplong@aol.com (Jump Long) wrote:
  1569.  
  1570. >>You should also remember how many files there are in the 
  1571. >>folder, and only iterate for that many if you want speed; the 
  1572. >>"miss" giving eofErr at the end can take magnitudes longer time 
  1573. >>than a "hit" for an indexed search!
  1574.  
  1575. >That's not a good idea because the number of items in a directory can
  1576. >change - another process or another client using a shared volume could
  1577.  
  1578. Yes. I should have made it clear that this was a trade-off. You 
  1579. can make sure that you get all files by reading the previous 
  1580. info right after you read the next info, and check that it's 
  1581. "still there". You can get the name of the last file once you 
  1582. get the number of files, and then start over if the file with 
  1583. index <lastIndex> does not have the name <nameOfLastFile>. Etc.
  1584.  
  1585. Cheers,
  1586.  
  1587.                 / h+
  1588.  
  1589.  
  1590. --
  1591.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  1592.  
  1593.   "Have a bearable day."
  1594.  
  1595.  
  1596. +++++++++++++++++++++++++++
  1597.  
  1598. >From alexr@apple.com (Alex Rosenberg)
  1599. Date: Tue, 6 Sep 1994 10:04:30 GMT
  1600. Organization: Hackers Anonymous
  1601.  
  1602. In article <chris-b-0609941013490001@hmu7.cs.aukuni.ac.nz>,
  1603. chris-b@cs.auckland.ac.nz wrote:
  1604.  
  1605. <All sorts of interesting stuff deleted>
  1606. > Seems like FileSharing causes a big hit on _PBGetCatInfo!
  1607.  
  1608. File Sharing adds information to the response from PBGetCatInfo. This
  1609. information is rather complicated to determine. File Sharing makes no
  1610. changes to the response from PBCatSearch.
  1611.  
  1612. - -------------------------------------------------------------------------
  1613. -  Alexander M. Rosenberg  - INTERNET: alexr@apple.com      - Yoyodyne    -
  1614. -  330 Waverley St., Apt B - UUCP:ucbvax!apple!alexr        - Propulsion  -
  1615. -  Palo Alto, CA 94301     -                                - Systems     -
  1616. -  (415) 329-8463          - Nobody is my employer so       - :-)         -
  1617. -  (408) 974-3110          - nobody cares what I say.       -             -
  1618.  
  1619. ---------------------------
  1620.  
  1621. End of C.S.M.P. Digest
  1622. **********************
  1623.  
  1624.  
  1625.