HDTenEightyP/NetNews huggingface dataset:
From: sigurasg@rhi.hi.is (Sigurdur Asgeirsson)
Newsgroups: comp.sys.mac.programmer
Subject: CTB async Read/Write woes
Date: 7 Jan 93 11:49:17 GMT


  I've been trying to use the CMRead and CMWrite calls asyncronously,
with a completion procedure that starts the next Read/Write. It seems
to me that some tools disable all interrupts while a completion proc is
running, and then try to do some kind of sync-ing (with an interrupt
routine) on an async Read/Write, resulting in TOTAL lockup of the
machine. I finally wound up setting up a VBL task to start the next
Read/Write, which works but seems rather cludgy.
  So my questions to you CTB experts out there:

1. Is one supposed to be able to do a CMRead/Write from a completion proc?
2. Where do I find documentation on the new, all singing, all
   dancing CMPB* calls (that are declared in my <Connections.h>)? And,
   as an aside, how is the completion procedures associated with those
   calls to know which call just finished?
3. Does the AppleTalk ADSP Tool support timeouts on Reads/Writes?
4. Do some (Apple provided) comm tools return the wrong error code on
   timeout of Read/Write?
5. Does Santa Claus exist?


-- 
Sigurdur Asgeirsson    | "Well you know, C isn't that hard, void (*(*f[])())()
Fjardarsel 21          | for instance defines f as an array of unspecified size,
109 Reykjavik, Iceland | of pointers to functions that return pointers to
sigurasg@rhi.hi.is     | functions that return void... I think"
From: bowman@reed.edu (BoBolicious)
Newsgroups: comp.sys.mac.programmer
Subject: Re: C array question
Date: 12 Jan 93 22:52:53 GMT
Article-I.D.: reed.1993Jan12.225253.4470
Organization: Reed College, Portland, OR

In article <1993Jan12.204011.26034@kronos.arc.nasa.gov> joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91) writes:
>In article <C0prG1.AsC@plato.ds.boeing.com> housen@plato.ds.boeing.com (Kevin housen/.na) writes:

>> [Discussion about 2-d arrays omitted]

>If you use NewHandle, you will have to lock them and only deal with 
>thier de-referenced ptrs.  This is no gain.

Huh?!?  Most of the time, it makes sense to use handles, particularly if the
the arrays are big or there are lots of other things going on.  Then when you
need to access a particular row, you lock it down and dereference into a local
pointer.  For anything real, it's well worth the effort, and with little
performance loss.

I changed the Distribution: to "world"  That's where we live folks, it's more
than just "usa".

cheers,
bobo              In seeking the unattainable,
bowman@reed.edu            simplicity only gets in the way.
"On Monday, numbers floated everywhere, and the world was full of 
approximations."  -- Spencer Heinz, _The Oregonian_, 1/5/93
Newsgroups: comp.sys.mac.programmer
Subject: Re: using the A5 register (help wanted)
From: misc042@cantua.canterbury.ac.nz (Mr M J Miller)
Date: Mon, 4 Jan 1993 09:33:43 GMT
Organization: University of Canterbury, Christchurch, New Zealand.
X-Newsreader: TIN [version 1.1 PL8]

Radu (rduta@nyx.cs.du.edu) wrote:
> In any case what exactly is A5, does it hold and pointer or handle, and what
> is the format for what it holds?

	Format? -Of a register? -Would be 32 bits in various states!
;-}
misc042@cantua.canterbury.ac.nz OR
m.miller@csc.canterbury.ac.nz
(I am no way employed by,
	or a spokesperson of,
		the University of Canterbury)

Newsgroups: comp.sys.mac.programmer
From: mike@rahul.net (Mike Smithwick)
Subject: Movieshop bugs
Organization: a2i network
Distribution: na
Date: Wed, 13 Jan 1993 02:19:21 GMT

[]

I am trying to use Movieshop from the Quicktime developers CD, a 1991
version. But it crashes the machine whenever I try to save a movie.
Is there a later working version available anywhere for ftp? I checked
the apple server and couldn't find anything there.

