[lwatch-cvs] files/src settings.c,1.31,1.32 settings.h,1.12,1.13 yparse.l,1.28,1.29
Brought to you by:
arturcz
|
From: Artur R. C. <ar...@us...> - 2005-06-26 21:50:06
|
Update of /cvsroot/lwatch/files/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29599/src Modified Files: settings.c settings.h yparse.l Log Message: First step for syslog support - setting configuration variables. Index: settings.c =================================================================== RCS file: /cvsroot/lwatch/files/src/settings.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** settings.c 16 Feb 2005 14:52:35 -0000 1.31 --- settings.c 26 Jun 2005 21:49:54 -0000 1.32 *************** *** 35,38 **** --- 35,39 ---- #include <stdlib.h> #include <string.h> + #include <syslog.h> #include <unistd.h> *************** *** 146,149 **** --- 147,152 ---- #endif memset(&lw_conf,0,sizeof(lw_conf)); + lw_conf.use_syslog=1; + lw_conf.log_level=LOG_NOTICE; while((c=getopt_long(argc,argv,"vC:f:i:o:Osht",opt,&idx))!=EOF) { switch(c) { Index: settings.h =================================================================== RCS file: /cvsroot/lwatch/files/src/settings.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** settings.h 10 Aug 2004 12:15:20 -0000 1.12 --- settings.h 26 Jun 2005 21:49:54 -0000 1.13 *************** *** 39,42 **** --- 39,44 ---- char out_file[MAXPATHLEN+1]; int show_unparsed; + int use_syslog; + int log_level; int cfg_ver; /* wersja formatu pliku konfiguracyjnego */ #ifdef RESIZE Index: yparse.l =================================================================== RCS file: /cvsroot/lwatch/files/src/yparse.l,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** yparse.l 16 Feb 2005 13:55:08 -0000 1.28 --- yparse.l 26 Jun 2005 21:49:54 -0000 1.29 *************** *** 72,76 **** %option noyywrap nounput ! M_KEYWORD input_file|output_file|show_unparsed|cfg_ver R_KEYCOLOR date_color|host_color|serv_color|mesg_color|color|highlight R_KEYWORD match_service|match_host|ignore|exit --- 72,76 ---- %option noyywrap nounput ! M_KEYWORD input_file|output_file|show_unparsed|cfg_ver|use_syslog|log_level R_KEYCOLOR date_color|host_color|serv_color|mesg_color|color|highlight R_KEYWORD match_service|match_host|ignore|exit *************** *** 105,134 **** <*>{COMMENT} ; /* Skip comments */ <INITIAL>input_file= { yypch=lw_conf.in_file; #ifdef DEBUG strcpy(mymsg,"input_file"); #endif - PUSH(TEXT); } <INITIAL>output_file= { yypch=lw_conf.out_file; #ifdef DEBUG strcpy(mymsg,"output_file"); #endif - PUSH(TEXT); } <INITIAL>show_unparsed= { yyip=&lw_conf.show_unparsed; #ifdef DEBUG strcpy(mymsg,"show_unparsed"); #endif - PUSH(BOOLEAN); } <INITIAL>cfg_ver= { yyip=&lw_conf.cfg_ver; #ifdef DEBUG strcpy(mymsg,"cfg_ver"); #endif ! PUSH(INTEGER); } <INITIAL>date_color= { --- 105,148 ---- <*>{COMMENT} ; /* Skip comments */ <INITIAL>input_file= { + PUSH(TEXT); yypch=lw_conf.in_file; #ifdef DEBUG strcpy(mymsg,"input_file"); #endif } <INITIAL>output_file= { + PUSH(TEXT); yypch=lw_conf.out_file; #ifdef DEBUG strcpy(mymsg,"output_file"); #endif } <INITIAL>show_unparsed= { + PUSH(BOOLEAN); yyip=&lw_conf.show_unparsed; #ifdef DEBUG strcpy(mymsg,"show_unparsed"); #endif } <INITIAL>cfg_ver= { + PUSH(INTEGER); yyip=&lw_conf.cfg_ver; #ifdef DEBUG strcpy(mymsg,"cfg_ver"); #endif ! } ! <INITIAL>use_syslog= { ! PUSH(BOOLEAN); ! yyip=&lw_conf.use_syslog; ! #ifdef DEBUG ! strcpy(mymsg,"use_syslog"); ! #endif ! } ! <INITIAL>log_level= { ! PUSH(INTEGER) ! yyip=&lw_conf.log_level; ! #ifdef DEBUG ! strcpy(mymsg,"log_level"); ! #endif } <INITIAL>date_color= { |