gopher/connection.h

41 lines
863 B
C
Raw Permalink Normal View History

2012-04-28 01:19:10 +00:00
#ifndef __CONNECTION_H__
#define __CONNECTION_H__
2012-03-11 21:25:17 +00:00
#ifndef __TCPIP__
#include <tcpip.h>
#endif
enum {
kConnectionStateDNR = 1,
kConnectionStateConnecting,
kConnectionStateConnected,
kConnectionStateDisconnecting,
kConnectionStateDisconnected,
kConnectionStateError
};
typedef void (*ConnectionCallback)(const char *message);
2012-03-11 21:25:17 +00:00
typedef struct Connection {
Word memID;
Word ipid;
Word terr;
Word state;
dnrBuffer dnr;
Word port;
ConnectionCallback displayPtr;
2012-03-11 21:25:17 +00:00
} Connection;
void ConnectionInit(Connection *, Word memID, ConnectionCallback displayPtr);
2012-03-11 21:25:17 +00:00
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 ConnectionPoll(Connection *);
#endif