[lwatch-cvs] files/src lwatch.conf,1.12,1.13 settings.c,1.15,1.16 settings.h,1.7,1.8 strpcre.c,1.15,
Brought to you by:
arturcz
|
From: <ar...@us...> - 2003-03-21 15:39:58
|
Update of /cvsroot/lwatch/files/src
In directory sc8-pr-cvs1:/tmp/cvs-serv13746/src
Modified Files:
lwatch.conf settings.c settings.h strpcre.c yparse.l
Log Message:
- support for show_unparsed
- create_fifo doesn't work, removed
Index: lwatch.conf
===================================================================
RCS file: /cvsroot/lwatch/files/src/lwatch.conf,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** lwatch.conf 26 Feb 2003 13:19:43 -0000 1.12
--- lwatch.conf 21 Mar 2003 15:35:50 -0000 1.13
***************
*** 19,24 ****
input_fifo=/tmp/test
# If reading from filename: should I create fifo if it doesn't exist? yes or no
! create_fifo=no
#and below clue of lwatch: configuration rules for message higlighting.
--- 19,34 ----
input_fifo=/tmp/test
+ # NOT SUPPORTED IN THIS RELEASE!
# If reading from filename: should I create fifo if it doesn't exist? yes or no
! # default is no
! # create_fifo=no
! # NOT SUPPORTED IN THIS RELEASE!
!
! # What to do with unprsed lines like:
! # Mar 21 15:45:06 musashi -- MARK --
! # or
! # Mar 21 16:02:58 goofie last message repeated 2 times
! # Default is no
! show_unparsed=no
#and below clue of lwatch: configuration rules for message higlighting.
Index: settings.c
===================================================================
RCS file: /cvsroot/lwatch/files/src/settings.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** settings.c 21 Mar 2003 13:47:30 -0000 1.15
--- settings.c 21 Mar 2003 15:35:51 -0000 1.16
***************
*** 62,67 ****
--- 62,71 ----
" -f, --fifo filename",
"\tread data from named fifo filename instead of " DEF_IN_FILE ",",
+ /*
" -c, --create-fifo",
"\tcreate fifo if does not exist",
+ */
+ " -s, --show-unparsed",
+ "\tshows unparsed lines (like `last message repeated X times')",
" -o, --omit-rc",
"\tdo not read values from cofig file",
***************
*** 97,100 ****
--- 101,105 ----
{"fifo",1,0,'f'},
{"create-fifo",0,0,'c'},
+ {"show-unparsed",0,0,'s'},
{"omit-rc",0,0,'o'},
{"help",0,0,'h'},
***************
*** 111,115 ****
#endif
memset(&lw_conf,0,sizeof(lw_conf));
! while((c=getopt_long(argc,argv,"C:f:coh",opt,&idx))!=EOF) {
switch(c) {
case 'C':
--- 116,120 ----
#endif
memset(&lw_conf,0,sizeof(lw_conf));
! while((c=getopt_long(argc,argv,"C:f:cosh",opt,&idx))!=EOF) {
switch(c) {
case 'C':
***************
*** 137,140 ****
--- 142,151 ----
#ifdef DEBUG
printf("Create fifo if doesn't exist\n");
+ #endif
+ break;
+ case 's':
+ lw_conf.show_unparsed=1;
+ #ifdef DEBUG
+ printf("Shows unparsed lines\n");
#endif
break;
Index: settings.h
===================================================================
RCS file: /cvsroot/lwatch/files/src/settings.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** settings.h 25 Feb 2003 16:24:43 -0000 1.7
--- settings.h 21 Mar 2003 15:35:53 -0000 1.8
***************
*** 38,41 ****
--- 38,42 ----
char fifo_file[MAXPATHLEN+1];
int create_fifo;
+ int show_unparsed;
};
Index: strpcre.c
===================================================================
RCS file: /cvsroot/lwatch/files/src/strpcre.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** strpcre.c 25 Feb 2003 16:30:00 -0000 1.15
--- strpcre.c 21 Mar 2003 15:35:54 -0000 1.16
***************
*** 176,180 ****
(int*)&re_matches,RE_NMATCHES);
if(n<0) {
! printf("%s\n",input);
return;
}
--- 176,180 ----
(int*)&re_matches,RE_NMATCHES);
if(n<0) {
! if(lw_conf.show_unparsed) printf("%s\n",input);
return;
}
Index: yparse.l
===================================================================
RCS file: /cvsroot/lwatch/files/src/yparse.l,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** yparse.l 25 Feb 2003 16:24:45 -0000 1.14
--- yparse.l 21 Mar 2003 15:35:55 -0000 1.15
***************
*** 69,73 ****
%option noyywrap
! M_KEYWORD input_fifo|create_fifo
R_KEYCOLOR date_color|host_color|serv_color|mesg_color|color|highlight
R_KEYWORD match_service|match_host|ignore|exit
--- 69,73 ----
%option noyywrap
! M_KEYWORD input_fifo|create_fifo|show_unparsed
R_KEYCOLOR date_color|host_color|serv_color|mesg_color|color|highlight
R_KEYWORD match_service|match_host|ignore|exit
***************
*** 114,117 ****
--- 114,124 ----
PUSH(BOOLEAN);
}
+ <INITIAL>show_unparsed= {
+ yyip=&lw_conf.show_unparsed;
+ #ifdef DEBUG
+ strcpy(mymsg,"show_unparsed");
+ #endif
+ PUSH(BOOLEAN);
+ }
<INITIAL>date_color= {
PUSH(COLOR);
***************
*** 200,208 ****
<BOOLEAN>{BOOL} {
*yyip=0;
! if(strcasecmp(yytext,"yes")) {
*yyip=1;
}
#ifdef DEBUG
! printf("Set %s to %s\n",mymsg,yytext);
#endif
POP;
--- 207,215 ----
<BOOLEAN>{BOOL} {
*yyip=0;
! if(!strcasecmp(yytext,"yes")) {
*yyip=1;
}
#ifdef DEBUG
! printf("Set %s to %s (%i)\n",mymsg,yytext,*yyip);
#endif
POP;
|