pan class="w"> cgit_period{constcharcode;constchar*name;intmax_periods;intcount;/* Convert a tm value to the first day in the period */void(*trunc)(structtm*tm);/* Update tm value to start of next/previous period */void(*dec)(structtm*tm);void(*inc)(structtm*tm);/* Pretty-print a tm value */char*(*pretty)(structtm*tm);};externintcgit_find_stats_period(constchar*expr,structcgit_period**period);externvoidcgit_show_stats(structcgit_context*ctx);#endif /* UI_STATS_H */
ass="n">c='\r';}}returnc;}voidskip_line(FILE*f){intc;while((c=next_char(f))&&c!='\n'&&c!=EOF);}intread_config_line(FILE*f,char*line,constchar**value,intbufsize){inti=0,isname=0;*value=NULL;while(i<bufsize-1){intc=next_char(f);if(!isname&&(c=='#'||c==';')){skip_line(f);continue;}if(!isname&&isspace(c))continue;if(c=='='&&!*value){line[i]=0;*value=&line[i+1];}elseif(c=='\n'&&!isname){i=0;continue;}elseif(c=='\n'||c==EOF){line[i]=0;break;}else{line[i]=c;}isname=1;i++;}line[i+1]=0;returni;}intparse_configfile(constchar*filename,configfile_value_fnfn){staticintnesting;intlen;charline[256];constchar*value;FILE*f;/* cancel deeply nested include-commands */if(nesting>8)return-1;if(!(f=fopen(filename,"r")))return-1;nesting++;while((len=read_config_line(f,line,&value,sizeof(line)))>0)fn(line,value);nesting--;fclose(f);return0;}