void select_timer_block(ticks interval) { struct timeval timeout; struct timeval *timeout_pointer = 0; int result; descriptor d; if (interval){ ticks_to_timeval(&timeout, interval); timeout_pointer = &timeout; } table_foreach (read_handlers, d, z) FD_SET((unsigned long)d, &reads); table_foreach (write_handlers, d, z) FD_SET((unsigned long)d, &writes); result = select(FD_SETSIZE, &reads, &writes, 0, timeout_pointer); if (result > 0) { scan_table(&reads, read_handlers); scan_table(&writes, write_handlers); } }
static value make_table(cstlist csts, fncode fn) { struct table *t = alloc_table(DEF_TABLE_SIZE); GCPRO1(t); for (; csts; csts = csts->next) table_set(t, csts->cst->u.constpair->cst1->u.string, make_constant(csts->cst->u.constpair->cst2, FALSE, fn), NULL); table_foreach(t, protect_symbol); SET_READONLY(t); GCPOP(1); return t; }
static value make_table(cstlist csts) { struct table *t = alloc_table(DEF_TABLE_SIZE); GCPRO1(t); for (; csts; csts = csts->next) table_set_len(t, csts->cst->u.constpair->cst1->u.string.str, csts->cst->u.constpair->cst1->u.string.len, make_constant(csts->cst->u.constpair->cst2)); table_foreach(t, NULL, protect_symbol); immutable_table(t); UNGCPRO(); return t; }