Updated.
* pprint.c: (pprint_get_mountlist), (pprint_get_netload), (pprint_get_uptime), (main): Updated.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
|
||||||
|
|
||||||
|
* pprint.c: (pprint_get_mountlist), (pprint_get_netload),
|
||||||
|
(pprint_get_uptime), (main): Updated.
|
||||||
|
|
||||||
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
|
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
|
||||||
|
|
||||||
* pprint.c: (pprint_get_mountlist): Updated.
|
* pprint.c: (pprint_get_mountlist): Updated.
|
||||||
|
@@ -1,11 +1,6 @@
|
|||||||
#include <glibtop.h>
|
#include <glibtop.h>
|
||||||
|
|
||||||
#include <glibtop/cpu.h>
|
#include <glibtop/union.h>
|
||||||
#include <glibtop/fsusage.h>
|
|
||||||
#include <glibtop/loadavg.h>
|
|
||||||
#include <glibtop/mem.h>
|
|
||||||
#include <glibtop/mountlist.h>
|
|
||||||
#include <glibtop/msg_limits.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -138,7 +133,7 @@ static void pprint_get_mountlist(gboolean allfs)
|
|||||||
printf("\t\t .%lu = { .dev = %#llx,"
|
printf("\t\t .%lu = { .dev = %#llx,"
|
||||||
" .devname = \"%s\","
|
" .devname = \"%s\","
|
||||||
" .mountir = \"%s\","
|
" .mountir = \"%s\","
|
||||||
" .type - \"%s\" }\n",
|
" .type = \"%s\" }\n",
|
||||||
(unsigned long) i, entries[i].dev,
|
(unsigned long) i, entries[i].dev,
|
||||||
entries[i].devname,
|
entries[i].devname,
|
||||||
entries[i].mountdir,
|
entries[i].mountdir,
|
||||||
@@ -173,6 +168,34 @@ static void pprint_get_msg_limits()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void pprint_get_netload(const char *iface)
|
||||||
|
{
|
||||||
|
glibtop_netload buf;
|
||||||
|
|
||||||
|
glibtop_get_netload(&buf, iface);
|
||||||
|
|
||||||
|
HEADER_PPRINT(glibtop_get_netload);
|
||||||
|
FOOTER_PPRINT();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void pprint_get_uptime()
|
||||||
|
{
|
||||||
|
glibtop_uptime buf;
|
||||||
|
|
||||||
|
glibtop_get_uptime(&buf);
|
||||||
|
|
||||||
|
HEADER_PPRINT(glibtop_get_uptime);
|
||||||
|
PPRINT(flags, "%#llx");
|
||||||
|
PPRINT(uptime, "%f");
|
||||||
|
PPRINT(idletime, "%f");
|
||||||
|
PPRINT(boot_time, "%llu");
|
||||||
|
FOOTER_PPRINT();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
pprint_get_cpu();
|
pprint_get_cpu();
|
||||||
@@ -188,5 +211,12 @@ int main()
|
|||||||
|
|
||||||
pprint_get_msg_limits();
|
pprint_get_msg_limits();
|
||||||
|
|
||||||
|
pprint_get_netload("lo");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
pprint_get_uptime();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user