HDTenEightyP/NetNews huggingface dataset:
From: the.cloud@applelink.apple.com (Ken McLeod)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Patching traps at INIT time under sys. 7
Date: 15 Apr 92 02:04:02 GMT
Organization: Apple Computer, Inc.

In article <22832@goofy.Apple.COM>, nerm@apple.com (Dean Yu) writes:
> 
> In article <1992Apr4.223527.3101@aplcen.apl.jhu.edu>, haceaton@aplcomm.jhuapl.edu (haceaton@aplcomm.jhuapl.edu) writes:
> > 
> > I am trying to patch the trap _initwindows in an INIT.  It seems to work
> > fine under system 6.0.x, but I have determined that when the finder loads
> > under system 7 it seems to do a wholesale replacement of many trap addresses
> > without linking to the existing patch code (i.e. those put in before the
> > finder loaded)!
>
>   You're not doing anything wrong.  The Process Manager completely replaces
> _InitWindows with its own version when it starts up.  And you're right.  It
> doesn't call through to the old one.

A solution might be to patch SetTrapAddress, watch for attempts to change
the address of the _InitWindows trap, then stuff that new address somewhere
and JMP to it yourself at the end of your _InitWindows [head] patch.

-ken

--
Ken McLeod
Apple Computer, Inc.
AppleLink: THE.CLOUD  Internet: the.cloud@applelink.apple.com
Newsgroups: comp.sys.mac.programmer
From: ian@syacus.acus.oz.au (Ian Joyner)
Subject: C++ Critique in comp.lang.c++
Organization: ACUS Australian Centre for Unisys Software, Sydney
Date: Wed, 8 Apr 1992 12:17:26 GMT

Have Apple made a mistake by adopting the C++ route. I have posted a critique
in comp.lang.c++ which may help answer such questions.
-- 
Ian Joyner                                     ACSNet: ian@syacus.acus.oz
ACUS (Australian Centre for Unisys Software)   Internet: ian@syacus.acus.oz.au
Tel 61-2-390 1328      Fax 61-2-390 1391       UUCP: ...uunet!munnari!syacus.oz
From: russotto@eng.umd.edu (Matthew T. Russotto)
Newsgroups: comp.sys.mac.programmer
Subject: Re: COMBINATORIX...math-type programming question?
Date: 17 Apr 92 21:25:38 GMT
Organization: College of Engineering, University of Maryland, College Park

In article <MHALL.92Apr17143346@occs.cs.oberlin.edu> mhall@occs.cs.oberlin.edu (Matthew Hall) writes:
>In article <1992Apr16.202704.8111@crash.cts.com> alen@crash.cts.com (Alen Shapiro) writes:
>
>>   ok you budding math-type mac programmers...here's a question...
>>
>>   I need to figure out how many ways n objects may be picked from a set
>>   of m objects. Order is not relevant (ab = ba). 
>>
>>   Is the answer (m-n)! (!=factorial)?...this works for the boundary condition
>>   where m=n only if 0! = 1 and my math is too shaky for this.
>>
>
>well, lets see.  
>First pick - m possible choices
>Second pick - m-1 possible choices
>nth pick m-n+1 choices
>
>algorithm = m*(m-1)*(m-2)*...*(m-n+1)
>
>	  = m!
>	  -----
>	  (m-n)!  = works for boundary condition.  In fact, it just works.

Nope, doesn't work.  Remember, order doesn't matter.  It is

   m!
--------
n!(m-n)!


-- 
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
Some news readers expect "Disclaimer:" here.
Just say NO to police searches and seizures.  Make them use force.
(not responsible for bodily harm resulting from following above advice)
Newsgroups: comp.sys.mac.programmer
From: e-sink@uiuc.edu (Eric W. Sink)
Subject: Re: comp.sys.mac.programmer.OOP
Originator: sink@sunb2.cs.uiuc.edu
Reply-To: e-sink@uiuc.edu
Organization: University of Illinois at Urbana-Champaign
Date: Wed, 15 Apr 1992 14:40:36 GMT

