From 5c328c7a8801d6a4aded769092ead9715d4ecf98 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 2 Feb 2020 19:34:35 -0500 Subject: Remove term.c in favor of more curses APIs --- term.c | 66 ------------------------------------------------------------------ 1 file changed, 66 deletions(-) delete mode 100644 term.c (limited to 'term.c') diff --git a/term.c b/term.c deleted file mode 100644 index 427cac6..0000000 --- a/term.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (C) 2018, 2020 C. McEnroe - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include -#include - -#include "chat.h" - -void termNoFlow(void) { - struct termios attr; - int error = tcgetattr(STDIN_FILENO, &attr); - if (error) return; - attr.c_iflag &= ~IXON; - attr.c_cc[VDISCARD] = _POSIX_VDISABLE; - tcsetattr(STDIN_FILENO, TCSANOW, &attr); -} - -static void privateMode(const char *mode, bool set) { - printf("\33[?%s%c", mode, (set ? 'h' : 'l')); - fflush(stdout); -} - -void termMode(enum TermMode mode, bool set) { - switch (mode) { - break; case TermFocus: privateMode("1004", set); - break; case TermPaste: privateMode("2004", set); - } -} - -enum { Esc = '\33' }; - -enum TermEvent termEvent(char ch) { - static int st; -#define T(st, ch) ((st) << 8 | (ch)) - switch (T(st, ch)) { - break; case T(0, Esc): st = 1; - break; case T(1, '['): st = 2; - break; case T(2, 'I'): st = 0; return TermFocusIn; - break; case T(2, 'O'): st = 0; return TermFocusOut; - break; case T(2, '2'): st = 3; - break; case T(3, '0'): st = 4; - break; case T(4, '0'): st = 5; - break; case T(5, '~'): st = 0; return TermPasteStart; - break; case T(4, '1'): st = 6; - break; case T(6, '~'): st = 0; return TermPasteEnd; - break; default: st = 0; - } - return 0; -#undef T -} -- cgit 1.4.0 kefile?h=2065.06&id=1b6c5a04ae477b97b184ab0d0e19efcbedf88fe5'>unfollow)
Commit message (Expand)Author
2022-10-16NetBSD: include text.tar.xz man pages 2063.8Štěpán Němec
2022-10-16Update to Linux man-mages 6.00Štěpán Němec
2022-10-16Update to NetBSD 9.3Štěpán Němec
2022-09-18Make copyrights and AUTHORS consistentJune McEnroe
2022-07-27Update to FreeBSD 13.1 2062.83June McEnroe
2022-07-27openbsd: Include man pages from baseXX.tgzKeith Whitney
2022-05-08Update to OpenBSD 7.1 2062.73June McEnroe
2021-10-15Update to OpenBSD 7.0 2062.63June McEnroe
2021-08-29Update to Linux man-pages 5.13 2062.53Štěpán Němec
2021-08-26Update to NetBSD 9.2 2062.52June McEnroe
2021-08-26Support DESTDIR in install/uninstallJune McEnroe
2021-08-26Add version number generatorJune McEnroe
2021-08-22Add ISC license headerJune McEnroe
2021-08-22Update to Linux man-pages 5.12Štěpán Němec
2021-06-21Add manuals for macOS 11.3June McEnroe
2021-05-08Update to OpenBSD 6.9June McEnroe
2021-04-26Update to Linux man-pages 5.11June McEnroe
2021-04-26Update to FreeBSD 13.0June McEnroe
2021-01-27Completely rewrite how manuals are fetched and installedJune McEnroe
2020-12-14Update to man-pages-posix 2017-aJune McEnroe
2020-12-14Update to OpenBSD 6.8June McEnroe
2020-12-14Update to NetBSD 9.1June McEnroe
2020-12-14Update to man-pages 5.09June McEnroe
2020-12-14Update to FreeBSD 12.2June McEnroe
2020-06-08Update to OpenBSD 6.7June McEnroe
2020-05-04Add hack for macOS to search extra man sectionsJune McEnroe
2020-05-04Don't clear MANSECTJune McEnroe