mike


-- 
This message brought to you by the Happy Fun Ball! It's Happy! It's
fun!! It's the HAPPY FUN BALL!!! (Still legal in 16 states)
*** Mike Smithwick - mike@rahul.net 
*** No disclaimer is necessary since I only work for myself, HA! HA! HA! HA!
From: jmatthews@desire.wright.edu
Newsgroups: comp.sys.mac.programmer
Subject: Detecting double click?
Date: 8 Jan 93 00:28:31 EST
Organization:  Wright State University 

Recently I suggested the following way to check for double clicks:

 var gLastMouseUp: EventRecord;

 procedure SaveLastMouseUp(event: EventRecord);
 begin
   gLastMouseUp := event
 end;

 function CheckDoubleClick (event: EventRecord): Boolean;
   var slop: Rect;
 begin
   with gLastMouseUp.where do
     SetRect(slop, h - 2, v - 2, h + 2, v + 2);
   CheckDoubleClick:= ((event.when - gLastMouseUp.when) <=
     GetDblTime) and (PtInRect(event.where, slop))
 end;

In the main event loop, call SaveLastMouseUp in response to mouseUp
events, and call CheckDoubleClick in response to mouseDown events. The
latter returns true when a double click (as defined in IM vol.I,
p.260) occurs.

This definition of a double click can lead to some confusion in
subsequent calls to StillDown or WaitMouseUp. An alternative is to
measure time between mouseDown events as follows:

 var gLastMouseDown: EventRecord;
 {should initialize gLastMouseDown.when to 0}

 function CheckDoubleClick (event: EventRecord): Boolean;
   var
     slop: Rect;
     test: Boolean;
 begin
   with gLastMouseDown.where do
     SetRect(slop, h - 2, v - 2, h + 2, v + 2);
   test := ((event.when - gLastMouseDown.when) <= GetDblTime) and
            (PtInRect(event.where, slop));
   if test then
     gLastMouseDown.when := 0 {prevent multiple clicks}
   else
     gLastMouseDown := event; {save this one for future testing}
   CheckDoubleClick := test
 end;

How are others doing it?

o----------------------------------------------------------------------------o
| John B. Matthews, jmatthews@desire.wright.edu, disclaimer:= myViews <> WSU |
|      "Whom the gods would destroy, they first invite to program in C"      |
o----------------------------------------------------------------------------o
Newsgroups: comp.sys.mac.programmer
From: dawson@cs.cornell.edu (Dawson Dean)
Subject: Re: protection == !piracy
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Fri, 8 Jan 1993 01:14:53 GMT

In article <1993Jan7.223316.10564@hobbes.kzoo.edu> k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
>sainaney@unixg.ubc.ca (Narayan R. Sainaney) writes:
>>	Now the big question: I do come across a copy of the program
>>that has been pirated. Being a small compnay with limited finances
>>(and lawyer support), fow far can I prosecute(sp?)

>You might consider another form of punishment:  publish the names of
>known offenders in subsequent releases of the program.  That is, in your
>About box for version 1.0.1, list the people who you know gave away
>copies of version 1.0.

I really think both of these ideas go in the wrong direction and
further aggravate the adversarial relationship between software
developer and consumer. As somebody else said earlier, the consumer
trusts the developer to deliver correct software, or at least deal
with bugs in a timely and honest fashion. The developer should in
turn treat the customer with real respect, even in the sensitive
area of protecting against piracy. Common experience proves that
treating the customer well is the best way to keep and gain customers
and sell product.

If they start into hassling users, companies are only going to create
such a bad market image that they'll shoot themselves in the foot.

This is a technical product, the problem is technical (copying data)
and there are technical solutions that probably work as well as the
imperfect court system or advertising. A good and flexible lisencing
scheme could be such a technical solution.




-- 

