diff options
Diffstat (limited to 'app-admin/webalizer/files/output.c.patch')
-rw-r--r-- | app-admin/webalizer/files/output.c.patch | 157 |
1 files changed, 0 insertions, 157 deletions
diff --git a/app-admin/webalizer/files/output.c.patch b/app-admin/webalizer/files/output.c.patch deleted file mode 100644 index 9cf52580223f..000000000000 --- a/app-admin/webalizer/files/output.c.patch +++ /dev/null @@ -1,157 +0,0 @@ ---- output.c.orig 2001-06-15 10:34:24.000000000 +0200 -+++ output.c 2004-07-03 14:32:01.000000000 +0200 -@@ -140,6 +140,26 @@ - - FILE *out_fp; - -+ -+/*********************************************/ -+/* FORMAT_NUM - output format of number */ -+/*********************************************/ -+char * format_num(double in) -+{ -+ static char *jednotky[] = { -+ " B", " kB", " MB", " GB", " TB" -+ }; -+ char **jednotka, *tmp; -+ static char out[100]; -+ for (jednotka = jednotky; in > 1024 && jednotka < jednotky+4; in /= 1024, ++jednotka); -+ snprintf(out, 45, "%.2f", in); -+ for (tmp = out + strlen(out) - 1; tmp > out && *tmp == '0'; *tmp-- = 0); -+ if (*tmp == '.') *tmp = 0; -+ strcat(out, *jednotka); -+ return out; -+} -+ -+ - /*********************************************/ - /* WRITE_HTML_HEAD - output top of HTML page */ - /*********************************************/ -@@ -544,8 +564,8 @@ - "</FONT></TD></TR>\n",msg_h_total, msg_h_visits, t_visit); - /* Total XFer */ - fprintf(out_fp,"<TR><TD WIDTH=380><FONT SIZE=\"-1\">%s</FONT></TD>\n" \ -- "<TD ALIGN=right COLSPAN=2><FONT SIZE=\"-1\"><B>%.0f</B>" \ -- "</FONT></TD></TR>\n",msg_mtot_tx,t_xfer/1024); -+ "<TD ALIGN=right COLSPAN=2><FONT SIZE=\"-1\"><B>%s</B>" \ -+ "</FONT></TD></TR>\n",msg_mtot_tx,format_num(t_xfer)); - fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n"); - /**********************************************/ - /* Unique Sites */ -@@ -620,10 +640,11 @@ - /* Max/Avg KBytes per Day */ - fprintf(out_fp,"<TR>" \ - "<TD><FONT SIZE=\"-1\">%s</FONT></TD>\n" \ -- "<TD ALIGN=right WIDTH=65><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ -- "<TD WIDTH=65 ALIGN=right><FONT SIZE=-1><B>%.0f</B>" \ -- "</FONT></TD></TR>\n",msg_mtot_mkd, -- (t_xfer/1024)/days_in_month,max_xfer/1024); -+ "<TD ALIGN=right WIDTH=65><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n", -+ msg_mtot_mkd,format_num(t_xfer/days_in_month)); -+ fprintf(out_fp,"<TD WIDTH=65 ALIGN=right><FONT SIZE=-1><B>%s</B>" \ -+ "</FONT></TD></TR>\n",format_num(max_xfer)); -+ - fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n"); - /**********************************************/ - /* response code totals */ -@@ -713,9 +734,9 @@ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n", - tm_site[i],PCENT(tm_site[i],t_site)); - fprintf(out_fp,"<TD ALIGN=right>" \ -- "<FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ -+ "<FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD></TR>\n", -- tm_xfer[i]/1024,PCENT(tm_xfer[i],t_xfer)); -+ format_num(tm_xfer[i]),PCENT(tm_xfer[i],t_xfer)); - } - fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n"); - fprintf(out_fp,"</TABLE>\n"); -@@ -801,11 +822,13 @@ - th_page[i]/days_in_month,th_page[i], - PCENT(th_page[i],t_page)); - fprintf(out_fp, -- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ -- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ -+ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n", -+ format_num(th_xfer[i]/days_in_month)); -+ fprintf(out_fp, -+ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD></TR>\n", -- (th_xfer[i]/days_in_month)/1024,th_xfer[i]/1024, -- PCENT(th_xfer[i],t_xfer)); -+ format_num(th_xfer[i]), -+ PCENT(th_xfer[i],t_xfer)); - avg_file += th_file[i]/days_in_month; - avg_xfer+= (th_xfer[i]/days_in_month)/1024; - } -@@ -884,14 +907,15 @@ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%lu</B></FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ -- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ -+ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%lu</B></FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ - "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">", - i+1,hptr->count, - (t_hit==0)?0:((float)hptr->count/t_hit)*100.0,hptr->files, -- (t_file==0)?0:((float)hptr->files/t_file)*100.0,hptr->xfer/1024, -+ (t_file==0)?0:((float)hptr->files/t_file)*100.0, -+ format_num(hptr->xfer), - (t_xfer==0)?0:((float)hptr->xfer/t_xfer)*100.0,hptr->visit, - (t_visit==0)?0:((float)hptr->visit/t_visit)*100.0); - -@@ -1066,12 +1090,12 @@ - "<TD ALIGN=center><FONT SIZE=\"-1\"><B>%d</B></FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%lu</B></FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ -- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n"\ -+ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n"\ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ - "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">", - i+1,uptr->count, - (t_hit==0)?0:((float)uptr->count/t_hit)*100.0, -- uptr->xfer/1024, -+ format_num(uptr->xfer), - (t_xfer==0)?0:((float)uptr->xfer/t_xfer)*100.0); - - if (uptr->flag==OBJ_GRP) -@@ -2036,14 +2060,14 @@ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%lu</B></FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ -- "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%.0f</B></FONT></TD>\n" \ -+ "<TD ALIGN=right><FONT SIZE=\"-1\"><B>%s</B></FONT></TD>\n" \ - "<TD ALIGN=right><FONT SIZE=\"-2\">%3.02f%%</FONT></TD>\n" \ - "<TD ALIGN=left NOWRAP><FONT SIZE=\"-1\">%s</FONT></TD></TR>\n", - i+1,top_ctrys[i]->count, - (t_hit==0)?0:((float)top_ctrys[i]->count/t_hit)*100.0, - top_ctrys[i]->files, - (t_file==0)?0:((float)top_ctrys[i]->files/t_file)*100.0, -- top_ctrys[i]->xfer/1024, -+ format_num(top_ctrys[i]->xfer), - (t_xfer==0)?0:((float)top_ctrys[i]->xfer/t_xfer)*100.0, - top_ctrys[i]->desc); - } -@@ -2402,8 +2426,9 @@ - hist_visit[s_mth]/days_in_month); - fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%lu</FONT></TD>\n", - hist_site[s_mth]); -- fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%.0f</FONT></TD>\n", -- hist_xfer[s_mth]); -+ fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%s</FONT></TD>\n", -+/* hist_xfer[s_mth]);*/ -+ format_num(hist_xfer[s_mth]*1024)); - fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%lu</FONT></TD>\n", - hist_visit[s_mth]); - fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%lu</FONT></TD>\n", -@@ -2422,7 +2447,7 @@ - fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" COLSPAN=6 ALIGN=left>" \ - "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREY,msg_h_totals); - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \ -- "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_xfer); -+ "<FONT SIZE=\"-1\">%s</FONT></TH>\n",GREY,format_num(gt_xfer*1024)); - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \ - "<FONT SIZE=\"-1\">%.0f</FONT></TH>\n",GREY,gt_visits); - fprintf(out_fp,"<TH BGCOLOR=\"%s\" ALIGN=right>" \ |