efn/c_print.c

27 lines
438 B
C
Raw Normal View History

void
print_with_fixed_tabs(Row *row) {
for (int i = 0; i < ROW_SIZE; i++) {
if(row->text[i] == 0) break;
if (row->text[i] == '\t') printf(" ");
else printf("%c", row->text[i]);
}
}
void
c_print(char *c) {
Row *row = buffer;
int line = 1;
for (;; line++) {
printf("%3.i| ", line);
print_with_fixed_tabs(row);
puts("");
if (row->n == NULL) break;
row = row -> n;
}
}