/*******************************************************************/
/* Dawson Dean                    Internet: dawson@cs.cornell.edu  */
/* Cornell Computer Science       Office:   (607) 255-1068         */
Newsgroups: comp.sys.mac.programmer
From: kurisuto@chopin.udel.edu (Sean J. Crist)
Subject: Apple event questions
Organization: University of Delaware
Date: Sat, 9 Jan 1993 18:01:02 GMT

I'm updating an application to support the required Apple events, but I
still want to support the old CountAppFiles/GetAppFiles scheme for users
who aren't running under System 7.  If I have my High Level Event bit set
in my SIZE resource, I know that I will receive odoc Apple Events, etc.
What I'm not sure of is whether the Toolbox also sends the information the
old way as well.  Do I have to use Gestalt to see whether I will get Apple
events to open my startup documents (and specifically not call
CountAppFiles to avoid getting the same information twice), or can I just
go ahead and do both, knowing that CountAppFiles will return 0 files if
there are odoc Apple events pending?

Second question:  is the Apple Event Registry available through any ftp
sites, or do I have to order a hard copy from APDA?

Trivia question:  what is the history of reserved bit 9 of the 'what'
field of an event record?  Something I read suggested that this bit once
had some meaning (perhaps in early development versions before the Mac was
ever released), but that it no longer does.  Is this some vestige of an
interesting piece of Mac history?  (I have to wonder why Apple didn't use
this unused bit for Multifinder events, instead of appropriating App4Evt,
which some applications might have been using.)

Thank you!

--Kurisuto
From: jahnke@biosci.arizona.edu (Jerome Jahnke)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Stallman and friends
Date: 6 Jan 93 22:44:07 GMT
Followup-To: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools,comp.windows.ms.programmer
Organization: University of Arizona

In article <1993Jan6.142339.28227@kth.se>, d88-jwa@dront.nada.kth.se (Jon
Wtte) wrote:
> 
> In <1993Jan5.213038.2088@netcom.com> jimlynch@netcom.com (Jim Lynch) writes:
> 
> >How fo you feel about software patents? If you're threatened by ideas that
> >the FSF espouse, such as my right to write anything I damn well please, I
> >hereby threaten you. How do you like me now?
> 
> Well, I have mixed feelings.
> 
> 1) If I cook up something on my own and code it, I should be free
>    from liability
> 2) If someone diassembles that something and uses the algorithm,
>    he should not be free from liability
> 
> Maybe a limited kind of patent that lasts for say 5 years, like
> they have in the medical business (only there it's 2 years)

5 YEARS??????? I think that this is still a bit on the long side. How many
people out there use programs that were developed 5 years ago? I know we
may all use algorithms developed that long ago. Would favor a 2 year with
an option to renew for additional years. This would get info out to folks
much faster and still allow a developer to collect for a good idea, or even
establish a prominet market position.

> And software lends itself to licensing readily; you could imagine
> a global ftp site with patented algorithm example implementations
> for study & use, coupled with the address to obtain licensing...

I too feel that the support and distribution mechanism for software needs
to be reworked. Software is not a manufacturing industry. Which is why you
can have all the moralizing about software piracy. The software industry is
on the forefront of the information economy, and new techniques need to be
developed for dealing with it. Shareware is rapidly becoming that however
(no manufacturing at all) but it is a shame that there is no way to enforce
payment of shareware. I wonder if the SPA sues for illegal copies of
shareware on machines when they do raids. Or do they just protect
commercial companies?

> Cheers,
> 
> 								/ h+
> -- 
>  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
> 
>    Cookie Jar: Vanilla Yoghurt with Crushed Oreos.

Jer,
----
Jerome Jahnke
Biology Learning Center
University of Arizona
jahnke@biosci.arizona.edu or +1 (602) 621-3820
Newsgroups: comp.sys.mac.programmer
Distribution: world
From: Tanio_D._Klyce@bmug.org
Organization: BMUG, Inc.
Date: Sat, 09 Jan 1993 13:38:31 PST
Subject: RE: Where can I get MacsBugs ?

If you order a $30 subscription of "develop" from APDA (Apple) you get the
Developer CD Series CD, which has the latest MacsBugs, as well as the latest
System software, all back issue of "develop", (quite a good magazine), all of
the Macintosh tech notes, and much more. Of course, this will not help you if
you do not have access to a CD drive, or if this was not the price you were
looking for. You can also buy "Debugging Macintosh Software with MacsBugs" for
$34.95 from them to go along with the software. Or you can get the software
and the manual from them for $34.95.
The UK Develop contact is Jennie Rose, 44-81-569 11 99. She has an AppleLink
account : UK.DEVSERV.
Hope this is of some help.

**** From Planet BMUG, the FirstClass BBS of BMUG.  The message contained in
**** this posting does not in any way reflect BMUG's official views.
Newsgroups: comp.sys.mac.programmer
Distribution: world
From: sharkman@magicbb.uucp (Matt Daw)
Organization: MAGIC - Macintosh Awareness Group In Canada
Date: Sun, 10 Jan 1993 10:54:22 EST
Subject: Re: C on a Mac: How to get started?

I would advise that he get Think C, Inside Macintosh, ResEdit, Learn C on the
Macintosh + C Programming Primer Vols 1 & 2 by Dave Mark. Other things that he
might like would be Develop CDs from APDA which provide lots of sample source
code and Inside Macintosh online.

Matt
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Cross-platform editing, MPW
Date: 8 Jan 93 17:05:06 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <1ihsevINNpn2@shelley.u.washington.edu> stevep@wrq.com (Steve Poole) writes:

>Does anyone know of text editor that has these features?
>  1) Open files with CRLF line endings, without displaying the LFs, and
>     save the file with CRLF line endings.
>  2) Convert spaces to tabs and tabs to spaces on opening and saving.
>  3) Apple Event aware so that it can be told from MPW to open a file
>     and go to a particular line number.

