HDTenEightyP/NetNews huggingface dataset:
From: james@ee.uts.edu.au (A. James Boswell)
Subject: Think C & 68k cross compiling
Organization: University of Technology, Sydney, Australia
Date: Mon, 13 Apr 1992 23:41:10 GMT
Summary: Help ... code for non mac 68k
Keywords: cross compile, think C, 68k


Sorry, this is a repost, cause the title wasn't accurate....

Hello,
Can anyone help me with info about compiling for non Mac 68K based
systems using ThinkC 5.0 or a C++ compiler? I own ThinkC 5.0 and I have
to write some code for a 68332 based robot.  (68332 is a superset of
68K with some 020 instructions).

My (many) questions are these :

Is there a utility for stripping CODE resources of JUMP tables, and
locating code at a specific address (say for moving code to a ROM)?

Is there a way to ensure that no system (OS, ROM or otherwise) code is
called when Think C compiles it?

What exactly does A5 point to when a application is first launched ?

Could someone explain (in more detail than the manual) the format of
CCOD resources and how I could use them to produce code for a non Mac
target.

And finally, is there a C++ (or some object extended C compiler) I can
use with an option for non Mac targets to save mucking around. (And has
anyone ported gnu g++ to a MAC (not AUX) ? I know GNU aren't real fond
of Apple but if its been done that would be fab.)

I am planning to use the Mac to download the code to the target, so I
may write an app which loads its own resources, strips its jump table
and spits itself out the serial port. If this is useful to others, I'll
make it PD.

All that said (asked) I am doing all this for my undergrad thesis and
there are only 8 weeks left so I really need urgent info. Please help.


Many thanks,


A. James Boswell.

A. James Boswell                              _--_|\        PO BOX 123
Senior Technical Officer                     /      \       BROADWAY NSW
Computer Systems Group                       \_.--._*       AUSTRALIA 2007
School of Electrical Engineering                   v        FAX: 61 2 330-2435
UNIVERSITY OF TECHNOLOGY, SYDNEY                            PH:  61 2 330-2382

From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
Sender: Uucp@blkcat.UUCP
Newsgroups: comp.sys.mac.programmer
Subject: How to tell if a window has a title bar?
Date: Fri, 10 Apr 1992 23:10:03 -0500

 TN> From: f85-tno@nada.kth.se (Tommy Nordgren)

 TN> In article <1992Mar26.212538.4018@dartvax.dartmouth.edu>,
 TN> Joe.Francis@dartmouth.edu (Joe Francis) writes:
 TN> |> In article <1992Mar26.185108.14007@nic.funet.fi>
 TN> |> asunta@convex.csc.FI (Miika Asunta) writes:

 TN> |> I even tried sending the WDEF a calc regions message to try to fool it
 TN> |> into validating structRgn, but (under system 7, at least) this will
 TN> |> result in confusing the window manager beyond help.

If you want the strucRgn of an invisible window,
go ahead and send the message to the WDEF and then make sure you
SetEmptyRgn against the strucRgn and contRgn. That's the step you're
missing. I believe there is code on the developer's CDs to do this.
Anyway, I've seen it published before. I've certainly done it before.

 TN> Beside checking the variant code, also get Resource info for the window
 TN> definition procedure. If the ID is 1 then it is a standard window.

The resource ID you want is 0, not 1. 1 is the round-corner black-title
WDEF used in many DAs.
From: gwatts@cdf34.fnal.gov (Gordon Watts -- U of Rochester)
Newsgroups: comp.sys.mac.programmer
Subject: Talking to Sophisticated Circuits Power Key cp
Date: 15 Apr 92 20:24:00 GMT
Reply-To: gwatts@cdf34.fnal.gov
Organization: Fermilab
News-Software: VAX/VMS VNEWS 1.4-a4

