factor/native/iomux.h

40 lines
796 B
C
Raw Normal View History

2004-08-13 02:19:22 -04:00
typedef enum {
IO_TASK_READ_LINE,
IO_TASK_READ_COUNT,
IO_TASK_WRITE
} IO_TASK_TYPE;
2004-08-13 01:38:15 -04:00
typedef struct {
2004-08-13 02:19:22 -04:00
IO_TASK_TYPE type;
CELL port;
2004-08-13 01:38:15 -04:00
CELL callback;
} IO_TASK;
2004-08-13 01:38:15 -04:00
fd_set read_fd_set;
IO_TASK read_io_tasks[FD_SETSIZE];
int read_fd_count;
fd_set write_fd_set;
IO_TASK write_io_tasks[FD_SETSIZE];
int write_fd_count;
void init_io_tasks(fd_set* fd_set, IO_TASK* io_tasks);
void init_iomux(void);
2004-08-13 02:19:22 -04:00
void add_io_task_impl(
IO_TASK_TYPE type,
2004-08-13 01:38:15 -04:00
PORT* port,
CELL callback,
2004-08-13 02:19:22 -04:00
fd_set* fdset,
2004-08-13 01:38:15 -04:00
IO_TASK* io_tasks,
int* fd_count);
2004-08-13 02:19:22 -04:00
void add_io_task(IO_TASK_TYPE type, PORT* port, CELL callback);
void remove_io_task_impl(
IO_TASK_TYPE type,
2004-08-13 01:38:15 -04:00
PORT* port,
fd_set* fdset,
IO_TASK* io_tasks,
int* fd_count);
2004-08-13 02:19:22 -04:00
void remove_io_task(IO_TASK_TYPE type, PORT* port);
2004-08-13 01:38:15 -04:00
CELL iomux(void);
2004-08-13 02:19:22 -04:00
void collect_io_tasks(void);