#include <dos.h>
#include <io.h>

typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;

#include "netdef.h"
#include "../msdos/msdos.h"
#include "pctcp.h"
#define _NTOHL
#include <pctcp\types.h>
#include <pctcp\error.h>
#include <pctcp\pctcp.h>

#ifndef NULL
#define NULL 0
#endif

#define TCPCONN

#define OUTBUFSIZE	512
#define MAXBUFSIZE	8192
#define MAXOUTBUF	8192

typedef struct _connection {
    struct _connection _near *next;
    char *buffer;               /* contains current client input */
    int  count;                /* count of bytes in buffer */
    int size;
} Connection, _near *ConnectionPtr;

typedef struct _osComm {
    int fd;
    ConnectionPtr input;
    ConnectionPtr output;
    u_short flags;
    int client;
    unsigned long conn_time;
} OsCommRec, _near *OsCommPtr;

#define OS_REUSE	0x0001		/* re-use the request in the buffer */
#define OS_REQUEST	0x0002		/* full request left in input buffer */
#define OS_BLOCKED	0x0004		/* output write-blocked */
#define OS_FCLOSED	0x0100		/* other side has closed */
#define OS_CLOSING	0x0200		/* wait for output to drain first */

/* #define X_PRINT_PORT	5600 */
#define XDMCP
