Added quick example for glibtop_get_proclist() and updated procmap example

* .cvsignore:
	* Makefile.am:
	* proclist.c: (main):
	* procmap.c: (main):

	Added quick example for glibtop_get_proclist()
	and updated procmap example to display smap.
This commit is contained in:
Benoît Dejean
2005-12-12 13:23:54 +00:00
parent aa5ac8fc10
commit 52fa57a39b
5 changed files with 55 additions and 1 deletions

28
examples/proclist.c Normal file
View File

@@ -0,0 +1,28 @@
#include <glibtop.h>
#include <glibtop/proclist.h>
#include <glib.h>
#include <stdio.h>
int main()
{
unsigned *pids;
unsigned i;
glibtop_proclist buf;
glibtop_init();
pids = glibtop_get_proclist(&buf, 0, 0);
for (i = 0; i < buf.number; ++i)
printf("%u ", pids[i]);
putchar('\n');
g_free(pids);
glibtop_close();
return 0;
}