Alpha, version 5.1. Pick it up from titan.cs.edu or any good
FTP site. $25 shareware - pay it; I did!

Cheers,

							/ h+
-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --

   There's no sex act that can't be made better with Yell-O.
From: d88-jwa@hemul.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: A record manager for the MAC
Date: 12 Jan 93 12:55:46 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <9301111504.aa01750@Bonnie.ics.uci.edu> lhuynh@Bonnie.ICS.UCI.EDU (Thomas Huynh) writes:

>much a record manager using B-tree to sort and search records.

Inside Out is a one-table database engine using b-trees,
if memory serves me right.

>I am wondering if there is a comparable package for the
>Mac.  If so, please let me know.  It is best that the package provides
>its own networking mechanism for storing and retrieving records.

No it's not; the Mac file system provides all network services
you need; rolling your own would only limit your compatibility
and user base.

Cheers,

						/ h+

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
   This signature is kept shorter than 4 lines in the interests of UseNet
   S/N ratio.
Newsgroups: comp.sys.mac.programmer
Subject: Mem Mgr Max alloc size (Was: Re: Win 3.1 vs. Mac Toolbox Messaging (Question))
From: hammett@sbsu1.aukuni.ac.nz (Tim Hammett)
Date: Sat, 9 Jan 1993 23:49:37 GMT
Organization: University of Auckland, New Zealand.

d88-jwa@dront.nada.kth.se (Jon Wtte) writes:
>>Oh yeah,  What is the largest array (mem alloc) I can have?  I heard in some
>>Mac vs. PC fight that the Mac had a 64K data block limit, but even system 4
>>used longint's for the alloc size...
>
>Yes, the Mac has always had a limit of available memory for
>memory allocations.

Actually, I think there is an 8 megabyte limit on memory manager
pointer/handle allocations. I haven't tried it (don't have enough
memory on this machine), but there's a line in Memory.h:

    maxSize = 0x800000,     /*Max data block size is 8 megabytes*/

I also remember something in Inside Mac about how enormous this 8M figure
is compared with the amount of memory the Mac can take (this was back in
the days on 128K/512K Macs). How times change. Unfortunately I haven't
been able to find the quote.

    --- Tim.
