2 * SARG Squid Analysis Report Generator http://sarg.sourceforge.net
6 * please look at http://sarg.sourceforge.net/donations.php
8 * http://sourceforge.net/projects/sarg/forums/forum/363374
9 * ---------------------------------------------------------------------
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
27 #include "include/conf.h"
28 #include "include/defs.h"
33 FILE *fp_in
, *fp_ou
, *fp_ip
, *fp_ip2
, *fp_usr
;
35 struct dirent
*direntp
;
36 long long int nnbytes
=0, unbytes
=0, tnbytes
=0, totbytes
=0, totbytes2
=0;
37 long long int totelap
=0, totelap2
=0, nnelap
=0, unelap
=0, tnelap
=0;
38 long long int incache
=0, oucache
=0, tnincache
=0, tnoucache
=0, twork
=0;
40 long long int ntotuser
;
41 long long int userbytes
, userelap
;
42 char arqin
[MAXLEN
], arqou
[MAXLEN
], arqper
[MAXLEN
], arqip
[MAXLEN
];
43 char url
[MAXLEN
], tmsg
[50], csort
[MAXLEN
];
44 char period
[MAXLEN
], usuario
[MAXLEN
], wusuario
[MAXLEN
], u2
[MAXLEN
], duser
[MAXLEN
];
45 char userurl
[1024], userhora
[9], userdia
[9];
46 char user_ip
[MAXLEN
], olduserip
[MAXLEN
], tmp2
[MAXLEN
], tmp3
[MAXLEN
];
47 char denied_report
[255], name2
[MAXLEN
];
51 long long int tnacc
=0, ttnacc
=0, unacc
=0;
52 double perc
=0, perc2
=0, ouperc
=0, inperc
=0;
56 const char txtext
[]=".txt";
60 struct getwordstruct gwarea
;
62 if((ReportType
& REPORT_TYPE_USERS_SITES
) == 0) return;
65 strcat(tmp2
,"/sargtmp.unsort");
68 strcat(tmp3
,"/sargtmp.log");
70 strcpy(arqper
,dirname
);
71 strcat(arqper
,"/sarg-period");
72 if ((fp_in
= fopen(arqper
, "r")) == 0){
73 fprintf(stderr
, "SARG: (html1) %s: %s\n",text
[45],arqper
);
76 if (!fgets(period
,sizeof(period
),fp_in
)) {
77 fprintf(stderr
,"SARG: (html1) read error in %s\n",arqper
);
82 strcpy(arqper
,dirname
);
83 strcat(arqper
,"/sarg-general");
84 if ((fp_in
= fopen(arqper
, "r")) == 0){
85 fprintf(stderr
, "SARG: (html2) %s: %s\n",text
[45],arqper
);
91 while(fgets(buf
,sizeof(buf
),fp_in
)!=NULL
) {
92 if(strncmp(buf
,"TOTAL\t",6) == 0) {
93 getword_start(&gwarea
,buf
);
94 if (getword_skip(MAXLEN
,&gwarea
,'\t')<0 || getword_atoll(<emp
,&gwarea
,'\t')<0) {
95 printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",arqper
);
99 if (getword_atoll(<emp
,&gwarea
,'\t')<0) {
100 printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",arqper
);
104 if (getword_atoll(<emp
,&gwarea
,'\t')<0) {
105 printf("SARG: Maybe you have a broken record or garbage in your %s file (%d).\n",arqper
,__LINE__
);
113 strcpy(arqper
,dirname
);
114 strcat(arqper
,"/sarg-users");
115 if ((fp_in
= fopen(arqper
, "r")) == 0){
116 fprintf(stderr
, "SARG: (html11) %s: %s\n",text
[45],arqper
);
119 if (!fgets(totuser
,sizeof(totuser
),fp_in
)) {
120 fprintf(stderr
,"SARG: (html11) read error in %s\n",arqper
);
124 ntotuser
=my_atoll(totuser
);
125 if (ntotuser
<=0) ntotuser
=1;
128 while ( (direntp
= readdir( dirp
)) != NULL
) {
129 dlen
=strlen(direntp
->d_name
)-(sizeof(txtext
)-1);
130 if (dlen
<0) continue;
131 if(strcmp(direntp
->d_name
+dlen
,txtext
) != 0)
136 if (dlen
>=sizeof(wusuario
)) continue;
137 strncpy(wusuario
,direntp
->d_name
,dlen
);
142 str
=strrchr(wusuario
,'.');
144 strcpy(denied_report
,str
+1);
146 strcpy(denied_report
,wusuario
);
148 if (snprintf(warea
,sizeof(warea
),"%s/%s",dirname
,wusuario
)>=sizeof(warea
)) {
149 fprintf(stderr
,"SARG: destination directory too long: %s/%s\n",dirname
,wusuario
);
154 report_day(wusuario
);
155 greport_day(wusuario
);
157 strcpy(usuario
,wusuario
);
160 strcpy(arqou
,dirname
);
162 strcat(arqou
,usuario
);
164 strcat(arqou
,usuario
);
165 strcat(arqou
,".html");
167 strcat(duser
,"denied_");
168 strcat(arqin
,direntp
->d_name
);
170 if((str
=(char *) strstr(denied_report
, "_")) != (char *) NULL
) {
171 if((str
=(char *) strstr(str
+1, "_")) != (char *) NULL
)
172 fixip(denied_report
);
174 strcat(duser
,denied_report
);
175 strcat(duser
,".html");
176 if(access(duser
, R_OK
) != 0)
177 denied_report
[0]='\0';
183 ip2name(u2
,sizeof(u2
));
185 user_find(name2
, sizeof(name2
), u2
);
187 if(dotinuser
&& strchr(name2
,'_')) {
188 subs(name2
,sizeof(name2
),"_",".");
191 if ((fp_in
= fopen(arqin
, "r")) == 0){
192 fprintf(stderr
, "SARG: (html3) %s: %s\n",text
[45],arqin
);
201 while(fgets(buf
,sizeof(buf
),fp_in
)!=NULL
) {
202 getword_start(&gwarea
,buf
);
203 if (getword_atoll(<emp
,&gwarea
,'\t')<0) {
204 printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",arqin
);
208 if (getword_atoll(<emp
,&gwarea
,'\t')<0) {
209 printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",arqin
);
213 if (getword_skip(MAXLEN
,&gwarea
,'\t')<0 || getword_skip(MAXLEN
,&gwarea
,'\t')<0 ||
214 getword_atoll(<emp
,&gwarea
,'\t')<0) {
215 printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",arqin
);
219 if (getword_atoll(<emp
,&gwarea
,'\t')<0) {
220 printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",arqin
);
224 if (getword_atoll(<emp
,&gwarea
,'\n')<0) {
225 printf("SARG: Maybe you have a broken record or garbage in your %s file (%d).\n",arqin
,__LINE__
);
233 if ((fp_ou
= fopen(arqou
, "w")) == 0){
234 fprintf(stderr
, "SARG: (html5) %s: %s\n",text
[45],arqou
);
238 fputs("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n",fp_ou
);
239 fputs("<html>\n",fp_ou
);
240 fputs("<head>\n",fp_ou
);
241 fprintf(fp_ou
," <meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n",CharSet
);
243 fputs("</head>\n",fp_ou
);
245 fprintf(fp_ou
,"<body style=\"font-family:%s;font-size:%s;background-color:%s; \
246 background-image:url(%s)\">\n",FontFace
,TitleFontSize
,BgColor
,BgImage
);
248 write_logo_image(fp_ou
);
250 if(IndexTree
== INDEX_TREE_DATE
)
251 show_sarg(fp_ou
, "../../../..");
253 show_sarg(fp_ou
, "../..");
255 fputs("<div align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\">\n",fp_ou
);
256 fprintf(fp_ou
,"<tr><th class=\"title\" colspan=\"2\">%s</th></tr>\n",Title
);
258 fprintf(fp_ou
,"<tr><td class=\"header\" colspan=\"2\">%s: %s</td></tr>\n",text
[89],period
);
259 fprintf(fp_ou
,"<tr><td class=\"header\" colspan=\"2\">%s: %s</td></tr>\n",text
[90],name2
);
260 fprintf(fp_ou
,"<tr><td class=\"header\" colspan=\"2\">%s: %s, %s</td></tr>\n",text
[104],UserSortField
,UserSortOrder
);
261 fprintf(fp_ou
,"<tr><td class=\"header3\" colspan=\"2\">%s %s</td></tr>\n",text
[32],text
[55]);
262 fputs("<tr><td></td></tr>\n",fp_ou
);
264 fputs("</table></div>\n",fp_ou
);
265 fputs("<div align=\"center\"><table cellpadding=\"2\" cellspacing=\"1\">\n",fp_ou
);
267 if(denied_report
[0]!='\0') {
268 fprintf(fp_ou
,"<tr><td class=\"header\" colspan=\"11\"><a href=\"denied_%s.html\">%s</a> %s</td></tr>\n",denied_report
,text
[116],text
[55]);
271 fprintf(fp_ou
,"<tr><th></th><th class=\"header\">%s</th>",text
[91]);
273 if((UserReportFields
& USERREPORTFIELDS_CONNECT
) != 0)
274 fprintf(fp_ou
,"<th class=\"header\">%s</th>",text
[92]);
275 if((UserReportFields
& USERREPORTFIELDS_BYTES
) != 0)
276 fprintf(fp_ou
,"<th class=\"header\">%s</th>",text
[93]);
277 if((UserReportFields
& USERREPORTFIELDS_SETYB
) != 0)
278 fprintf(fp_ou
,"<th class=\"header\">%%%s</th>",text
[93]);
279 if((UserReportFields
& USERREPORTFIELDS_IN_CACHE_OUT
) != 0)
280 fprintf(fp_ou
,"<th class=\"header3\" colspan=\"2\">%s-%s-%s</th>",text
[113],text
[114],text
[112]);
281 if((UserReportFields
& USERREPORTFIELDS_USED_TIME
) != 0)
282 fprintf(fp_ou
,"<th class=\"header\">%s</th>",text
[94]);
283 if((UserReportFields
& USERREPORTFIELDS_MILISEC
) != 0)
284 fprintf(fp_ou
,"<th class=\"header\">%s</th>",text
[95]);
285 if((UserReportFields
& USERREPORTFIELDS_PTIME
) != 0)
286 fprintf(fp_ou
,"<th class=\"header\">%%%s</th>",text
[99]);
288 fputs("</tr>\n",fp_ou
);
294 debuga("%s: %s",text
[61],u2
);
296 debuga("%s: %s",text
[61],usuario
);
299 while(fgets(buf
,sizeof(buf
),fp_in
)!=NULL
) {
300 getword_start(&gwarea
,buf
);
301 if (getword_atoll(&twork
,&gwarea
,'\t')<0) {
302 printf("SARG: Maybe you have a broken number of access in your %s file.\n",arqin
);
305 if (getword_atoll(&nnbytes
,&gwarea
,'\t')<0) {
306 printf("SARG: Maybe you have a broken number of bytes in your %s file.\n",arqin
);
309 if (getword(url
,sizeof(url
),&gwarea
,'\t')<0) {
310 printf("SARG: Maybe you have a broken url in your %s file.\n",arqin
);
313 if (getword(tmsg
,sizeof(tmsg
),&gwarea
,'\t')<0) {
314 printf("SARG: Maybe you have a broken status in your %s file.\n",arqin
);
317 if (getword_atoll(&nnelap
,&gwarea
,'\t')<0) {
318 printf("SARG: Maybe you have a broken elapsed time in your %s file.\n",arqin
);
321 if (getword_atoll(&incache
,&gwarea
,'\t')<0) {
322 printf("SARG: Maybe you have a broken in cache column in your %s file.\n",arqin
);
325 if (getword_atoll(&oucache
,&gwarea
,'\n')<0) {
326 printf("SARG: Maybe you have a broken not in cache column in your %s file (%d).\n",arqin
,__LINE__
);
330 if(UserReportLimit
<=0 || count
<=UserReportLimit
) {
333 if(IndexTree
== INDEX_TREE_DATE
)
334 sprintf(tmp6
,"../%s",ImageFile
);
336 strcpy(tmp6
,"../../images");
338 if((ReportType
& REPORT_TYPE_SITE_USER_TIME_DATE
) != 0) {
339 strcpy(ltext110
,text
[110]);
340 for(s
=ltext110
; *s
; ++s
)
342 strcpy(siteind
,urly
);
344 for(z1
=0; str
[z1
]; z1
++) {
345 if(str
[z1
]=='?' || str
[z1
]=='-' || str
[z1
]=='.' || str
[z1
]==':' || str
[z1
]=='/' || str
[z1
]=='\\' || str
[z1
]=='*' ||
346 str
[z1
]=='\'' || str
[z1
]=='\"' || str
[z1
]=='$')
349 fprintf(fp_ou
,"<td class=\"data\"><a href=\"tt%s-%s.html\"><img src=\"%s/datetime.png\" border=\"0\" title=\"%s %s\" alt=\"T\"></a></td>",usuario
,siteind
,tmp6
,ltext110
,text
[55]);
351 fprintf(fp_ou
,"<td class=\"data\"></td>");
355 char *endofhost
=strchr(url
,'/');
356 if (endofhost
) *endofhost
='\0';
360 url_module(url
, module
);
370 fprintf(fp_ou
,"<td class=\"data2\"><span style=\"color:%s;\">%s</span></td>",PrivacyStringColor
,PrivacyString
);
372 if(BlockIt
[0]!='\0') {
373 fprintf(fp_ou
,"<td class=\"data2\"><a href=\"%s%s?url=%s\"><img src=\"%s/sarg-squidguard-block.png\" border=\"0\"></a><a href=\"http://%s\"> %s</a></td>",wwwDocumentRoot
,BlockIt
,urly
,tmp6
,urly
,urly
);
375 fprintf(fp_ou
,"<td class=\"data2\"><a href=\"http://%s\" title=\"%s\">%s</a></td>",urly
,urly
,url
);
378 if((UserReportFields
& USERREPORTFIELDS_CONNECT
) != 0)
379 fprintf(fp_ou
,"<td class=\"data\">%s</td>",fixnum(twork
,1));
380 if((UserReportFields
& USERREPORTFIELDS_BYTES
) != 0)
381 fprintf(fp_ou
,"<td class=\"data\">%s</td>",fixnum(nnbytes
,1));
382 if((UserReportFields
& USERREPORTFIELDS_SETYB
) != 0) {
383 perc
=(tnbytes
) ? nnbytes
* 100. / tnbytes
: 0.;
384 fprintf(fp_ou
,"<td class=\"data\">%3.2lf%%</td>",perc
);
386 if((UserReportFields
& USERREPORTFIELDS_IN_CACHE_OUT
) != 0) {
387 inperc
=(nnbytes
) ? incache
* 100. / nnbytes
: 0.;
388 ouperc
=(nnbytes
) ? oucache
* 100. / nnbytes
: 0.;
389 fprintf(fp_ou
,"<td class=\"data\">%3.2lf%%</td><td class=\"data\">%3.2lf%%</td>",inperc
,ouperc
);
391 if((UserReportFields
& USERREPORTFIELDS_USED_TIME
) != 0)
392 fprintf(fp_ou
,"<td class=\"data\">%s</td>",buildtime(nnelap
));
393 if((UserReportFields
& USERREPORTFIELDS_MILISEC
) != 0)
394 fprintf(fp_ou
,"<td class=\"data\">%s</td>",fixnum2(nnelap
,1));
395 if((UserReportFields
& USERREPORTFIELDS_PTIME
) != 0) {
396 perc2
=(tnelap
) ? nnelap
* 100. / tnelap
: 0.;
397 fprintf(fp_ou
,"<td class=\"data\">%3.2lf%%</td>",perc2
);
400 if(strncmp(tmsg
,"OK",2) != 0)
401 fprintf(fp_ou
,"<td class=\"data\">%s</td>",text
[46]);
403 fputs("</tr>\n",fp_ou
);
410 strcat(arqip
,usuario
);
413 if ((fp_ip
= fopen(arqip
, "r")) == 0){
414 fprintf(stderr
, "SARG: (html6) %s: %s\n",text
[45],arqip
);
418 if ((fp_ip2
= MY_FOPEN(tmp2
, "a")) == 0){
419 fprintf(stderr
, "SARG: (html7) %s: %s\n",text
[45],tmp2
);
423 while(fgets(buf
,sizeof(buf
),fp_ip
)!=NULL
) {
424 if(strstr(buf
,url
) != 0)
431 sprintf(csort
,"sort -n -T \"%s\" -k 1,1 -k 5,5 -o \"%s\" \"%s\"",TempDir
,tmp3
,tmp2
);
432 cstatus
=system(csort
);
433 if (!WIFEXITED(cstatus
) || WEXITSTATUS(cstatus
)) {
434 fprintf(stderr
, "SARG: sort command return status %d\n",WEXITSTATUS(cstatus
));
435 fprintf(stderr
, "SARG: sort command: %s\n",csort
);
439 if ((fp_ip
= MY_FOPEN(tmp3
, "r")) == 0) {
440 fprintf(stderr
, "SARG: (html8) %s: %s\n",text
[45],tmp3
);
446 while(fgets(buf
,sizeof(buf
),fp_ip
)) {
447 getword_start(&gwarea
,buf
);
448 if (getword(user_ip
,sizeof(user_ip
),&gwarea
,'\t')<0) {
449 printf("SARG: Maybe you have a broken user IP in your %s file.\n",tmp3
);
452 if (getword(userurl
,sizeof(userurl
),&gwarea
,'\t')<0) {
453 printf("SARG: Maybe you have a broken user URL in your %s file.\n",tmp3
);
456 if (getword(userdia
,sizeof(userdia
),&gwarea
,'\t')<0) {
457 printf("SARG: Maybe you have a broken day in your %s file.\n",tmp3
);
460 if (getword(userhora
,sizeof(userhora
),&gwarea
,'\t')<0) {
461 printf("SARG: Maybe you have a broken time in your %s file.\n",tmp3
);
464 if (getword_atoll(&userbytes
,&gwarea
,'\t')<0) {
465 printf("SARG: Maybe you have a broken size in your %s file.\n",tmp3
);
468 if (getword_atoll(&userelap
,&gwarea
,'\t')<0) {
469 printf("SARG: Maybe you have a broken elapsed time in your %s file (%d).\n",tmp3
,__LINE__
);
472 if(strcmp(user_ip
,olduserip
) != 0) {
473 my_lltoa(unelap
,val2
,0);
474 sprintf(wwork1
,"%s",fixnum(unbytes
,1));
475 fprintf(fp_ou
,"<tr><td></td><td class=\"data\">%s</td><td></td><td class=\"data\">%s</td><td></td><td></td><td></td><td class=\"data\">%s</td><td class=\"data\">%s</td></tr>\n",olduserip
,wwork1
,buildtime(unelap
),val2
);
477 strcpy(olduserip
,user_ip
);
483 unbytes
=unbytes
+userbytes
;
484 unelap
=unelap
+userelap
;
492 my_lltoa(unelap
,val3
,0);
493 sprintf(wwork1
,"%s",fixnum(unbytes
,1));
494 fprintf(fp_ou
,"<tr><td></td><td class=\"data\">%s</td><td></td><td class=\"data\">%s</td><td></td><td></td><td></td><td class=\"data\">%s</td><td class=\"data\">%s</td></tr>\n",olduserip
,wwork1
,buildtime(unelap
),val3
);
508 if((UserReportFields
& USERREPORTFIELDS_TOTAL
) != 0) {
509 fprintf(fp_ou
,"<tr><th></th><th class=\"header\">%s</th>",text
[107]);
510 if((UserReportFields
& USERREPORTFIELDS_CONNECT
) != 0)
511 fprintf(fp_ou
,"<th class=\"header2\">%s</th>",fixnum(tnacc
,1));
512 if((UserReportFields
& USERREPORTFIELDS_BYTES
) != 0)
513 fprintf(fp_ou
,"<th class=\"header2\">%s</th>",fixnum(tnbytes
,1));
514 if((UserReportFields
& USERREPORTFIELDS_SETYB
) != 0) {
515 perc
=(totbytes
) ? tnbytes
*100. / totbytes
:0.;
516 fprintf(fp_ou
,"<th class=\"header2\">%3.2lf%%</th>",perc
);
518 if((UserReportFields
& USERREPORTFIELDS_IN_CACHE_OUT
) != 0) {
519 inperc
=(tnbytes
) ? tnincache
* 100. / tnbytes
: 0.;
520 ouperc
=(tnbytes
) ? tnoucache
* 100. / tnbytes
: 0.;
521 fprintf(fp_ou
,"<th class=\"header2\">%3.2lf%%</th><th class=\"header2\">%3.2lf%%</th>",inperc
,ouperc
);
523 if((UserReportFields
& USERREPORTFIELDS_USED_TIME
) != 0)
524 fprintf(fp_ou
,"<th class=\"header2\">%s</th>",buildtime(tnelap
));
525 if((UserReportFields
& USERREPORTFIELDS_MILISEC
) != 0)
526 fprintf(fp_ou
,"<th class=\"header2\">%s</th>",fixnum2(tnelap
,1));
527 if((UserReportFields
& USERREPORTFIELDS_PTIME
) != 0) {
528 perc2
=(totelap
) ? tnelap
* 100. / totelap
: 0.;
529 fprintf(fp_ou
,"<th class=\"header2\">%3.2lf%%</th>",perc2
);
531 fputs("</tr>\n",fp_ou
);
534 if(PerUserLimit
> 0) {
535 if(tnbytes
> (PerUserLimit
*1000000)) {
537 if(access(PerUserLimitFile
, R_OK
) == 0) {
538 if((fp_usr
= fopen(PerUserLimitFile
, "r")) == 0) {
539 fprintf(stderr
, "SARG: (html9) %s: %s\n",text
[45],PerUserLimitFile
);
542 while(fgets(tmp6
,sizeof(tmp6
),fp_usr
)!=NULL
) {
544 if(strcmp(tmp6
,u2
) == 0) {
553 if((fp_usr
= fopen(PerUserLimitFile
, "a")) == 0) {
554 fprintf(stderr
, "SARG: (html10) %s: %s\n",text
[45],PerUserLimitFile
);
557 fprintf(fp_usr
,"%s\n",u2
);
561 debuga("%s %s %s (%d MB). %s %s",text
[32],u2
,text
[74],PerUserLimit
,text
[75],PerUserLimitFile
);
571 if ((ReportType
& REPORT_TYPE_TOPUSERS
) != 0 && (UserReportFields
& USERREPORTFIELDS_AVERAGE
) != 0) {
572 totbytes2
=totbytes
/ntotuser
;
573 totelap2
=totelap
/ntotuser
;
575 fprintf(fp_ou
,"<tr><th></th><th class=\"header\">%s</th>",text
[96]);
576 if((UserReportFields
& USERREPORTFIELDS_CONNECT
) != 0)
577 fprintf(fp_ou
,"<th class=\"header2\">%s</th>",fixnum(ttnacc
/ntotuser
,1));
578 if((UserReportFields
& USERREPORTFIELDS_BYTES
) != 0)
579 fprintf(fp_ou
,"<th class=\"header2\">%s</th>",fixnum(totbytes2
,1));
580 fprintf(fp_ou
,"<th></th><th></th><th></th>");
581 if((UserReportFields
& USERREPORTFIELDS_USED_TIME
) != 0)
582 fprintf(fp_ou
,"<th class=\"header2\">%s</th>",buildtime(totelap2
));
583 if((UserReportFields
& USERREPORTFIELDS_MILISEC
) != 0)
584 fprintf(fp_ou
,"<th class=\"header2\">%s</th>",fixnum2(totelap2
,1));
585 if((UserReportFields
& USERREPORTFIELDS_PTIME
) != 0) {
586 perc2
= (totelap
) ? totelap2
* 100. / totelap
: 0.;
587 fprintf(fp_ou
,"<th class=\"header2\">%3.2lf%%</th>",perc2
);
589 fputs("</tr>\n",fp_ou
);
592 fputs("</table></div>\n",fp_ou
);
596 fputs("</body>\n</html>\n",fp_ou
);
603 (void)closedir(dirp
);