Clarify portability and main program.
[python/dscho.git] / Mac / Unsupported / mactcp / tcpglue.h
blobef9e133a8d1a6e4cd93d63fa2281703befc94560
1 /*
2 * Prototypes for mactcpglue routines and includes/structures needed
3 * by those.
5 * Jack Jansen, CWI, 1994.
7 * Adapted from mac socket library, which has in turn adapted from ncsa telnet.
8 * Original authors: Tom Milligan, Charlie Reiman
9 */
11 #include <MacTCPCommonTypes.h>
12 #include <GetMyIPAddr.h>
13 #include <TCPPB.h>
14 #include <UDPPB.h>
15 #include <AddressXlation.h>
17 #ifndef __MWERKS__
18 #define TCPIOCompletionUPP TCPIOCompletionProc
19 #define TCPNotifyUPP TCPNotifyProc
20 #define UDPIOCompletionUPP UDPIOCompletionProc
21 #define UDPNotifyUPP UDPNotifyProc
22 #define NewTCPIOCompletionProc(x) (x)
23 #define NewTCPNotifyProc(x) (x)
24 #define NewUDPIOCompletionProc(x) (x)
25 #define NewUDPNotifyProc(x) (x)
26 #endif /* __MWERKS__ */
28 #if defined(powerc) || defined (__powerc)
29 #pragma options align=mac68k
30 #endif
32 typedef struct miniwds
34 unsigned short length;
35 char * ptr;
36 unsigned short terminus; /* must be zero'd for use */
37 } miniwds;
39 #if defined(powerc) || defined(__powerc)
40 #pragma options align=reset
41 #endif
44 OSErr xOpenDriver(void);
45 OSErr xPBControl(TCPiopb *pb, TCPIOCompletionUPP completion);
46 OSErr xPBControlSync(TCPiopb *pb);
47 OSErr xTCPCreate(int buflen, TCPNotifyUPP notify, void *udp, TCPiopb *pb);
48 OSErr xTCPPassiveOpen(TCPiopb *pb, short port, TCPIOCompletionUPP completion, void *udp);
49 OSErr xTCPActiveOpen(TCPiopb *pb, short port, long rhost, short rport, TCPIOCompletionUPP completion);
50 OSErr xTCPRcv(TCPiopb *pb, char *buf, int buflen, int timeout, TCPIOCompletionUPP completion);
51 OSErr xTCPNoCopyRcv(TCPiopb *,rdsEntry *,int,int,TCPIOCompletionUPP);
52 OSErr xTCPBufReturn(TCPiopb *pb,rdsEntry *rds,TCPIOCompletionUPP completion);
53 OSErr xTCPSend(TCPiopb *pb, wdsEntry *wds, Boolean push, Boolean urgent, TCPIOCompletionUPP completion);
54 OSErr xTCPClose(TCPiopb *pb,TCPIOCompletionUPP completion);
55 OSErr xTCPAbort(TCPiopb *pb);
56 OSErr xTCPRelease(TCPiopb *pb);
58 OSErr xUDPCreate(UDPiopb *pb,int buflen,ip_port *port, UDPNotifyUPP asr, void *udp);
59 OSErr xUDPRead(UDPiopb *pb,int timeout, UDPIOCompletionUPP completion);
60 OSErr xUDPBfrReturn(UDPiopb *pb, char *buff);
61 OSErr xUDPWrite(UDPiopb *pb,ip_addr host,ip_port port,miniwds *wds,
62 UDPIOCompletionUPP completion);
63 OSErr xUDPRelease(UDPiopb *pb);
65 ip_addr xIPAddr(void);
66 long xNetMask(void);
67 unsigned short xMaxMTU(void);