version 1.7, 2008/12/07 02:56:06 |
version 1.8, 2009/06/04 14:48:07 |
|
|
#include <signal.h> |
#include <signal.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
#include <term.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
|
/* XXX These are defined in term.h and conflict with our variable names */ |
|
#ifdef columns |
|
#undef columns |
|
#endif |
|
|
|
#ifdef lines |
|
#undef lines |
|
#endif |
|
|
#include "engine.h" |
#include "engine.h" |
|
|
#ifndef MIN |
#ifndef MIN |
|
|
field_setup(); |
field_setup(); |
} |
} |
|
|
|
void |
|
resize_term(void) |
|
{ |
|
struct winsize ws; |
|
|
|
if (rawmode) |
|
return; |
|
|
|
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == -1) |
|
return; |
|
|
|
resizeterm(ws.ws_row, ws.ws_col); |
|
|
|
columns = COLS; |
|
lines = LINES; |
|
|
|
maxprint = max_disp; |
|
|
|
if (maxprint == 0 || maxprint > lines - HEADER_LINES) |
|
maxprint = lines - HEADER_LINES; |
|
|
|
clear(); |
|
|
|
field_setup(); |
|
} |
|
|
struct command * |
struct command * |
command_set(struct command *cmd, const char *init) |
command_set(struct command *cmd, const char *init) |
{ |
{ |
|
|
if (gotsig_close) |
if (gotsig_close) |
break; |
break; |
if (gotsig_resize) { |
if (gotsig_resize) { |
if (rawmode == 0) |
resize_term(); |
endwin(); |
|
setup_term(max_disp); |
|
gotsig_resize = 0; |
gotsig_resize = 0; |
need_update = 1; |
need_update = 1; |
} |
} |