From 059606b5efde97518e0d532f2bc8c1d92e6ab035 Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Sun, 28 Sep 2025 13:20:35 +1000 Subject: [PATCH] raw mode now works (canon todo) --- src/ct_test.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/ct_test.c b/src/ct_test.c index 04b7b78..639928d 100644 --- a/src/ct_test.c +++ b/src/ct_test.c @@ -4,32 +4,42 @@ #include #include "term.h" +#include "termio.h" int main(void) { - struct ct_term *const term; + struct ct_term *term; int retv = OK; - if (stashterm(&term)) { + if (ct_stashterm(&term)) { perror("saveterm"); exit(ERR); } - if (termsize(term)) { + if (ct_termsize(term)) { perror("termsize"); retv = ERR; goto end; } - 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); + if (termmode_raw(term)) { + perror("termmode_raw"); + retv = ERR; + goto end; } - printf("\n"); - sleep(3); + + printf("%d - %d (%d)\n", term->rows, term->cols, term->fd); + + // 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); + // } + // printf("\n"); + while (1) + sleep(3); end: - resetterm(term); - return 0; + ct_resetterm(term); + return retv; }