-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnection.h
38 lines (31 loc) · 896 Bytes
/
connection.h
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
#ifndef __CONNECTION_H__
#define __CONNECTION_H__
#ifndef __TCPIP__
#include <tcpip.h>
#endif
enum {
kConnectionStateDNR = 1,
kConnectionStateConnecting,
kConnectionStateConnected,
kConnectionStateDisconnecting,
kConnectionStateDisconnected,
kConnectionStateError
};
typedef void (*ConnectionCallback)(const char *message);
typedef struct Connection {
Word memID;
Word ipid;
Word terr;
Word state;
dnrBuffer dnr;
Word port;
ConnectionCallback displayPtr;
} Connection;
void ConnectionInit(Connection *, Word memID, ConnectionCallback displayPtr);
Word ConnectionOpen(Connection *, const char *host, Word port);
Word ConnectionOpenC(Connection *, const char *host, Word port);
Word ConnectionOpenGS(Connection *, const GSString255 *host, Word port);
Word ConnectionClose(Connection *);
Word ConnectionAbort(Connection *);
Word ConnectionPoll(Connection *);
#endif