--
Tim Hammett, Botany Dept, Auckland University, New Zealand.
t.hammett@aukuni.ac.nz   Phone: +64-9-373-7599 x8365    FAX: +64-9-373-7416
Newsgroups: comp.sys.mac.programmer
Distribution: world
From: sharkman@magicbb.uucp (Matt Daw)
Organization: MAGIC - Macintosh Awareness Group In Canada
Date: Tue, 05 Jan 1993 11:38:12 EST
Subject: Re: Mac C Prog. Primer

You need to get a file called "Primer Changes", it will show you how to update
the code to Think C 5.0 or Think Pascal 4.0 compatibility. I can get it for
you if you can't find it, it's on the AMUG bbs in a box CD.
Newsgroups: comp.sys.mac.programmer
From: peter@cujo.curtin.edu.au (Peter N Lewis)
Subject: Re: Think Ref 2.0
Organization: Curtin University of Technology
Date: Mon, 11 Jan 1993 03:39:46 GMT

I wrote:

>ObiWan is free and is on sumex-aim.stanford.edu:/info-mac/cp, stay tuned

For some reason, the Info-Mac people put it in /info-mac/app.  I've told
them, and they say they'll get it moved next week some time.  I'll go
sort out the database and post it off as soon as I've finished reading
news (sometime friday I expect :-)
   Peter.
-- 
_______________________________________________________________________
Peter N Lewis <peter@ncrpda.curtin.edu.au>           Ph: +61 9 368 2055
From: biehl@ecn.purdue.edu (Larry Biehl)
Newsgroups: comp.sys.mac.programmer
Subject: heap corruption problem
Date: 6 Jan 93 15:15:30 GMT
Followup-To: comp.sys.mac.programmer
Organization: Purdue University

I am trying to determine the problem with a program that I have written
which corrupts the heap when the block of memory represented by a handle
is moved.  I have been able to replicate the problem with a small program
given at the end of this message.  

I am using ThinkC 5.0.4 on a MacIIfx using system 7.0.1 with tuner 1.1.1
and 32 bit memory address flag set.  The code is defined as 32bit
compatible 
and compiled using the 020 and 881 compiler flags.  

I have tested this program on an fx with 32 meg of memory and one with 
20 meg of memory.  The following program if given 17.5 meg of memory will
crash during the last MoveHHi instruction.  If the last memory request
of 9917920 is reduced to 9417920, the program will not crash.

Does anyone know what the problem is?
Thanks.

void main ()

{
			/* Declare local variables															*/
	
	Handle					handle1;
	Handle					handle2;
	
	long int					handleSize;
	
	unsigned long int		stackSize = 5000;		/* Add 5K more to the stack.		*/

	
	SetApplLimit ( (Ptr)( (unsigned long int)GetApplLimit() - stackSize ) );
	
	handleSize = 7208960;
	handle1 = NewHandle(handleSize);
	
	handle2 = NewHandle(4112);
	
	if (handle1)
		DisposeHandle (handle1);
		
	handleSize = 9917920;
	handle1 = NewHandle(handleSize);
	
	if (handle1)
		MoveHHi (handle1);
	
	MaxApplZone();
	
	if (handle1)
		MoveHHi (handle1);
	
	ExitToShell ();
		
		
}		/* end "main" */
Newsgroups: comp.sys.mac.programmer
Subject: Q: Accessing Handles in structs
From: starver@oread.cc.ukans.edu
Date: 4 Jan 93 03:46:39 CST
Organization: University of Kansas Academic Computing Serces

This has to be a very simple question but for some reason (guess one)
I can't figure it out.

Using Think's C I define a struct to hold Handles.
 struct {
 	blahHandle	foo;
 	CIconHandle	TitleHandle;
 } someStruct;
 
Now if I have 

 someStruct.TitleHandle = GetCIcon(A_Funky_Icon);
 
how do I use PlotCIcon. It wants a memory address of a Rect and
the Handle of an CIcon. 

