[comp.sys.mac.programmer] Lightspeed C, MPW and TIFF

chris@well.UUCP (Chris Sears) (06/08/89)

I have source code for a TIFF library written in MPW C.  The trouble is
that I use Lightspeed C.  So I have a few questions:

    1.  Is there a straightforward path for porting from MPW to Lightspeed?
        Why is it that they are so different?  In 100 words or less, is
        there a good reason for me to use MPW?

    2.  Does anyone have a Lightspeed TIFF library?  Is the Aldus TIFF
        library Lightspeed or MPW?

Chris Sears

E-mail:     {hplabs,lll-crg,pacbell,hoptoad}!well!chris
            chris%well.uucp@lll-crg.llnl.gov
Phone:      415.826.2781
Address:    1921 23rd Street
            San Francisco, CA 94107

macgyver@baseball.cis.ohio-state.edu (wilson s liaw) (06/09/89)

In article <12075@well.UUCP> chris@well.UUCP (Chris Sears) writes:
>...........
>    1.  Is there a straightforward path for porting from MPW to Lightspeed?
>        Why is it that they are so different?  In 100 words or less, is
>        there a good reason for me to use MPW?
>
>    2.  Does anyone have a Lightspeed TIFF library?  Is the Aldus TIFF
>        library Lightspeed or MPW?


	Being a ownner of both LSC and MPW C, I thought I post a couple of
the major difference. (I am afraid that there is no strightforward path
for porting.)

	1: the size of int is different, in LSC, a int is 16 bits, MPW C, int
	   is 32 bits.
        2: InitGraf(&thePort) in LSC is InitGraf(&qd.thePort) in MPW C.
	3: the way they handle segment is very different, since you have
 	   LSC, I won't explain how LSC handles it, in MPW whenever you 
	   want to create a new segment, you put 
	   #pragma segment Main
           in your source code file. Thus, you can have lots of segments
	   in a file.

 	   I can't think of anything else at this time. Good luck on the 
convernsion.

				Wilson

-=-
Wilson M. Liaw                            $  Two sure ways to tell a sexy male;
Internet : macgyver@cis.ohio-state.edu    $  the first is, he has a bad memory.
UUCP     : osu-cis!tut!macgyver           $  I forget the second :)
CompuServe : 71310,1653  GEnie : W.Liaw   $

tim@hoptoad.uucp (Tim Maroney) (06/10/89)

In article <12075@well.UUCP> chris@well.UUCP (Chris Sears) writes:
>
>I have source code for a TIFF library written in MPW C.  The trouble is
>that I use Lightspeed C.  So I have a few questions:

I assume you mean the Bear River library?  It works, sort of, but it's
unBearably (sorry) slow and it's chock full of bugs.  We've been using
it since last Fall on my current project and the TIFF guy finally got
so fed up he threw it away and wrote a new one from scratch.  It now
accepts all our validation images, doesn't crash, and runs fast enough
to live with.  (Anyone got any really fast Huffman algorithms, though?)
It's probably worth your while to just learn the format and start
writing your own.

>    1.  Is there a straightforward path for porting from MPW to Lightspeed?

Porting in the other direction is easier, because there are fewer
int size problems in arguments when going from a "short = int"
compiler like LSC to a "long = int" compiler like MPW C.  But it
shouldn't be especially hard, since the Lightspeed C source code
debugger should let you find any translation errors pretty quickly.
You ought to make prototypes for all your routines to avoid possible
type mismatches in function calls.

>        Why is it that they are so different?  In 100 words or less, is
>        there a good reason for me to use MPW?

It's a complex issue.  There are a lot of advantages and disadvantages
to either one.  Here's a probably very incomplete summary.

MPW Pros:
	Faster, smaller output code.
	Access to MPW tools during writing or compilation.
	More freedom in source directory & resource arrangement.
MPW Cons:
	Slower compilation and linking.
	Old-style user interface requiring memorization and manuals.
	Costs a lot more.

>    2.  Does anyone have a Lightspeed TIFF library?  Is the Aldus TIFF
>        library Lightspeed or MPW?

We have a hacked Bear River TIFF library, but believe me, you don't
want it (and we don't want it out there with our name on it).  I'll see
if anything can be done about getting the new one out, but don't hold
your breath.  I hadn't heard about the Aldus TIFF Library; more
information, please?
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com
Postal: 424 Tehama, SF CA 94103; Phone: (415) 495-2934

"Prisons are built with stones of Law, Brothels with bricks of Religion."
    - Blake, "The Marriage of Heaven and Hell"