X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_dump.c;h=c8cc7eef5868f13f3af4c744722a26ec10f172a3;hb=5fc7ff89bdbced9c593c566fea9840a269935dcd;hp=2bac7ffb4b3cd1a8eafc893afc0949bf59bb9198;hpb=a9e69acbc184063dcc0eda6a250ee1b7ae1cbb47;p=rrdtool.git diff --git a/src/rrd_dump.c b/src/rrd_dump.c index 2bac7ff..c8cc7ee 100644 --- a/src/rrd_dump.c +++ b/src/rrd_dump.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.13 Copyright by Tobi Oetiker, 1997-2006 + * RRDtool 1.2.23 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);