File: cTCP_121.h

package info (click to toggle)
ghc-cvs 20040725-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 68,484 kB
  • ctags: 19,658
  • sloc: haskell: 251,945; ansic: 109,709; asm: 24,961; sh: 12,825; perl: 5,786; makefile: 5,334; xml: 3,884; python: 682; yacc: 650; lisp: 477; cpp: 337; ml: 76; fortran: 24; csh: 18
file content (57 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef __CTCP__
#define __CTCP__

#if defined(mingw32_TARGET_OS)
#include <winsock.h>

typedef int DNSHdl;

struct DNSInfo
	{	struct DNSInfo	*next;
		HANDLE	dnsHdl;
		union	{	struct hostent	Hostent;
					char			freeSpace[MAXGETHOSTSTRUCT];
				}
				junion;
	};
typedef struct DNSInfo DNSInfo;

// the dictionary items
struct dictitem
	{	SOCKET			endpointRef;
		struct dictitem	*next;
		char			availByte;
		unsigned		availByteValid		: 1;
		unsigned		referenceCount		: 2;
		unsigned		hasReceiveNotifier	: 1;
			// three kinds of receivers: receivers for established connections,
			// receivers for dns requests, receivers for asynchronous connect
		unsigned		hasSendableNotifier	: 1;
		unsigned		aborted				: 1;
		unsigned		disconnected		: 1;
	};
typedef struct dictitem dictitem;

#define IE_CONNECTREQUEST		0x0001
#define IE_RECEIVED				0x0004
#define IE_EOM					0x0010
#define IE_SENDABLE				0x0100
#define IE_DISCONNECTED			0x0011
#define IE_IPADDRESSFOUND		0x2000000F
#define IE_IPADDRESSNOTFOUND	0x20000010
#define IE_ASYNCCONNECTCOMPLETE	0x0002
#define IE_ASYNCCONNECTFAILED	0x0003

#define ListenerReceiver	0
#define RChanReceiver		1
#define SChanReceiver		2
#define DNSReceiver			3
#define ConnectReceiver		4

/* PA: InitSockets has no definition.
void InitSockets();
*/
extern dictitem* lookup(SOCKET endpointRef);
#endif

#endif