From d5aaacda5a4b6cbea654c0d0cca3c901b8dda3d3 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Sat, 9 May 2009 16:52:07 +1000 Subject: introduce libbb/termios.c for terminal-related functions --- libbb/xfuncs.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'libbb/xfuncs.c') diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index 06bba0fe3..3d0bec7ac 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c @@ -625,26 +625,7 @@ void selinux_or_die(void) /* It is perfectly ok to pass in a NULL for either width or for * height, in which case that value will not be set. */ -#ifdef __MINGW32__ -#include -int get_terminal_width_height(const int fd, int *width, int *height) -{ - HANDLE console; - CONSOLE_SCREEN_BUFFER_INFO sbi; - - console = GetStdHandle(STD_OUTPUT_HANDLE); - if (console == INVALID_HANDLE_VALUE || !console) - return -1; - - GetConsoleScreenBufferInfo(console, &sbi); - - if (width) - *width = sbi.srWindow.Right - sbi.srWindow.Left; - if (height) - *height = sbi.srWindow.Bottom - sbi.srWindow.Top; - return 0; -} -#else +#ifndef __MINGW32__ int get_terminal_width_height(const int fd, int *width, int *height) { struct winsize win = { 0, 0, 0, 0 }; -- cgit v1.2.3-55-g6feb