static void process_port_write(process_port_t* port, dfsch_writer_state_t* state){ if (port->open){ dfsch_write_unreadable(state, port, "name %s fd %d", port->cmd_line, fileno(port->file)); } else { dfsch_write_unreadable(state, port, "*closed*"); } }
static void file_port_write(file_port_t* port, dfsch_writer_state_t* state){ if (port->open){ if (port->name){ dfsch_write_unreadable(state, (dfsch_object_t*)port, "name %s fd %d", port->name, fileno(port->file)); } else { dfsch_write_unreadable(state, (dfsch_object_t*)port, "fd %d", fileno(port->file)); } } else { dfsch_write_unreadable(state, (dfsch_object_t*)port, "*closed*"); } }
static void decoded_time_write(decoded_time_t* time, dfsch_writer_state_t* state){ dfsch_write_unreadable(state, (dfsch_object_t*)time, "%04d-%02d-%02dT%02d:%02d:%02d", time->tm.tm_year+1900, time->tm.tm_mon+1, time->tm.tm_mday, time->tm.tm_hour, time->tm.tm_min, time->tm.tm_sec); }