factor/native/port.h

29 lines
690 B
C
Raw Normal View History

typedef enum { PORT_READ, PORT_WRITE, PORT_SPECIAL } PORT_MODE;
2004-08-12 23:40:28 -04:00
typedef struct {
CELL header;
/* one of PORT_READ or PORT_WRITE */
PORT_MODE type;
FIXNUM fd;
STRING* buffer;
2004-08-15 21:50:44 -04:00
/* tagged partial line used by read_line_fd */
CELL line;
2004-08-16 20:42:30 -04:00
/* is it ready to be returned? */
bool line_ready;
/* tagged client info used by accept_fd */
CELL client_host;
CELL client_port;
/* untagged fd of accepted connection */
CELL client_socket;
2004-08-12 23:40:28 -04:00
/* top of buffer */
CELL buf_fill;
2004-08-12 23:40:28 -04:00
/* current read/write position */
CELL buf_pos;
} PORT;
PORT* untag_port(CELL tagged);
PORT* port(PORT_MODE type, CELL fd);
void primitive_portp(void);
void fixup_port(PORT* port);
void collect_port(PORT* port);