36 lines
631 B
C
36 lines
631 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
#include "term.h"
|
|
|
|
int main(void) {
|
|
struct ct_term *const term = (struct ct_term *)malloc(sizeof(struct ct_term));
|
|
if (getterm(term)) {
|
|
perror("getterm");
|
|
endterm(term);
|
|
exit(1);
|
|
}
|
|
|
|
if (termsize(term)) {
|
|
perror("termsize");
|
|
endterm(term);
|
|
exit(1);
|
|
}
|
|
|
|
|
|
printf("\e[2J\e[1;1H");
|
|
|
|
char *line = (char *)malloc(sizeof(char) * (term->cols + 1));
|
|
memset(line, 'X', term->cols);
|
|
line[term->cols] = '\0';
|
|
|
|
for (int i=0; i < term->rows; i++) {
|
|
printf("%s", line);
|
|
}
|
|
sleep(3);
|
|
|
|
endterm(term);
|
|
return 0;
|
|
}
|