#include <PalmOS.h>
#include <unix/sys_socket.h>
typedef struct {
UInt16 AppNetRefnum;
Int32 AppNetTimeout;
NetSocketRef socket;
UInt16 sendreceiveflags;
Err error;
} AM_tcpip;
extern Err AmNetLibLoad(AM_tcpip *S);
extern Err AmNetLibConnect(AM_tcpip *S, const Char *hostname, const UInt16 port, const UInt16 tout);
extern Int16 AmNetLibSend(AM_tcpip *S, Char *buffer, UInt16 buflen);
extern Int16 AmNetLibRecv(AM_tcpip *S, Char *buffer, const int maxlen);
extern Int16 AmNetLibSendLine(AM_tcpip *S, Char *line);
extern Int16 AmNetLibRecvLine(AM_tcpip *S, Char *line, const int maxlen);
extern Err AmNetLibClose(AM_tcpip *S);
extern Err AmNetLibUnload(AM_tcpip *S);