2004-08-12 23:40:28 -04:00
|
|
|
/* Buffer mode */
|
2004-08-15 21:50:44 -04:00
|
|
|
typedef enum { B_READ_LINE, B_WRITE, B_NONE } B_MODE;
|
2004-08-12 23:40:28 -04:00
|
|
|
|
2004-08-12 17:36:36 -04:00
|
|
|
typedef struct {
|
|
|
|
CELL header;
|
|
|
|
FIXNUM fd;
|
|
|
|
STRING* buffer;
|
2004-08-15 21:50:44 -04:00
|
|
|
/* tagged partial line used by read_line_fd */
|
|
|
|
CELL line;
|
2004-08-15 22:45:08 -04:00
|
|
|
/* tagged client info used by accept_fd */
|
|
|
|
CELL client_host;
|
|
|
|
CELL client_port;
|
|
|
|
CELL client_socket;
|
2004-08-12 23:40:28 -04:00
|
|
|
/* one of B_READ, B_WRITE or B_NONE */
|
|
|
|
B_MODE buf_mode;
|
|
|
|
/* top of buffer */
|
2004-08-12 17:36:36 -04:00
|
|
|
CELL buf_fill;
|
2004-08-12 23:40:28 -04:00
|
|
|
/* current read/write position */
|
2004-08-12 17:36:36 -04:00
|
|
|
CELL buf_pos;
|
|
|
|
} PORT;
|
|
|
|
|
|
|
|
PORT* untag_port(CELL tagged);
|
2004-08-15 21:50:44 -04:00
|
|
|
PORT* port(CELL fd);
|
2004-08-12 17:36:36 -04:00
|
|
|
void init_buffer(PORT* port, int mode);
|
|
|
|
void primitive_portp(void);
|
|
|
|
void fixup_port(PORT* port);
|
|
|
|
void collect_port(PORT* port);
|