In <1992Apr15.135940.22939@csrd.uiuc.edu> andrews@sp1.csrd.uiuc.edu (John Andrews) writes:

>I am also against the proposed subdivision of c.s.m.p .  There are enough
>mac newsgroups already.

Me too.  Besides, I thought c.s.m.p already WAS
comp.sys.mac.programmer.oop ! :-)

I'd certainly like to see more TCL/MacApp traffic.  More TCL is great
because I use it.  More MacApp would be great because I know so little about
it.  About all I ever see on MacApp is the periodic mention of the fact
that it requires a Quadra 900 with 64 meg RAM and 1 gig disk just to
compile hello world (paraphrased from Mark Lanett).

I'll say this : if it comes to a vote, I'll vote no.  If it passes
anyway, I'll read all the new groups.

-- 
Eric W. Sink, USACERL         | The essence of GUI programming : "What
Box 9005, Champaign, IL       | started out as a half hour hack has been
61826-9005 1-800-USA-CERLx449 | bothering me for two weeks now." -- Matt Mora
---- e-sink@uiuc.edu ---------|
Newsgroups: comp.sys.mac.programmer
From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
Subject: Re: Too many files open?
Organization: Symantec Corp.
Date: Wed, 15 Apr 1992 22:10:23 GMT

In article <1992Apr15.041612.7835@clark.edu> day@william.vancouver.wsu.edu (Steve Day) writes:

   On startup the system allocates a (limited, fixed) number of FCBs
   (File Control Blocks).  The number to be allocated is stored in the
   boot blocks of the startup drive and once they are set up the
   system can't create more as they are needed :-( These blocks are
   also shared among all programs including the system and finder and
   an application also counts as a file.  I'm not sure if opening a
   resource fork and a data fork on the same file is considered one or
   two files (Anyone have an answer to that?).

It's two files. You can check this by using the "file" dcmd in
MacsBug.

I had heard that in System 7, the FCB queue is dynamically resizable,
and is no longer limited to the length in the boot blocks. I didn't
see any docs about this in IM VI, however...

	-phil
--
   Phil Shapiro                                   Software Engineer
   Language Products Group                     Symantec Corporation
		   Internet: phils@cs.brandeis.edu
From: vladimir@Eng.Sun.COM (Vladimir Ivanovic)
Newsgroups: comp.sys.mac.programmer
Subject: System 7 skeleton application(s)?
Date: 13 Apr 92 04:48:15 GMT
Organization: Sun Microsystems, Inc.
NNTP-Posting-Host: cocteau

I'm interested in THINK C skeleton applicatons for System 7 like TranSkel
of days or yore.  Pointers would be appreciated.  (THINK's class library is
... um, too massive.)  The more System 7-aware, the better --- of course. ;-)

-- Vladimir
--
Vladimir G. Ivanovic                            Sun Microsystems, Inc
(415) 336-2315                                  MTV12-33
vladimir@Eng.Sun.COM                            2550 Garcia Ave.
{decwrl,hplabs,ucbvax}!sun!Eng!vladimir         Mountain View, CA 94043-1100
                         Disclaimer: I speak for myself.
Newsgroups: comp.sys.mac.programmer
From: kevin@crash.cts.com (Kevin Hill)
Subject: Pointers to struct and Objects
Reply-To: kevin@crash.cts.com (Kevin Hill)
Organization: Crash TimeSharing, El Cajon, CA
Date: Wed, 08 Apr 1992 06:09:46 GMT

  I am currently programming a CDocument Object...  However, I have about 15-20 panes in the document, that get created in BuildWindow.  My problem is this,

   I have created a structure that looks something like this.

   struct a{
	CPaneBorder	*border;
	CStaticText	*title;
	union {
		CStaticText	edit;
		CEditText	edit1; 
		CDateText	date;
		CPhoneText	phone;
		}b;
	int	type;
	};

In the instance variables for the Document object, I declare struct a  *tracker;  The big problem comes when try to allocate memory for it.

  for(i = -; i < 9; i++)
		
	
       track[i] = (struct a)NewPtr(sizeof(struct a));

  the compiler does not seem to like that...
   oh yes, the (struct a) should be (struct a*), sorry.

  anyone have any ideas?
 -Kevin
  
   Also, is there a  limit to the number of objects CDocument can have?
 -Kevin Hill
