FreeCalypso > hg > freecalypso-reveng
comparison blobstat/output.c @ 294:ff2a6433687f
blobstat: code finished, compiles
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 21 Sep 2019 21:17:29 +0000 |
parents | |
children | 99f72069d867 |
comparison
equal
deleted
inserted
replaced
293:23e5b940cb8b | 294:ff2a6433687f |
---|---|
1 #include <sys/types.h> | |
2 #include <stdio.h> | |
3 #include <stdlib.h> | |
4 #include "struct.h" | |
5 | |
6 extern struct category *category_list; | |
7 | |
8 print_output() | |
9 { | |
10 struct category *p; | |
11 u_long total = 0; | |
12 | |
13 for (p = category_list; p; p = p->next) | |
14 total += p->accum; | |
15 printf("total: 0x%lX (%lu) bytes\n", total, total); | |
16 for (p = category_list; p; p = p->next) | |
17 printf("%s: 0x%lX (%lu) bytes, %u%% of total\n", p->accum, | |
18 p->accum, p->accum * 100 / total); | |
19 return(0); | |
20 } |