[lwatch-cvs] files/src control.c,1.15,1.16 control.h,1.5,1.6 lwatch.c,1.20,1.21 settings.c,1.21,1.22
Brought to you by:
arturcz
|
From: <os...@us...> - 2004-01-11 23:22:14
|
Update of /cvsroot/lwatch/files/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1446/src
Modified Files:
control.c control.h lwatch.c settings.c settings.h
Log Message:
[Unusable changes]
Added --enable_curses configure option.
Added --term-cut lwatch option.
Added SIGWINCH handler.
...
And other preparations for closing "optionaly cut line in xterm" TODO.
Index: control.c
===================================================================
RCS file: /cvsroot/lwatch/files/src/control.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** control.c 4 Apr 2003 21:06:29 -0000 1.15
--- control.c 11 Jan 2004 23:22:11 -0000 1.16
***************
*** 41,44 ****
--- 41,62 ----
int loop;
+ #ifdef CURSES
+ #include <curses.h>
+ #include <term.h>
+
+ int win_width; /* Window width */
+
+ int get_term_width() {
+ int retval;
+ initscr();
+ retval=tgetnum("co");
+ endwin();
+ #ifdef DEBUG
+ printf("Terminal width=%d\n",retval);
+ #endif
+ return retval;
+ }
+
+ #endif
void die(const char *s, ...) {
***************
*** 64,67 ****
--- 82,91 ----
loop=0;
break;
+ #ifdef CURSES
+ case SIGWINCH: /* Window resize */
+ printf("aaa\n");
+ win_width=get_term_width();
+ break;
+ #endif
}
#ifdef DEBUG
***************
*** 79,82 ****
--- 103,109 ----
sig_check(signal(i,&signal_handle),"");
}
+ #ifdef CURSES
+ sig_check(signal(SIGWINCH,&signal_handle),""); /* Window resize support */
+ #endif
}
Index: control.h
===================================================================
RCS file: /cvsroot/lwatch/files/src/control.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** control.h 29 Jun 2002 15:04:37 -0000 1.5
--- control.h 11 Jan 2004 23:22:11 -0000 1.6
***************
*** 48,49 ****
--- 48,50 ----
extern int loop;
+ extern int win_width; /* Window width */
Index: lwatch.c
===================================================================
RCS file: /cvsroot/lwatch/files/src/lwatch.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** lwatch.c 4 Apr 2003 21:06:29 -0000 1.20
--- lwatch.c 11 Jan 2004 23:22:11 -0000 1.21
***************
*** 56,59 ****
--- 56,62 ----
checkeof=0;
+ #ifdef CURSES
+ win_width=get_term_width();
+ #endif
parse_options(argc,argv);
parse_config();
Index: settings.c
===================================================================
RCS file: /cvsroot/lwatch/files/src/settings.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** settings.c 10 Nov 2003 01:15:05 -0000 1.21
--- settings.c 11 Jan 2004 23:22:11 -0000 1.22
***************
*** 105,108 ****
--- 105,112 ----
"\tshows unparsed lines (like `last message repeated X times')",
" -O, --omit-rc",
+ #ifdef CURSES
+ " -t, --term-cut",
+ "\tCut lines to terminal width",
+ #endif
"\tdo not read values from config file",
" -h, --help",
***************
*** 127,130 ****
--- 131,137 ----
{"show-unparsed",0,0,'s'},
{"omit-rc",0,0,'O'},
+ #ifdef CURSES
+ {"term-cut",0,0,'t'}¸
+ #endif
{"help",0,0,'h'},
{0,0,0,0}
***************
*** 194,197 ****
--- 201,212 ----
#endif
break;
+ #ifdef CURSES
+ case 't':
+ lw_conf.term_cut=1;
+ #ifdef DEBUG
+ printf("Term-cut\n");
+ #endif
+ break;
+ #endif
case 'v':
show_licence();
Index: settings.h
===================================================================
RCS file: /cvsroot/lwatch/files/src/settings.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** settings.h 4 Apr 2003 15:11:43 -0000 1.9
--- settings.h 11 Jan 2004 23:22:11 -0000 1.10
***************
*** 40,43 ****
--- 40,44 ----
int create_fifo;
int show_unparsed;
+ int term_cut;
};
|