From: jahnke@biosci.arizona.edu (Jerome Jahnke)
Newsgroups: comp.sys.mac.programmer
Subject: PLookupName weirdness
Date: 7 Apr 92 03:53:20 GMT
Organization: Biology Learning Center

I have been working on some AppleTalk stuff, and things are going along
smoothly until I was goofing with NBP and PLookupName. I get it all set
up and let PLookupName go to work. The Function PLookupName returns an
OSErr of 1. I could understand any error code less than 0. And would
hope for an error code of 0. But 1 is totally beyond what I expected.

I then decided to throw caution to the wind and NBPExtract what I was
getting back anyway. It all worked. It finds EVERYTHING it is supposed
to. So I am getting an unknown error code, but it looks like everything
is working just fine. Soooooo the question becomes. 1) Do I just fly fast
and loose and ignore any error 0 and above in PLookupName. OR 2) Do I have
a real problem, and should I keep digging. I have only run this on one 
machine. It runs other stuff just fine (including the testNBP code from
one of the snippets packages).

Other particulars. I am writing this in C++ (but not MacApp). Using MPW's
C v3.2.1 and CFront v3.2d17. Hardware is a Mac IIfx using system 7 on 
ethertalk.

Any help would be appreciated.

Jer,
----
Jerome Jahnke
Biology Learning Center
University of Arizona
'jahnke@biosci.arizona.edu' or +1 (602) 621-3820
From: meharp01@vlsi.louisville.edu (Michael Harpe)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Problem with THINK C 5.0.2 (long)
Date: 7 Apr 92 13:36:28 GMT
Distribution: usa
Organization: University of Louisville

Thanks to all who responded to this.  I just misunderstood the %X designator.
I had correctly deduced what was happening, I just didn't understand why it
was happening.  This cleared it up.  I cleaned up the code last night.

Source level debuggers are WONDERFUL learning tools.  It really helps to be
able to watch what happens and single-step through the program.

Actually, programming the Mac isn't as bad as I thought it would be.  The
books "Macintosh Programming Primer" are invaluable.  I would really be stuck
without them.  The net helps alot too :-).  I've been lurking on this group 
for some time and picked up a lot of tips here as well.

Thanks again.

Mike
From: glin@lehi3b15.csee.Lehigh.EDU (George Lin [900116])
Newsgroups: comp.sys.mac.programmer
Subject: System Idling Interference
Date: 6 Apr 92 18:24:54 GMT
Reply-To: glin@lehi3b15.csee.Lehigh.EDU (George Lin [900116])
Organization: CSEE Dept. Lehigh University, Bethlehem, PA

Hello,

I've included an "on idle" handle in my SuperCard script and it seems to be
interfering with the mouse button messages.  If it's in the "on idle" loop 
and you click a mouse button, the system won't get the mouseClick message 
until the mouse is moved.  Did anybody run into the same problem or have
suggestions for a solution to this problem?

Thanx.

GL
From: cmp9116@sys.uea.ac.uk (A. Coats)
Newsgroups: comp.sys.mac.programmer
Subject: QD picture to clipboard pr disk
Date: 14 Apr 92 12:24:12 GMT


Dear all,

does anyone have any code to put a quickdraw picture structure to the 
clip board or ideally to disk to be read by MacDraw, preferably in
Modula-2, or Pascal.

Andy.
From: Roy_Lovejoy@adeptsln.cts.com
Newsgroups: comp.sys.mac.programmer
Subject: Re: MacTudor
Date: 7 Apr 92 04:51:29 GMT
Article-I.D.: adeptsln.1992Apr7.045129.2222
Reply-To: Roy_Lovejoy@adeptsln.cts.com
Organization: Adept Solutions