Hi all,
  I just got an upgrade notice for my powerkey (allows you to turn on brain
dead mac (like the SE/30) with the programmer's key on the kbd).  One of the
nice features about the power key is that it will allow you to automatically
start up your mac at any time.
  Now, what I want to do is control this turn on time from another program.
So, if I have a hypercard script and I decide, in the script, that my mac
needs to be turned on at 3:21 am, how can I tell power key to do it?  Is there
a way? (or do I have to reverse eng. the file :().
  The flyer they sent me claims "apple events" but doesn't say anything.  The
salesman I talked to didn't really know.  I think power key is a control
panel, so I'm not sure how it would get apple events.

	Thanks,
		Gordon.
Newsgroups: comp.sys.mac.programmer
From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
Subject: Re: Register variables in Think C 4.05
Organization: Symantec Corp.
Date: Wed, 15 Apr 1992 14:40:00 GMT

>>>>> On 14 Apr 92 14:45:12 GMT, erh0362@tesla.njit.edu said:
 > 	How intelligent is Think C 4.05 about assigning variables to
 > registers? Will declaring my frequently used variables as register
 > offer significant improvements or should I rely on Think C to do
 > this for me?

C 4.0.x does *not* do any register allocation. If you want your
locals to be placed in registers, you must declare them with the
register keyword. C 5.0 does support register allocation, however.

If you use the register keyword carefully (and probably even not
carefully) in C 4.0, you can get a fair amount of improvement in code
size and most likely code speed.

	-phil
--
   Phil Shapiro                                   Software Engineer
   Language Products Group                     Symantec Corporation
		   Internet: phils@cs.brandeis.edu
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.misc
From: engber@ils.nwu.edu (Mike Engber)
Subject: Source Code for ResEdit Picker - I found some!
Summary: check out Feb 1990 MacTudor :-)
Organization: The Institute for the Learning Sciences
Date: Wed, 8 Apr 1992 16:38:21 GMT

I vaguely recall someone recently postng about wanting sample code on how
to do a ResEdit picker? I just remembered seeing some in MacTutor. In the
Feb 1990 issue is code for a FatBits style editor for a bitmap resource
type ('BTMP').

The author is Mike Scanlin. I don't know what version of ResEdit it
was written for or if it still works with the current ResEdit. But it's
got to be better than starting from scratch.

So if the person who posted the query gets in touch with me, I can send
you a copy if you don't have access. Also, that happens to be the one
issue of MacTutor I have the source code disk for - so I can email that
if you don't want type it all in (I'm not breaking any rules by doing
that - am I?)

-ME
Newsgroups: comp.sys.mac.programmer,dartmouth.comp.mac.programmers
From: overdriv@tsoft.sf-bay.org (Paul A. Pelton)
Subject: Re: code overflow
Organization: The TeleSoft BBS and Public Access Unix, +1 415 969 7958
Date: Sat, 4 Apr 1992 02:14:45 GMT

In article <1992Mar30.152708.17482@dartvax.dartmouth.edu> pete@othello.dartmouth.edu (Pete Schmitt) writes:
>This bug comes up right after compilation of a 890 line file using %U to
>update the project.  I can't find any reference to this the the Think C 5.0
>docs.  What does it mean?

This is a long-shot. Are you using THINK C's object extensions?

I got this error when I compiled a bunch of .c files which contained no 
function definitions but simply included a .h file. Basically, all I was 
compiling was a bunch of class declarations and method prototypes but no 
actual code.

You might look for something like that. If you find out exactly what "code
overflow" means, I'd like to know too.

Good luck,
Paul
Newsgroups: comp.sys.mac.programmer
From: mhall@occs.cs.oberlin.edu (Matthew Hall)
Subject: Re: Error Number to String Conversion
Organization: Oberlin College Computer Science
Date: Wed, 15 Apr 1992 19:43:10 GMT


In article <1992Apr14.205433.1@tesla.njit.edu> erh0362@tesla.njit.edu writes:


>	   Is there a toolbox call that will convert an error number into an 
>   appropriate string? If so what? If not why not? Am I doomed to type in 
>   all the strings for every error I intend to check for?
>

I say, someone with an inordinate amount of time on there hands,
should enter in the error codes into a STR# resource, where the index
= -error number, and then post it at sumex or something.  What might
be really nice is if you created different resources for different
managers (mem manager resource, SI manager resource) so that you don't
need to load a massive resource if all you're going to be checking is
mem errors and reserrors.  

Just an idea.

-matt hall

--