Now for the long excuse:
If you can help (please do) don't form your explanation for 
someone with any C knowledge. I am trying to learn this language
on my own (school doesn't support it) and am having trouble 
decyphering IM. Thanks for any help anyone can provide.

Steve,

______________________________________________________________________________
starver@oread.cc.ukans.edu		The virtual me.
starver@volta.ece.ukans.edu		The real me.
Newsgroups: comp.sys.mac.programmer
From: urban@yoda.fsl.noaa.gov (Art Urban)
Subject: Think C Debugger Voracity
Organization: Forecast Systems Lab, NOAA, Boulder CO, USA
Date: Tue, 12 Jan 1993 23:11:56 GMT

In a sentence:

How much bloody memory does the voracious debugger need! :-)

I'm currently up to 2Meg, and the dang thing *still* exceeds it. I did
notice that after each Step command I issue, the Debugger consumes 50k+(!)
of its own heap. Everything its consuming is "unlocked" according to
Swatch, but apparently it can't purge anything. 

So what's a programmer to do?

-- 
Art Urban 					        urban@yoda.fsl.noaa.gov
===============================================================================
 "Look, he's being attacked by creamy nugget centers."		 	 -Joel
===============================================================================
Newsgroups: comp.sys.mac.programmer
From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
Subject: Re: TCL, MultiFinder, and Progress Dialogs
Organization: NASA/ARC Information Sciences Division
Date: Tue, 12 Jan 1993 20:21:47 GMT

In article <96290@rphroy.ph.gmr.com> rrichter@link.ph.gmr.com (Roy Richter PH/32) writes:
>I want to have a progress dialog up for an operation that takes
>over a minute, so I've got the usual text string, and a horizontal
>bar that fills up as the operation proceeds.  It would be nice to
>also:
>
>(1) let the Multifinder take time slices to update other programs,
>	I assume that WaitNextEvent will do it;
>(2) Have a "Cancel" button the user can push to cancel the 
>	operation.  This has me stuck.
>
>I use the Class Library to manage the dialogs.  That way, I just
>GetGoodClicks and so on.  In this case, I'm not passing control up the
>line to let the DeskTop get the click and dispatch it.  I wouldn't want
>to break up my operation into a bunch of Tasks, that would be
>hard--since I'm updating the progress dialog in a callback.  I'd prefer
>the MultiFinder timeout and clicks be self-contained in the callback.
>That was I can use the callback in many places, as needed.  Otherwise
>I'd need to restucture the code into a Task everytime I thought a
>time-slice was needed.
>
>Any hints?
>
>--
>Roy Richter                  Internet: rrichter@ph.gmr.com
>Physics Dept, GM Research    UUCP:     rphroy!rrichter


One really sloppy method that I cannot see anyone recommending 
(discussion ?) is to call WaitNextEvent from within a loop,
masking out all events so they remain in the queue until
the appropriate time.  
But I don't think this is good.

An easier (but not great) way to handle cancels
is to use GetKeys and check for command-period.

I have code to do this if anyone wants.  The problem is that it will not 
work properly with some alternate keyboard systems (?) and 
inits (?)  (I think.  Check the Develop article where someone
	      talks about repetitive strain injury and has to 
	      'type' with her feet.)





-- 
----------------------------------
#include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
joshr@kronos.arc.nasa.gov
"Me lost my cookie at the disco." -- Cookie Monster
Newsgroups: comp.sys.mac.programmer
From: eldred@rrunner.jpl.nasa.gov (Dan Eldred)
Subject: Code to generate directory wanted
Organization: Jet Propulsion Laboratory
Distribution: usa
Date: Mon, 11 Jan 1993 19:16:58 GMT

Does anyone have a code fragment which will store the current
directory in a data structure for further manipulation?  I can't 
seem to figure out how to do this for a port of a Unix program.  
Please email me any replies.  Think C or Think Pascal are preferred 
if it makes any difference.  Thanks.

	- Dan		eldred@rrunner.jpl.nasa.gov
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools,comp.os.ms-windows.programmer.misc