Return to main.c CVS log | Up to [local] / prex-old / usr / bin / cmdbox |
version 1.1.1.1, 2008/06/03 10:38:46 | version 1.1.1.1.2.1, 2008/08/13 17:12:33 | ||
---|---|---|---|
|
|
||
#include <prex/prex.h> | #include <prex/prex.h> | ||
#include <sys/utsname.h> | #include <sys/utsname.h> | ||
#include <sys/ioctl.h> | |||
#include <limits.h> | #include <limits.h> | ||
#include <ctype.h> | #include <ctype.h> | ||
|
|
||
#include <stdlib.h> | #include <stdlib.h> | ||
#include <stdio.h> | #include <stdio.h> | ||
#include <libgen.h> | #include <libgen.h> | ||
#include <termios.h> | |||
#include "cmdbox.h" | #include "cmdbox.h" | ||
|
|
||
/* Get screen size */ | /* Get screen size */ | ||
maxcol = 80; | maxcol = 80; | ||
if (ioctl(fileno(stderr), TIOCGWINSZ, (u_long)&ws) == 0) | if (ioctl(fileno(stderr), TIOCGWINSZ, &ws) == 0) | ||
maxcol = (int)ws.ws_col; | maxcol = (int)ws.ws_col; | ||
if (maxcol < 80) | if (maxcol < 80) | ||
maxcol -= 15; | maxcol -= 15; |