Path: utzoo!attcan!uunet!cs.utexas.edu!csd4.milw.wisc.edu!mailrus!ulowell!hawk!jkeegan From: jkeegan@hawk.ulowell.edu (Jeff Keegan) Newsgroups: comp.sys.mac.programmer Subject: MPW C <-> Lightspeed C header files Message-ID: <14107@swan.ulowell.edu> Date: 9 Jul 89 15:31:09 GMT Sender: news@swan.ulowell.edu Reply-To: jkeegan@hawk.ulowell.edu (Jeff Keegan) Organization: University of Lowell, CS Dept Lines: 54 I'm using Lightspeed C (3.01) on a MacIIx. I'm trying to convert a MPW C header file so I can use it in Lightspeed C. I want to know how to declare a pascal PROCEDURE (a function that doesn't return a value) in Lightspeed C. In the MPW header file, it says something like typedef pascal void (*MyProc) ( int argument1; char argument2; /* etc.. these are made up */ Ptr argument3); Trying to precompile this from Lightspeed C gives me "invalid storage class". What *I* interpretted the error to mean was that there wasn't a pascal type "void" in Lightspeed Pascal (a guess, assuming that either there WAS a void type in MPW Pascal, or it was a special case of the C compiler to look for void in a pascal declaration). Also, I've noticed that in Lightspeed C you don't give paramater lists at that point. I've tried using typedef pascal void (*MyProc) () also, and it still doesn't work.. Another example was this : The MPW code said typedef void (*MyOtherProc) (struct MyStruct *thestruct) This said "paramater list is inappropriate here" in Lightspeed C so I replaced it with typedef void (*MyOtherProc) () which seems to work. Questions : 1) Am I correct in my change for that second example (the typedef for MyOtherProc)? 2) How do I interpret or translate the first one? Thanks for your help in advance.. ..Jeff Keegan ------------------------------------------------------------------------------- | Jeff Keegan | I clutch the wire fence until my fingers bleed | | jkeegan@hawk.ulowell.edu | A wound that will not heal | |----------------------------| A heart that cannot feel | | This space intentionally | Hoping that the horror will receed | | left blank | Hoping that tomorrow we'll all be freed -RUSH | -------------------------------------------------------------------------------