diff options
author | Benoît Dejean <benoit@placenet.org> | 2007-05-19 14:26:11 +0000 |
---|---|---|
committer | Benoît Dejean <bdejean@src.gnome.org> | 2007-05-19 14:26:11 +0000 |
commit | b1acd4461e4d1ab66d781854f8b4af1b3d1bb22b (patch) | |
tree | 23e1a486690fd34b33ecc1cfff33ff5a0873a435 | |
parent | 0e2fe6158c7e96284f5e8497218e968106e96972 (diff) | |
download | libgtop-b1acd4461e4d1ab66d781854f8b4af1b3d1bb22b.tar.gz |
Fixed wd and new simple mem example.
2007-05-19 Benoît Dejean <benoit@placenet.org>
* Makefile.am:
* mem.c: (main):
* wd.c: (main):
Fixed wd and new simple mem example.
svn path=/trunk/; revision=2593
-rw-r--r-- | examples/ChangeLog | 8 | ||||
-rw-r--r-- | examples/Makefile.am | 9 | ||||
-rw-r--r-- | examples/mem.c | 21 | ||||
-rw-r--r-- | examples/wd.c | 4 |
4 files changed, 41 insertions, 1 deletions
diff --git a/examples/ChangeLog b/examples/ChangeLog index b8be2738..ce70977c 100644 --- a/examples/ChangeLog +++ b/examples/ChangeLog @@ -1,3 +1,11 @@ +2007-05-19 Benoît Dejean <benoit@placenet.org> + + * Makefile.am: + * mem.c: (main): + * wd.c: (main): + + Fixed wd and new simple mem example. + 2006-02-27 Benoît Dejean <benoit@placenet.org> * pprint.c: (pprint_get_proc_mem), (main): diff --git a/examples/Makefile.am b/examples/Makefile.am index 28fea5f5..de6e6ef5 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -8,7 +8,7 @@ DEFS = @DEFS@ noinst_PROGRAMS = first second pprint procargs df netlist \ mountlist procmap netload sysdeps timings \ - openfiles smp proclist + openfiles smp proclist mem wd first_SOURCES = first.c first_LDADD = $(top_builddir)/lib/libgtop-2.0.la @@ -51,3 +51,10 @@ openfiles_LDADD = $(top_builddir)/lib/libgtop-2.0.la proclist_SOURCES = proclist.c proclist_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +wd_SOURCES = wd.c +wd_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +mem_SOURCE = mem.c +mem_LDADD = $(top_builddir)/lib/libgtop-2.0.la + diff --git a/examples/mem.c b/examples/mem.c new file mode 100644 index 00000000..63fba3de --- /dev/null +++ b/examples/mem.c @@ -0,0 +1,21 @@ +#include <glibtop.h> +#include <glibtop/mem.h> + +#include <glib.h> +#include <unistd.h> + +int main(int argc, char **argv) +{ + glibtop_mem buf; + + glibtop_init(); + + g_print("%lx\n", glibtop_global_server->features); + + glibtop_get_mem(&buf); + + glibtop_close(); + + return 0; +} + diff --git a/examples/wd.c b/examples/wd.c index 4cb51a3b..353a4662 100644 --- a/examples/wd.c +++ b/examples/wd.c @@ -13,6 +13,8 @@ int main(int argc, char **argv) if (argc < 2 || !(pid = strtoul(argv[1], NULL, 0))) pid = getpid(); + glibtop_init(); + dirs = glibtop_get_proc_wd(&buf, pid); g_print("Process %u:\n" @@ -26,6 +28,8 @@ int main(int argc, char **argv) g_strfreev(dirs); + glibtop_close(); + return 0; } |