WOW!
All this energy over one typo.
;) 
-- 
-----------------+--------------------------------------------------
Roy Lovejoy      | internet:  roy@adeptsln.cts.com
Head RGB Guy     | AppleLink: adept
Adept Solutions  | CIS:       72447,1447
Newsgroups: comp.sys.mac.programmer
From: bill@extro.ucc.su.OZ.AU (William Logan Lee)
Subject: Re: Reading binary input
Organization: Uni Computing Service, Uni of Sydney, Australia
Date: Sat, 11 Apr 1992 08:39:40 GMT

In article <1992Apr9.232541.6361@massey.ac.nz> P.Etheridge@massey.ac.nz writes:
>This is a posting on behalf of a student without News access.  He wants source
>code (any language) which takes a stream of binary input from a synchronous A/D
>converter plugged into a serial port of a IIci, and read it into a file. 
>Someone has already suggested using the Sound Manager library, any comments on
>this, or other suggestions?

Perhaps I am misunderstanding the problem, but why doesn't he use a terminal
emulator like "kermit" or "zterm" to capture the input, if it does not need
to be processed in real time?

If the information needs to be processed real-time, then what about using the
Communications Toolbox routines?  

Although not recommended (but sometimes you have no choice), you can input
a clock signal for some non-standard baud rate input to the port.  You then
have to muck about directly with the serial chip.

Could you post a bit more info on what sort of input to the serial port
you are trying to read and also whether there is real time processing
needed?

>Phil Etheridge

Bill Lee
From: minow@ranger.enet.dec.com (Martin Minow)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think C, TCL, AppleTalk Async calls and a question
Date: 11 Apr 92 20:33:37 GMT
Organization: Digital Equipment Corporation


In article <jsuker.23@orion.oac.uci.edu>, jsuker@orion.oac.uci.edu
(Johnathon L. Suker) asks about asychronous I/O and the Think library.

The simplest solution is to create a CChore to watch for I/O completion.
If your I/O needs are more elaborate, you might want to create your
own action queue using roughly the following algorithm:

Your I/O routine (PBControl or similar) establishes an I/O completion
handler.  This is a short assembly-language stub that queues the I/O
block into a private queue.  Your CChore then looks for a non-empty
queue and, if it finds something, dequeues the first element and
processes it.

To save you much head-scratching, create your I/O request as follows:
	struct MyIORecord {
	    long	applicationA5;
	    ParamBlock	pbRec;
	    ... other data for the I/O request ...
	};

Create the I/O request by

	anIORequest.applicationA5 = (long) CurrentA5;
	... other parameters ...
	anIORequest.pbRec.ioCompletion = (ProcPtr) MyCompletionRoutine;
	status = PBControlAsync(&anIORequest.pbRec);

The completion routine is as follows:

QHdr		gProcessQueue;

pascal void
MyCompletionRoutine()
{
	asm {
	    move.l	a5,-(sp)		; Save current A5
	    move.l	-4(a0),a5		; Restore application A5
	    lea		gProcessQueue,a1	; My queue header
	    _Enqueue				; Put buffer in my queue
	    movea.l	(sp)+,a5		; Restore A5
	}
}

Your CChore or idle loop should call a "dequeue" function defined as follows:

/*
 * Get an element from the queue, return NULL if none.
 */
struct MyIORecord *
GetFromQueue(void)
{
	QHdrPtr		theQueue;
	QElemPtr	qElemPtr;

	theQueue = &gProcessQueue;		/* Parameter, perhaps	*/
	if ((qElemPtr = theQueue->qHead) == NULL)
	    return (NULL);
	else {
	    Dequeue(qElemPtr, theQueue);
	    return ((struct MyIORecord *) (((long) qElemPtr) - sizeof (long)));
	}
}

This was retyped from working code: apologies for any errors that crept in.
Note that your CChore should set a short maxSleep time if the queue is
non-empty. (The method that calls PBControlAsynch must also set a
small value in gSleepTime.)

Martin Minow
minow@ranger.enet.dec.com
Newsgroups: comp.sys.mac.programmer
From: nebel@wam.umd.edu (Chris D. Nebel)
Subject: Network copy protection problems
Originator: nebel@next02pg2.wam.umd.edu
Organization: University of Maryland, College Park
Date: Sat, 11 Apr 1992 23:20:23 GMT

