[comp.sys.mac.programmer] MacTCP programming with THINK C

resnick@lees.cogsci.uiuc.edu (Pete Resnick) (07/10/90)

I have gotten enough request for the changes I have made to the MacTCP
header files that I think I will post them here. There are only a few
changes that I have made so far, but there may be others that I
haven't used yet.

In MacTCPCommonTypes.h, change the "ifndef/include" definition to look
like this:

#ifndef _MacTypes_
#include <MacTypes.h>
#endif /* _MacTypes_ */

In UDPPB.h, comment out the word "pascal" in the declaration of
UDPNotifyProc so that it looks like this (THINK C doesn't like a
typedefed pascal funtion):

typedef /*pascal*/ void (*UDPNotifyProc) (
		StreamPtr udpStream, 
		unsigned short eventCode, 
		Ptr userDataPtr,
		struct ICMPReport *icmpMsg);

Do the same thing in TCPPB.h for TCPNotifyProc:

typedef /*pascal*/ void (*TCPNotifyProc) (
		StreamPtr tcpStream,
		unsigned short eventCode,
		Ptr userDataPtr,
		unsigned short terminReason,
		struct ICMPReport *icmpMsg);

You will not be able to use these typedefs in your own programs; they
are only to deal with other declarations in your header files. In your
code, declare your notify procs as 'pascal void whatever' with all of
the parameters as they are declare in the typedef.

That's all I have found so far, except that in my copy of TCPPB.h,
instead of the csCode for receive buffer return being TCPBfrReturn as
documented, it was TCPRcvBfrReturn. I changed it to TCPBfrReturn.

pr
--
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet  : resnick@kant.cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD

ml10+@andrew.cmu.edu (Michael A. Libes) (07/10/90)

   Make sure to change all "int" to "long" in the header files.  This
applies to converting any MPW header files to THINK C.
   In MPW, ints are longs, but in THINK, ints are shorts.

    - Luni