Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!apple!austing From: austing@Apple.COM (Glenn L. Austin) Newsgroups: comp.sys.mac Subject: Re: MPW C 3.0 Help! Message-ID: <28563@apple.Apple.COM> Date: 7 Apr 89 17:52:18 GMT References: <38240@bbn.COM> <1353@ndmath.UUCP> Distribution: usa Organization: Apple Computer Inc, Cupertino, CA Lines: 60 In article <1353@ndmath.UUCP> dierks@ndmath.UUCP (Tim Dierks) writes: >From article <38240@bbn.COM>, by levin@bbn.com (Joel B Levin): >>In article <38226@bbn.COM> levin@BBN.COM (Joel B Levin) writes: >>>In article <1748@amelia.nas.nasa.gov> prabhu@amelia.nas.nasa.gov (Dinesh K. Prabhu) writes: >>>> I recently got MPW C(3.0) and I am planning on switching to that >>>> environment. Could someone give me helpful tips on converting LSC 3.0 >>> >>> [ Notes about going from LSC to MPW] >> >> [More notes about LSC -> MPW] > > One other thing is that Str255s are different: Not in MPW 3.0 -- they are both declared as arrays of unsigned char. >Mac function that takes a string, it assumes you're transferring a C string and >messes with it. Once again, MPW 3.0 takes the string as you pass it -- so if you pass it a C string, MPW does nothing to the string to convert it to Pascal format. > It also insists that you pass variable of type Point by reference, Any structure of 4 bytes or less is passed by value -- as defined in the MPW C 3.0 Reference. >Fortunately, it provides all-caps versions of the functions Wrong again. All functions are defined as they are in IM. If you want to pass information in C format and have it automagically converted to Pascal, the functions that you call are all lowercase letters. About the only thing you have to worry about is that MPW defines int as a 32-bit value, whereas LSC defines them as 16-bit values. However, a simple header file can take care of all of this for the Mac: /* portable.h */ #ifndef Integer #define Integer short #endif #ifndef Longint #define Longint long #endif #ifndef NIL #define NIL 0L #endif ----------------------------------------------------------------------------- | Glenn L. Austin | The nice thing about standards is that | | Apple Computer, Inc. | there are so many of them to choose from. | | Internet: austing@apple.com | -Andrew S. Tanenbaum | ----------------------------------------------------------------------------- | All opinions stated above are mine -- who else would want them? | -----------------------------------------------------------------------------