-------------------------------------------------------------------------------
Matt Hall.    mhall@occs.cs.edu  OR  SMH9666@OBERLIN.BITNET
              (216)-775-5805 (That's a Cleveland Area code. Lucky Me)

"If a man comes up to you and says:
	'A dog just carried away your ear.'
Do you run after the dog, or search first for your ear?" - Moon over Morocco
  
Newsgroups: comp.sys.mac.programmer
From: mkelly@mystix.cs.uoregon.edu (Michael A. Kelly)
Subject: C.S.M.P. Digest v1 #47 Available
Organization: University of Oregon Computer and Information Sciences Dept.
Date: Fri, 10 Apr 1992 10:41:42 GMT


C.S.M.P. Digest             Fri, 10 Apr 92       Volume 1 : Issue 47

Today's Topics:

	680x0 Caches
	sprintf weirdness
	Questions on THINK C Objects and Interrupts
	code overflow in Think C
	"Procedural" (was Re: Suggestion to the Developers of Think C)
	Opening documents while the creator prog is running?
	Help! Declaring big array
	Looking for B-Tree/Data base source
	Letting Sleeping Powerbooks Lie
	MPW C++ & Zortech C++ Info Wanted
	CTB/System 7 popup menu bug


The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.

These digests are available (by using FTP, account anonymous, your email
address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
Questions list.

These digests are also available via email.  Just send a note saying that you
want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
automatically receive each new digest as it is created.

The articles in these digests are taken directly from comp.sys.mac.programmer.
They are not edited; all articles included in this digest are in their original
posted form.  The only articles that are -not- included in these digests are
those which didn't receive any replies (except those that give information
rather than ask a question).  All replies to each article are concatenated
onto the original article in the order in which they were received.  Article
threads are not added to the digests until the last article added to the
thread is at least one month old (this is to ensure that the thread is dead
before adding it to the digests).

Send administrative mail to mkelly@cs.uoregon.edu.

-- 
_____________________________________________________________________________
Michael A. Kelly                                         University of Oregon
mkelly@cs.uoregon.edu                             Computer Science Department
_____________________________________________________________________________
Xref: sparky comp.sys.mac.programmer:7970 comp.protocols.appletalk:1788
From: tom@wcc.oz.au (Tom Evans)
Newsgroups: comp.sys.mac.programmer,comp.protocols.appletalk
Subject: Re: MacTCP - UDPRead aligned?
Date: 10 Apr 92 01:37:12 GMT
Followup-To: comp.sys.mac.programmer
Organization: Webster Computer Corp, Melbourne, Australia

In article <1992Apr6.145921.26924@ux1.cso.uiuc.edu>, dorner@pequod.cso.uiuc.edu (Steve Dorner) writes:
> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
> >Am I guaranteed that the data pointed to by the rcvBuff that I get
> >from a UDPRead call is aligned so that I can do a MOVE.L from it?

Has the block come through a dumb Ethernet card, an A-ROSE Ethernet card,
Token Ring or LocalTalk? Even EtherTalk Phase 1 and EtherTalk Phase 2
are misaligned by one byte (you can have IP-in-MacIP-in-EtherTalk).
You can't tell - don't take the risk.

> 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).

Your mileage may vary.

========================
Tom Evans  tom@wcc.oz.au
Webster Computer Corp P/L, 1270 Ferntree Gully Rd Scoresby, Melbourne 3179
Victoria, Australia 61-3-764-1100  FAX ...764-1179  A.C.N. 004 818 455
From: sundinKC@dna.lth.se (Anders Sundin)
Newsgroups: comp.sys.mac.programmer
Subject: Re: MPW 3.2 memory limitations
Date: 15 Apr 92 19:09:05 GMT
Article-I.D.: lth.1992Apr15.190905.11845
Organization: Organic Chemistry 2, Lund University, Sweden

Garry Willgoose writes:
> I have a problem with MPW v3.2.
> ### Link: Error: Out of memory: unable to allocate resource buffer. (Error 27)

It looks like the MPW linker requires approximately the minimum MPW Shell
partition size + the size of COMMON blocks to link FORTRAN programs. When
I linked MOPAC I had to increase the MPW Shell partition to more than 19 MByte.
MOPAC required 17 MByte to run because of the large COMMON blocks.
-- 
 Anders Sundin           e-mail: sundinKC@dna.lth.se
 Organic Chemistry 2             Anders.Sundin@orgk2.lth.se
 University of Lund              ok2aps@seldc52.bitnet
 P.O. Box 124            phone:  +46 46 108214
 S-22100 Lund, Sweden    fax:    +46 46 108209
