File: gwinsz.c

package info (click to toggle)
haskell-debian 3.64-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 364 kB
  • sloc: haskell: 3,226; ansic: 8; makefile: 3
file content (9 lines) | stat: -rw-r--r-- 185 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
#include <sys/ioctl.h>

unsigned long c_get_window_size(void) {
	struct winsize w;
	if (ioctl (0, TIOCGWINSZ, &w) >= 0)
		return (w.ws_row << 16) + w.ws_col;
	else
		return 0x190050;
}