- char * f_name = "read_fifo_into_queue()";
- uint32_t buf_size = PIPE_BUF;
- int fdesc_infile = open(world.path_in, O_RDONLY | O_NONBLOCK);
- exit_trouble(-1 == fdesc_infile, "open()", f_name);
- char buf[buf_size];
- memset(buf, 0, buf_size);
- int bytes_read;
- uint8_t read_state = 0; /* 0: waiting for input. 1: started receiving it. */
+ struct Thing * o;
+ for (o = t->owns; o; o = o->next)
+ {
+ write_thing(file, o);
+ }
+ write_key_space_uvalue(file, s[S_CMD_T_ID], t->id);
+ write_key_space_uvalue(file, s[S_CMD_T_TYPE], t->type);
+ write_key_space_uvalue(file, s[S_CMD_T_POSY], t->pos.y);
+ write_key_space_uvalue(file, s[S_CMD_T_POSX], t->pos.x);
+ write_key_space_uvalue(file, s[S_CMD_T_COMMAND], t->command);
+ write_key_space_uvalue(file, s[S_CMD_T_ARGUMENT], t->arg);
+ write_key_space_uvalue(file, s[S_CMD_T_PROGRESS], t->progress);
+ write_key_space_uvalue(file, s[S_CMD_T_HP], t->lifepoints);
+ write_key_space_svalue(file, s[S_CMD_T_SATIATION], t->satiation);
+ for (o = t->owns; o; o = o->next)
+ {
+ write_key_space_uvalue(file, s[S_CMD_T_CARRIES], o->id);
+ }
+ write_mem_map(file, t->mem_depth_map, s[S_CMD_T_MEMDEPTHMAP]);
+ write_mem_map(file, t->mem_map, s[S_CMD_T_MEMMAP]);
+ struct ThingInMemory * tm = t->t_mem;
+ for (; tm; tm = tm->next)
+ {
+ write_key_space(file, s[S_CMD_T_MEMTHING]);
+ write_uvalue(file, tm->type);
+ try_fputc(' ', file, __func__);
+ write_uvalue(file, tm->pos.y);
+ try_fputc(' ', file, __func__);
+ write_uvalue(file, tm->pos.x);
+ try_fputc('\n', file, __func__);
+ }
+ try_fputc('\n', file, __func__);
+}
+
+
+
+static void try_growing_queue()
+{
+ uint8_t wait_seconds = 5;
+ time_t now = time(0);
+ struct timespec dur;
+ dur.tv_sec = 0;
+ dur.tv_nsec = 33333333;