From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
Sender: Uucp@blkcat.UUCP
Newsgroups: comp.sys.mac.programmer
Subject: How do I find out if Multi-finder is running??
Date: Fri, 10 Apr 1992 23:29:47 -0500

 JP> From: jpugh@apple.com (Jon Pugh)

 JP> Simply look for the MultiFinder file in the System folder (the
 JP> name is actually stored in the System itself as a STR or STR# if you want
 JP> to be international.) If it is missing on systems that need it, it's not
 JP> running.  If it is there, open it.  If you get an error MultiFinder is 
 JP> running, otherwise it is not running.

I used to do this when I wanted this info. Then I found out that you
could move a file between directories while it was open. MultiFinder's
icon could be sitting on the desktop and MF would happily keep running.

Obviously, no sane user would do such a thing, right? But when it means
crashing because you didn't think MF was running, well, it gets to look
a little less than paranoid. Besides, a user might think removing MF
from the System Folder has the same effect as removing an INIT, and he'd
be right, sort of.

Checking for the existence of _OSDispatch is much better. At least then
when Apple changes it in System 6.0.19, you'll know which system version
you break on.
Newsgroups: comp.sys.mac.programmer
From: krk@itl.itd.umich.edu (Kenneth Knight)
Subject: Re: Using "OpenStdCompression" with MPW QuickTime headers in THINK C
Organization: Instructional Technology Laboratory, University of Michigan
Date: Wed, 15 Apr 92 17:13:40 GMT

In article <1992Apr14.181300.19306@terminator.cc.umich.edu> potts@itl.itd.umich.edu (Paul Potts) writes:
>I got an answer about using "OpenStdCompression" in THINK C. The solution
>is to put the call, and the prototype in the header file, into all capitals:
>OPENSTDCOMPRESSION.
>
>The reasons seems to be that the MPW linker isn't case-sensitive, while 
>the THINK C
>linker is. Therefore the .o library has the glue call listed as
>OPENSTDCOMPRESSION; under MPW it works to call it by OpenStdCompression, but
>not under THINK.
>
>The OConv utility seems to create a project that can't be opened by THINK C.
>Does anyone know why this is? I get a "ZREF error" - "Please remove objects"
>when I try to open the resulting project file.

One other thing that is worth mentioning. It is very important that you
include the resources for the StdCompression module somewhere in the
application's resource path. They don't exist in a vacuum and the docs on
the module don't really mention them. A complete set can be found in the
.rsrc file that is in the Compression Dialog folder on the QuickTime CD. 
The resource all have IDs around 32000 and include 2 DLOGs (and their DITLs),
THING, sodi, STR#, and some others that I can't recall right now.

If you do not include ALL the resources when you attempt to do the:
   component_instance (some variable) = OpenStdCompression();
your variable will always return nil. I have no idea if checking one of the
error functions would give any more detailed data, but I have my doubts.
From: REEKES@applelink.apple.com (Jim Reekes)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Two basic questions from an advanced programmer
Date: 10 Apr 92 20:14:27 GMT
Organization: Apple Computer, Inc.

In article <scott.702525418@mcl>, scott@mcl.mcl.ucsb.edu (Scott Bronson) writes:
> 
> Here are two things that I've noticed that everyone implements differently.
> Is there any standard on when to use them and when not to?
> 
> (1) Some sample code that I've downloaded expressly checks DiskInserted
> events, then calls DIBadMount depending on the event.  Other code that
> I've seen totally ignores DiskInserted events.  If my application does
> nothing funny with disks other than opening, reading, and writing files,
> should I check for DiskInserted during my event loop, or is that redundant?
> 
> (2) I've implemented my own button.  However, it could take all of the
> processor's time for a long time if the user presses and holds the
> mouse button down on this button.  Some code that I've seen just eats
> up time in a tight loop with nothing in it until the mouse is released,
> some call SystemTask() and I'm sure some do something totally different.
> I don't want a background modem transfer to grind to a halt just because
> somebody pressed and held down the button in my app.
> 
> What should I do?
> 
> 	- Scott

All applications should be checking for diskInserted events.

While the mouse is held down, all non-interrupt tasks stop to track
the mouse.  For example, while you drag a window or pop down a menu
no other processing except for interrupts takes place.  It's a fundamental
aspect of the Mac OS.  Some programmers feel they should try to give
time to other tasks while they track the mouse.  Calling SystemTask
will give some time to drivers that "needsTime".  For example, a Desk
Accessory such as the clock will update the seconds during calls to
SystemTask.  Serial Drivers on the other hand are interrupt driven,
and are not using SystemTask for time.  The application will poll to
get data but calling SystemTask will not give time to a background
application.  So, a modem application will halt the input of serial data
because it's using hand shaking.  You'd have to call WaitNextEvent
to give the background applications time, but this is starting to get
a bit complicated.

