[lwatch-cvs] files/src config.h.in, 1.17, 1.18 control.c, 1.19, 1.20 control.h, 1.8, 1.9 lwatch.c,
Brought to you by:
arturcz
|
From: Artur R. C. <ar...@us...> - 2009-02-28 16:18:46
|
Update of /cvsroot/lwatch/files/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4009/files/src Modified Files: config.h.in control.c control.h lwatch.c settings.c settings.h strpcre.c Log Message: Remove support for resized window - this is simply b0rken. So, I can close now SF#914518. Index: settings.c =================================================================== RCS file: /cvsroot/lwatch/files/src/settings.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** settings.c 26 Jun 2005 21:49:54 -0000 1.32 --- settings.c 28 Feb 2009 16:18:39 -0000 1.33 *************** *** 106,113 **** " -s, --show-unparsed", "\tshow unparsed lines (like `last message repeated X times')", - #ifdef RESIZE - " -t, --term-cut", - "\tcut lines to terminal width", - #endif " -O, --omit-rc", "\tdo not read values from config file", --- 106,109 ---- *************** *** 131,137 **** {"show-unparsed",0,0,'s'}, {"omit-rc",0,0,'O'}, - #ifdef RESIZE - {"term-cut",0,0,'t'}, - #endif {"help",0,0,'h'}, {0,0,0,0} --- 127,130 ---- *************** *** 193,204 **** #endif break; - #ifdef RESIZE - case 't': - lw_conf.term_cut=1; - #ifdef DEBUG - fprintf(stderr,"Term-cut\n"); - #endif - break; - #endif case 'v': show_licence(); --- 186,189 ---- Index: lwatch.c =================================================================== RCS file: /cvsroot/lwatch/files/src/lwatch.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** lwatch.c 19 Aug 2004 10:23:43 -0000 1.26 --- lwatch.c 28 Feb 2009 16:18:39 -0000 1.27 *************** *** 57,63 **** checkeof=0; - #ifdef RESIZE - win_width=get_term_width(); - #endif parse_options(argc,argv); parse_config(); --- 57,60 ---- Index: config.h.in =================================================================== RCS file: /cvsroot/lwatch/files/src/config.h.in,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** config.h.in 16 Feb 2005 14:52:35 -0000 1.17 --- config.h.in 28 Feb 2009 16:18:39 -0000 1.18 *************** *** 111,117 **** #undef PACKAGE_VERSION - /* Define to 1 if you want to compile with resize support. */ - #undef RESIZE - /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE --- 111,114 ---- Index: settings.h =================================================================== RCS file: /cvsroot/lwatch/files/src/settings.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** settings.h 26 Jun 2005 21:49:54 -0000 1.13 --- settings.h 28 Feb 2009 16:18:39 -0000 1.14 *************** *** 42,48 **** int log_level; int cfg_ver; /* wersja formatu pliku konfiguracyjnego */ - #ifdef RESIZE - int term_cut; - #endif }; --- 42,45 ---- Index: control.h =================================================================== RCS file: /cvsroot/lwatch/files/src/control.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** control.h 11 Mar 2004 23:43:43 -0000 1.8 --- control.h 28 Feb 2009 16:18:39 -0000 1.9 *************** *** 46,53 **** void show_poll_res(int res, struct pollfd *ufds, int n); #endif - #ifdef RESIZE - unsigned short int get_term_width(void); - extern unsigned short int win_width; /* Window width */ - #endif extern int loop; --- 46,49 ---- Index: strpcre.c =================================================================== RCS file: /cvsroot/lwatch/files/src/strpcre.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** strpcre.c 19 Aug 2004 10:30:01 -0000 1.28 --- strpcre.c 28 Feb 2009 16:18:39 -0000 1.29 *************** *** 165,200 **** } - #ifdef RESIZE - char* cut_line(char *output, char *input,int real_len) - { - int to_cut=real_len-win_width, n=strlen(input), m=0; - strncpy(output,input,strlen(input)); - output[strlen(input)]=0; - if (to_cut<1) return output; - while (to_cut>0) { - switch (output[n]) { - case '\n': - case '\0': break; - case '0' ... '9': if (m<2) m++; - else {to_cut--; } - break; - case '^': if (m!=2) to_cut-=m+1; - m=0; - break; - default: to_cut-=m+1; m=0; - break; - } - n--; - } - n+=m; - output[n+1]='^'; - output[n+2]='0'; - output[n+3]='1'; - output[n+4]='\n'; - output[n+5]=0; - return output; - } - #endif - void showline(char *input) { int i,n,ignore; --- 165,168 ---- *************** *** 255,266 **** if(!ignore) { char *cstr; - #ifdef RESIZE - char *cutstr; - #endif int len=strlen(date_s)+strlen(host_s)+strlen(serv_s)+strlen(mesg_s)+17; cstr=(char*)malloc(len); - #ifdef RESIZE - cutstr=(char*)malloc(len); - #endif sprintf(cstr,"^%02i%s^%02i%s^%02i%s^%02i%s^01\n", DATE_COLOR,date_s, --- 223,228 ---- *************** *** 268,280 **** SERV_COLOR,serv_s, MESG_COLOR,mesg_s); - #ifdef RESIZE - if (lw_conf.term_cut) { - cutstr=cut_line(cutstr,cstr,len-hl_num*6-17); - cprintf(cutstr); - } else cprintf(cstr); - free((void*)cutstr); - #else cprintf(cstr); - #endif free((void*)cstr); } --- 230,234 ---- Index: control.c =================================================================== RCS file: /cvsroot/lwatch/files/src/control.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** control.c 12 Jan 2004 21:19:41 -0000 1.19 --- control.c 28 Feb 2009 16:18:39 -0000 1.20 *************** *** 41,62 **** int loop; - #ifdef RESIZE - #include <sys/ioctl.h> - #include <termios.h> - - unsigned short int win_width; /* Window width */ - - unsigned short int get_term_width() { - struct winsize wsz; - unsigned short int retval; - if (ioctl(fileno(stdout),TIOCGWINSZ,&wsz)) wsz.ws_col=80; /* Defaults to 80, if it's not a tty and other errors */ - retval=wsz.ws_col; - #ifdef DEBUG - fprintf(stderr,"Terminal width=%d\n",retval); - #endif - return retval; - } - - #endif void die(const char *s, ...) { --- 41,44 ---- *************** *** 82,91 **** loop=0; break; - #ifdef RESIZE - case SIGWINCH: /* Window resize */ - loop=1; - win_width=get_term_width(); - break; - #endif } #ifdef DEBUG --- 64,67 ---- *************** *** 103,109 **** sig_check(signal(i,&signal_handle),""); } - #ifdef RESIZE - sig_check(signal(SIGWINCH,&signal_handle),""); /* Window resize support */ - #endif } --- 79,82 ---- |