I'm trying to write one of those things that checks to make sure that you're
only running one copy of the same program at once on an Appletalk network.
(Please, no flames from folks that think this practice is evil.  This is my
job we're talking about, here.)  Anyway, I've got a little thing written that
registers the "name" (all right, the serial number) of the program using
NBPRegister; if NBPRegister comes back with a duplicate name error, then it
decides that another copy is being run somewhere and exits.  (The program
unregisters the name when you quit.)

This works pretty well, but there are two major problems.  One, it only checks
the current zone.  I'd like it to check ALL the zones, but I can't seem to find
anything at all on zones in IM except for an occasional mention of '*' -- where
does Apple hide this information, anyway?

Problem number two is more serious: if the program terminates abnormally (read:
crashes! (or the user kills it, or whatever)), then the name never gets
unregistered.  So when they try to launch again, it says "This copy is already
being used!"  Oh, joy.  I tried turning off self-send during the inital name-
check, and that seems to work, but when it tries to unregister the name,
something fairly horrible must happen, because the Finder almost always
crashes a few seconds after I quit.

Any tips/pointers/useful comments would be greatly appreciated.

Thanks,
Chris Nebel
nebel@wam.umd.edu
From: cpastore@unity.ncsu.edu (Chris Pastore)
Newsgroups: comp.sys.mac.programmer
Subject: Re: THINK C PROGRAM QUESTION
Date: 10 Apr 92 17:08:11 GMT
Article-I.D.: ncsu.1992Apr10.170811.22969
Organization: North Carolina State University Computing Center

>> In <17361.29db0e17@ecs.umass.edu> kcheng@ecs.umass.edu writes:

>>>I run my C program on the Mac II using THINK C 5.01 and it keeps crashing and
>>>said "bad F-line instruction"   What does this mean?

>> that means you have a... Bug!

Also, Think C has conflicts with lots of INITs.  It might be something
that simple.  Get rid of them all and try again.


-- 
Christopher M. Pastore 	    |Life would be so pleasant
NC State University         |If we all could be
Textile Materials Science   |Helpless, homeless creatures
cpastore@nelson.tx.ncsu.edu |Marching to the sea.
From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: "Use Custom Icon" Finder flag - info?
Date: 13 Apr 92 08:03:30 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden
Originator: d88-jwa@hemul.nada.kth.se

> bdugan@hal.gnu.ai.mit.edu (Bill Dugan) writes:

   Photoshop 2.0...and the icon created was a miniature version of the GIF
   itself!! Wow!!! That's the greatest thing I've ever seen, I said...
   Poking around, I found a flag from Resedit called "Use Custom Icon".

   Is this documented anywhere?  I want my own apps to use this wonderful
   system idea....

Yes, it's documented in Inside Mac VI. However, it's only
available under the system 7 Finder.

-- 
"You should meet yourself someday. I'm sure you would hate it."
- Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer
Subject: Re: debugging tools for lisp
Date: 14 Apr 92 19:36:02 GMT
Organization: MacDTS Mongols

In article <1992Apr11.174926.1639@leland.Stanford.EDU>, ckyu@leland.Stanford.EDU
(Chen-Kuang Yu) writes:
> 
> I've been using lisp on the NeXT machines and recently have to do some
> programming on the mcl.  However I find the STEP and TRACE debugging
> macro rather crude on the mcl.  I wonder if it's mentioned in the
> manual that there are some other more powerful debugging tools
> available.  (I'm using the program running on the server of our schoo.
> The consultant said the manual was lost, so there's no way for me to
> check it out.)

As I know STEP and TRACE are the default Common Lisp utilities under
MCL. There's an inspector which you could use for inspecting data 
structures. 
  
> BTW, are there any ftp sites where they keep a bunch of useful lisp
> codes such as a modified TRACE or STEP?

cambridge.apple.com has MCL code, you might check their archives.

Cheers,
Kent Sandvik
From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Desperately need info from Develop Magazine #9
Date: 14 Apr 92 00:41:06 GMT
Organization: MacDTS, Apple Computer

In article <1992Apr10.133201.7885@usenet.ins.cwru.edu>, csk@po.CWRU.Edu (Carl S. Kashuk) writes:
> Help! I posted awhile back about turning sound play-through on
> a Classic II on and off. I was told that the info I needed 
> was in Develop magazine. I contacted them, and was told I could 
> have a trial copy of that issue; of course I never got it...
> and it's getting to be too late to wait for them.

You can get the contents of any develop magazine, including all the
source code and articles, off of ftp.apple.com in the directory
/dts/mac/docs/develop.

Enjoy.

Tim Dierks
MacDTS, but I speak for myself
Newsgroups: comp.sys.mac.programmer
From: man@cs.brown.edu (Mark H. Nodine)
Subject: Problems converting to Think C 5.0.2
Organization: Brown University Department of Computer Science
Date: Wed, 8 Apr 1992 03:25:13 GMT

I have a project that used to compile just fine under Think C 3, but I
can't get it to compile in v. 5.0.2.  I'm getting "Invalid Redeclaration
of BibCheckFound".  Here's my prototype:

  static int BibCheckFound(Tree, TreeElement, ...);

and here's the actual declaration:

  static int BibCheckFound (tree, element, args)
  Tree tree;
  TreeElement element;
  struct {
  	BibOptions **bibOpts;
  } *args;

I've tried many different combinations of options, but here's the combo
I think is best:

  X  Check pointer types
  X  Language extensions
     X  Think C
  X  Strict Prototype Enforcement
     X  Infer prototypes

The problem seems to be with the "..." not matching the "args" argument,
since if I comment out the third arguments, everything works fine (except,
of course, that the argument is not declared when it's used in the
function).  Any idea what's wrong?

	Thanks.

	--Mark
Newsgroups: comp.sys.mac.programmer
From: cegrw@cc.newcastle.edu.au (Dr Garry Willgoose: INTERNET cegrw@cc.newcastle.edu.au)
Subject: MPW 3.2 memory limitations
Organization: University of Newcastle, AUSTRALIA
Date: Tue, 14 Apr 1992 04:32:18 GMT

I have a problem with MPW v3.2. I used to be able (under MPW3.0) to able to
compile a FORTRAN (Language Systems) code with the minimum memorypartition of
1Mbyte but since moving to 3.2 I can't compile with the mim. partition of 
2Mbyte without getting the error

### Link: Error: Out of memory: unable to allocate resource buffer. (Error 27) 

If I increase the parttion to 3Meg there is no problem but this is the only
code that causes this problem and I can't run other stuff with MPW on my
machine when the partition is this size so I'd like to know what I can do.
(Don't tell me to buy more memory because I'm already maxed out).

The code is a stock standard fortran code doing nothing MAC specific, though
there are some arrays that are rather large (if thats important).

Dr Garry Willgoose
Dept of Civil Engineering
Uni of Newcastle
NSW 2308
cegrw@cc.newcastle.edu.au
Xref: sparky comp.sys.mac.programmer:8162 comp.protocols.appletalk:1828
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer,comp.protocols.appletalk
Subject: Re: MacTCP - UDPRead aligned?
Date: 11 Apr 92 16:54:54 GMT
Organization: MacDTS Mongols

In article <2452@wcc.oz.au>, tom@wcc.oz.au (Tom Evans) writes:
> 
> In article <1992Apr6.145921.26924@ux1.cso.uiuc.edu>,
dorner@pequod.cso.uiuc.edu (Steve Dorner) writes:
> > Why not just use BlockMove?
> 
> Even something as trivially simple as:
> 
> 	char *p, *q;
> 	while (n--) 
> 		*(q++) = *(p++);
> 
> is faster than BlockMove for n < 50 - even as a subroutine!
> Therefore checking for word-alignment and doing long-copies in a
> subroutine is going to be faster for n < 200 or so. Using proper
> unrolled assembly code is always going to be faster (because that's
> what BlockMove() is probably doing).

BlockMove is a trap (0xA02E) while the construct above executes directly
in memory. Any code causing a dispatch will always execute slower
than pure RAM resident constructs.

Cheers,
Kent Sandvik/DTS