/* io.h */ #define IOSTATE_OK 0 #define IOSTATE_ERR 1 #define IOSTATE_HUNGUP 2 /* Slightly over 512, just for luck. */ #define MUDBUFSIZ 516 /* * IO buffer states. - a simple state machine */ #define INPUT_NEWCONN 0 #define INPUT_PLAY 1 /* * an Iob is a per-user I/O buffer with file descriptor, type flag, etc. */ struct Iob { int typ; int player; int state; /* connection status */ int quota; /* how many commands left this slice */ long connect; /* time connected */ long lastcmd; /* time of last command. */ int blown; /* number of times quota blown this session */ struct Iob *whofwd; struct Iob *whoback; long site; int fd; int inputcnt; int outputcnt; int outputtries; /* A kludge. Don't ask */ char inputbuf[MUDBUFSIZ]; /* Space for terminator */ char outputbuf[MUDBUFSIZ]; char *hostname; char *doing; char *outputprefix; char *outputsuffix; }; typedef struct Iob Iob; extern int mud_port;