void list_frames(FILE *f) { register struct frange *r; register struct frange *nextr; if (!are_frames()) { fprintf(f, " No frames"); return; } (void) fprintf(f, " %-30s %s\n","Outer Range","Inner Range"); if (!brokenpipe) (void) fprintf(f, " %-30s %s\n","-----------","-----------"); for (r = nextr = frame_base; nextr; r = nextr, nextr = r->r_next) /* */ ; while (r) { fprintf(f, " %-30s %s\n", r_name(r->or_left->row, r->or_left->col, r->or_right->row, r->or_right->col), r_name(r->ir_left->row, r->ir_left->col, r->ir_right->row, r->ir_right->col)); if (brokenpipe) return; r = r->r_prev; } }
void list_colors(FILE *f) { struct crange *r; struct crange *nextr; write_colors(f, 2); linelim = -1; if (brokenpipe) return; if (!are_colors()) { fprintf(f, " No color ranges"); return; } fprintf(f, " %-30s %s\n","Range", "Color"); if (!brokenpipe) fprintf(f, " %-30s %s\n","-----", "-----"); for (r = nextr = color_base; nextr; r = nextr, nextr = r->r_next) /* */ ; while (r) { fprintf(f, " %-32s %d\n", r_name(r->r_left->row, r->r_left->col, r->r_right->row, r->r_right->col), r->r_color); if (brokenpipe) return; r = r->r_prev; } }
void getframe (int fd) { struct frange *fr; *line = '\0'; if ((fr = find_frange(currow, curcol))) { sprintf(line, "%s", r_name(fr->or_left->row, fr->or_left->col, fr->or_right->row, fr->or_right->col)); strcat(line, " "); sprintf(line + strlen(line), "%s", r_name(fr->ir_left->row, fr->ir_left->col, fr->ir_right->row, fr->ir_right->col)); } strcat(line, "\n"); write(fd, line, strlen(line)); linelim = -1; }