[lwatch-cvs] files/src lwatch.conf,1.24,1.25 settings.c,1.28,1.29 settings.h,1.11,1.12 yparse.l,1.26
Brought to you by:
arturcz
|
From: Artur R. C. <ar...@us...> - 2004-08-10 12:15:32
|
Update of /cvsroot/lwatch/files/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28084/src Modified Files: lwatch.conf settings.c settings.h yparse.l Log Message: Configuration file is versioned now. Index: settings.c =================================================================== RCS file: /cvsroot/lwatch/files/src/settings.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** settings.c 10 Aug 2004 09:02:10 -0000 1.28 --- settings.c 10 Aug 2004 12:15:20 -0000 1.29 *************** *** 137,141 **** }; int idx,c; - int version=0; /* char *pc; //what I needed it for? */ --- 137,140 ---- *************** *** 254,257 **** --- 253,258 ---- #endif + if(!lw_conf.cfg_ver) fprintf(stderr,"\nWARNING! Not versioned configuration file!\n" + "In the next version it shall be a fatal error.\n\n"); } Index: lwatch.conf =================================================================== RCS file: /cvsroot/lwatch/files/src/lwatch.conf,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** lwatch.conf 10 Aug 2004 09:02:10 -0000 1.24 --- lwatch.conf 10 Aug 2004 12:15:20 -0000 1.25 *************** *** 5,8 **** --- 5,11 ---- # Format of this file is described in manual FIXME + # This configuration file has syntax version 1. + cfg_ver=1 + # Available colors: # black red green brown blue magenta cyan lightgray darkgray brightred Index: settings.h =================================================================== RCS file: /cvsroot/lwatch/files/src/settings.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** settings.h 10 Aug 2004 09:02:10 -0000 1.11 --- settings.h 10 Aug 2004 12:15:20 -0000 1.12 *************** *** 39,42 **** --- 39,43 ---- char out_file[MAXPATHLEN+1]; int show_unparsed; + int cfg_ver; /* wersja formatu pliku konfiguracyjnego */ #ifdef RESIZE int term_cut; Index: yparse.l =================================================================== RCS file: /cvsroot/lwatch/files/src/yparse.l,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** yparse.l 10 Aug 2004 11:24:37 -0000 1.26 --- yparse.l 10 Aug 2004 12:15:20 -0000 1.27 *************** *** 72,76 **** %option noyywrap nounput ! M_KEYWORD input_fifo|input_file|output_file|show_unparsed 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_fifo|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 *************** *** 82,87 **** TEXT [a-zA-Z_0-9/.-]* BOOL yes|no ! %x COLOR REGEXP ERROR SECOND ACTION MULTI TEXT BOOLEAN %% --- 82,88 ---- TEXT [a-zA-Z_0-9/.-]* BOOL yes|no + INTVAL [0-9]* ! %x COLOR REGEXP ERROR SECOND ACTION MULTI TEXT BOOLEAN INTEGER %% *************** *** 127,130 **** --- 128,138 ---- PUSH(BOOLEAN); } + <INITIAL>cfg_ver= { + yyip=&lw_conf.cfg_ver; + #ifdef DEBUG + strcpy(mymsg,"cfg_ver"); + #endif + PUSH(INTEGER); + } <INITIAL>date_color= { PUSH(COLOR); *************** *** 221,224 **** --- 229,243 ---- POP; } + <INTEGER>{INTVAL} { + *yyip=0; + *yyip=strtol(yytext, &yypch, 10); + if(*yypch!='\0') { + die("Error in line %i: '%s' is not valid integer variable.\n",lineno,yytext); + } + #ifdef DEBUG + fprintf(stderr,"Set %s to %s (%i)\n",mymsg,yytext,*yyip); + #endif + POP; + } <MULTI,ACTION>match_service { if(action.match_host) { |