Improved example.

svn path=/trunk/; revision=2758
This commit is contained in:
Benoît Dejean
2008-06-23 22:07:26 +00:00
parent 7f779e078d
commit ce23ce407c

View File

@@ -27,17 +27,22 @@ static void print_fsusage(const char *mountpoint)
}
int main()
int main(int argc, char **argv)
{
glibtop_mountlist buf;
glibtop_mountentry *entries;
size_t i;
glibtop_init();
printf("%-30s %10s %10s %10s %5s %10s %10s\n",
"Filesystem", "Size", "Used", "Avail", "Use%", "Read", "Write");
if (argc > 1) {
while (*++argv)
print_fsusage(*argv);
} else {
glibtop_mountentry *entries;
size_t i;
entries = glibtop_get_mountlist(&buf, TRUE);
for(i = 0; i < buf.number; ++i)
@@ -46,6 +51,7 @@ int main()
}
g_free(entries);
}
glibtop_close();