#ifdef UNIX #include #endif #include "aplinks.h" int get_winsize(int *m_column, int *m_row) { #ifdef UNIX struct winsize ws; ioctl(1, TIOCGWINSZ, &ws); /* fd(0 -> stdin, 1 -> stdout, 2 -> stderr) */ *(m_column) = ws.ws_col; *(m_row) = ws.ws_row; #else *(m_column) = 80; *(m_row) = 25; #endif return 0; }