void handle_dir_params(t_info *info, t_command com, int fd, t_params *p) { if (com.params[p->i][1] != LABEL_CHAR) { p->temp_int = ft_atoi(com.params[p->i] + 1); if (com.dir_as_index == TRUE) rev_write(fd, &p->temp_int, IND_SIZE); else rev_write(fd, &p->temp_int, DIR_SIZE); } else { if ((p->k = find_label_line(info, ft_strchr(com.params[p->i], LABEL_CHAR))) != -1) { p->offset = count_bytes_between(info, com.line_nbr, p->k); rev_write(fd, &p->offset, 2); } else { ft_putstr_fd("Error : Label not found\n", 2); exit(-1); } } }
struct syntax_node * output_stm(){ struct syntax_node * t; t = (struct syntax_node*)malloc(sizeof(struct syntax_node)); chushihua_t(t); t->child[0] = rev_write(); t->child[1] = zuokuohao(); t->child[2] = Exp(); t->child[3] = youkuohao(); strcpy(t->kind_name, "OutputStm"); return t; }