mirror of
https://github.com/troglobit/finit.git
synced 2026-10-19 11:09:35 +00:00
Refactor screen_init(), use methods developed in pimd project
- Refactor screen_init()
- use native impl. of TTY probing from pimd project
- check if TIOCWINSZ works
- check if we're running in watch(1), for initctl
- check if ANSI goto(999,999) escape seq. works (invasive)
- fallback to 80x24
- Drop screen_exit()
- Rename screen_init() to get_width(), for now, matching pimd
- Relocate call in main() to banner(), first fn to write to TTY
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
fe27ed17eb
commit
4bcfd606b4
6 files changed
+76
-30
No files matched your search
+7
-1
@@ -121,7 +121,7 @@ static void add_console(char *cons)
|
||||
num_cons++;
|
||||
}
|
||||
|
||||
void console_init(void)
|
||||
static void find_active_consoles(void)
|
||||
{
|
||||
char *cons, *ptr, *tok;
|
||||
char buf[512];
|
||||
@@ -148,6 +148,12 @@ void console_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
void console_init(void)
|
||||
{
|
||||
find_active_consoles();
|
||||
screen_init();
|
||||
}
|
||||
|
||||
ssize_t cprintf(const char *fmt, ...)
|
||||
{
|
||||
const size_t len = strlen(fmt) * 2;
|
||||
|
||||
Reference in new issue
Block a user