X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_dump.c;h=d8aa83aa58d869ed6cac08bb35026a1558fc9331;hb=a6d79528b4812e8eb3927dba3cdd42e6ca51b287;hp=65697437aee52e3b663d969f877bddffb68f5c3e;hpb=556f0365aa699c7dd4b6b08437f7c667abdf3c42;p=rrdtool.git diff --git a/src/rrd_dump.c b/src/rrd_dump.c index 6569743..d8aa83a 100644 --- a/src/rrd_dump.c +++ b/src/rrd_dump.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.12 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.22 Copyright by Tobi Oetiker, 1997-2007 ***************************************************************************** * rrd_dump Display a RRD ***************************************************************************** @@ -44,7 +44,7 @@ #include "rrd_tool.h" #include "rrd_rpncalc.h" -#ifndef NETWARE +#if !(defined(NETWARE) || defined(WIN32)) extern char *tzname[2]; #endif @@ -71,7 +71,7 @@ rrd_dump(int argc, char **argv) } int -rrd_dump_r(char *filename, char *outname) +rrd_dump_r(const char *filename, char *outname) { unsigned int i,ii,ix,iii=0; time_t now; @@ -115,39 +115,39 @@ rrd_dump_r(char *filename, char *outname) fprintf(out_file, "\t %ld \n\n", rrd.live_head->last_up,somestring); for(i=0;ids_cnt;i++){ - fprintf(out_file, "\t\n"); - fprintf(out_file, "\t\t %s \n",rrd.ds_def[i].ds_nam); - fprintf(out_file, "\t\t %s \n",rrd.ds_def[i].dst); - if (dst_conv(rrd.ds_def[i].dst) != DST_CDEF) { - fprintf(out_file, "\t\t %lu \n",rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt); - if (isnan(rrd.ds_def[i].par[DS_min_val].u_val)){ - fprintf(out_file, "\t\t NaN \n"); - } else { - fprintf(out_file, "\t\t %0.10e \n",rrd.ds_def[i].par[DS_min_val].u_val); - } - if (isnan(rrd.ds_def[i].par[DS_max_val].u_val)){ - fprintf(out_file, "\t\t NaN \n"); - } else { - fprintf(out_file, "\t\t %0.10e \n",rrd.ds_def[i].par[DS_max_val].u_val); - } - } else { /* DST_CDEF */ - char *str; - rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&str); - fprintf(out_file, "\t\t %s \n", str); - free(str); - } - fprintf(out_file, "\n\t\t\n"); - fprintf(out_file, "\t\t %s \n",rrd.pdp_prep[i].last_ds); - if (isnan(rrd.pdp_prep[i].scratch[PDP_val].u_val)){ - fprintf(out_file, "\t\t NaN \n"); - } else { - fprintf(out_file, "\t\t %0.10e \n",rrd.pdp_prep[i].scratch[PDP_val].u_val); - } - fprintf(out_file, "\t\t %lu \n", - rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt); + fprintf(out_file, "\t\n"); + fprintf(out_file, "\t\t %s \n",rrd.ds_def[i].ds_nam); + fprintf(out_file, "\t\t %s \n",rrd.ds_def[i].dst); + if (dst_conv(rrd.ds_def[i].dst) != DST_CDEF) { + fprintf(out_file, "\t\t %lu \n",rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt); + if (isnan(rrd.ds_def[i].par[DS_min_val].u_val)){ + fprintf(out_file, "\t\t NaN \n"); + } else { + fprintf(out_file, "\t\t %0.10e \n",rrd.ds_def[i].par[DS_min_val].u_val); + } + if (isnan(rrd.ds_def[i].par[DS_max_val].u_val)){ + fprintf(out_file, "\t\t NaN \n"); + } else { + fprintf(out_file, "\t\t %0.10e \n",rrd.ds_def[i].par[DS_max_val].u_val); + } + } else { /* DST_CDEF */ + char *str=NULL; + rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&str); + fprintf(out_file, "\t\t %s \n", str); + free(str); + } + fprintf(out_file, "\n\t\t\n"); + fprintf(out_file, "\t\t %s \n",rrd.pdp_prep[i].last_ds); + if (isnan(rrd.pdp_prep[i].scratch[PDP_val].u_val)){ + fprintf(out_file, "\t\t NaN \n"); + } else { + fprintf(out_file, "\t\t %0.10e \n",rrd.pdp_prep[i].scratch[PDP_val].u_val); + } + fprintf(out_file, "\t\t %lu \n", + rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt); - fprintf(out_file, "\t\n\n"); - } + fprintf(out_file, "\t\n\n"); + } fputs("", out_file);