void romputchar(int c) { static char buf[COLS]; static int col = 0, row = 0; int i; switch (c) { case '\0': break; case '\r': break; /* ignore */ case '\n': for (i = col; i < COLS-1; i++) buf[i] = ' '; buf[i] = '\0'; romout(row, buf); col = 0; if (++row == ROWS) row = 0; break; case '\t': do { romputchar(' '); } while (col & 7); break; default: buf[col] = c; if (++col == COLS-1) romputchar('\n'); break; } }
void out(Node *tp) { if(plaflag) plaout(tp); else if(romflag) romout(tp); }