You're button isn't any different from the System's buttons (or WDEF,
MDEF, MBDF, etc. for that matter).  The entire OS stops to track the
mouse while in the down position.  I wouldn't worry about it.  Most
user don't hold the mouse down for extended periods of time.  And if
they do, they're not expecting something to be happening in the
background.


-----------------------------------------------------------------------
Jim Reekes, E.O.             |     Macintosh Toolbox Engineering
                             |          Sound Manager Expert
Apple Computer, Inc.         | "All opinions expressed are mine, and do
20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
Cupertino, CA 95014          |       employer, Apple Computer Inc."
From: gl@giordano.enpc.fr.edu (Gilles LEFEBVRE)
Newsgroups: comp.sys.mac.programmer
Subject: MPW 3.1 Libraries needed
Date: 14 Apr 92 13:31:58 GMT
Organization: Ecole Nationale des Ponts et Chaussees (Paris - FRANCE)

I bought MPW 3.1 last year for investigation purpose. I intended to use
it only 2 weeks ago in order to port some c and c++ code from SUN workstation.
I realised that some libraries was missing 
(Libraries:Libraries, Libraries:CLibraries, ...). Calling our french
distributor of APDA, they were able to send me 3.2 Libraries. I have problems
to compile c programs, but I could solve it by mixing 3.1 and 3.2 libs. But
the c++ compiler (which is in fact a front precompiler) doesnt want to function
properly.
Could you help me:
[1] By explaining to me what are the incompatibilities
[2] By sending to me 3.1 Libraries
Thanks a lot.
Gilles LEFEBVRE
Xref: sparky comp.sys.mac.programmer:8093 comp.sys.mac.wanted:4382 comp.sys.mac.system:7069
From: trimper@edsi.plexus.COM (Greg Trimper)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.wanted,comp.sys.mac.system
Subject: GKS for Mac?  C bindings?
Date: 11 Apr 92 22:38:21 GMT
Article-I.D.: edsi.1992Apr11.223821.21618
Organization: Enterprise Data Systems Incorporated, Appleton WI

does anyone know if GKS is available for the Mac?  If so, where nad
how can I get it?  And does it hopefully have C bindings?


					
Greg Trimper   trimper@edsi.plexus.com  
Newsgroups: comp.sys.mac.programmer
From: quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
Subject: Re: How do I find out if Multi-finder is running??
Organization: The University of Western Australia
Date: Mon, 13 Apr 1992 03:53:35 GMT

In article <702994046.F00006@blkcat.UUCP>,... writes:
> 
>  IM> From: ivanski@world.std.com (Ivan M CaveroBelaunde)
> 
>  IM> A technique that I've seen mentioned before is using Gestalt on
>  IM> gestaltOSAttr ('os  '). One of the flags returned specify whether
>  IM> a Launch trap can return to the caller (launchCanReturn or somesuch).
> 
> This Gestalt selector is supported on any machine running the Process Manager,
> which currently is found only in System 7.

Rong.  It's *definitely* supported under System 6.0.7 (with MultiFinder).
I know! I have the technology! I have GestaltDA sitting in front of me!

Quinn "The Eskimo!"   <quinn@cs.uwa.edu.au>  "Real Coke, Diet .sig"
Department of Computer Science, The University of Western Australia
From: ccs011@fred.ucdavis.edu (James Davis)
Newsgroups: comp.sys.mac.programmer
Subject: Writing  apps that use plug-ins?
Date: 6 Apr 92 17:28:35 GMT
Organization: Computing Services, UC Davis
Originator: ccs011@fred.ucdavis.edu

Hi,
	I want to write something, that can take plug-ins that reside
in different files.  Similar to Superpaint, etc etc..
Anyway, the theory seems easy.  If I have a code resource sitting
in this external file, I should be able to just load the resource and
make a call to it. But how?  Since which resources are available (which plugins)
is determined dynamicly, none of them can reside in the jump-table can they?
Anyway, if anyone can point me in the right direction, or refrence me
off to the correct example or paper Id appreciate it.

THanks
James Davis (jedavis@ucdavis.edu) Computing Services, U of Cal.