From 7e5ccec8bf8df4187c161f1e2dab600a434cf515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Sat, 13 Nov 2004 00:53:20 +0000 Subject: Bumped to 2.9.0 * configure.in: Bumped to 2.9.0 * configure.in: * examples/.cvsignore: * examples/Makefile.am: * examples/netlist.c: (main): * features.def: * include/glibtop/Makefile.am: * include/glibtop/command.h: * include/glibtop/netlist.h: * include/glibtop/sysdeps.h: * include/glibtop/union.h: * include/glibtop/version.h: * src/daemon/version.c: * sysdeps/linux/Makefile.am: * sysdeps/linux/netlist.c: (glibtop_init_netlist_s), (glibtop_get_netlist_s): * sysdeps/names/Makefile.am: * sysdeps/names/netlist.c: * sysdeps/solaris/Makefile.am: * sysdeps/solaris/netlist.c: (glibtop_init_netlist_s), (glibtop_get_netlist_s): Added new function glibtop_get_netlist(). Implemented for linux and solaris. Doc needed. --- examples/.cvsignore | 2 ++ examples/Makefile.am | 13 +++++++++++-- examples/netlist.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 examples/netlist.c (limited to 'examples') diff --git a/examples/.cvsignore b/examples/.cvsignore index eb80d17f..f7ec2055 100644 --- a/examples/.cvsignore +++ b/examples/.cvsignore @@ -20,4 +20,6 @@ procargs procargs_static df df_static +netlist +netlist_static diff --git a/examples/Makefile.am b/examples/Makefile.am index b68175c0..45f261cb 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -6,7 +6,7 @@ INCLUDES = @INCLUDES@ DEFS = @DEFS@ -noinst_PROGRAMS = first second pprint procargs df \ +noinst_PROGRAMS = first second pprint procargs df netlist \ mountlist procmap netload sysdeps timings \ @static_targets@ @smp_examples@ @@ -15,7 +15,7 @@ EXTRA_PROGRAMS = first_static second_static \ third third_static smp smp_static \ netload_static sysdeps_static \ timings_static pprint_static procargs_static \ - df_static + df_static netlist_static first_SOURCES = first.c first_LDADD = $(top_builddir)/lib/libgtop-2.0.la @@ -109,3 +109,12 @@ df_static_SOURCES = $(df_SOURCES) df_static_LDADD = $(df_LDADD) df_static_LDFLAGS = -static + +netlist_SOURCES = netlist.c +netlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la + +netlist_static_SOURCES = $(netlist_SOURCES) +netlist_static_LDADD = $(netlist_LDADD) +netlist_static_LDFLAGS = -static + + diff --git a/examples/netlist.c b/examples/netlist.c new file mode 100644 index 00000000..686d733a --- /dev/null +++ b/examples/netlist.c @@ -0,0 +1,46 @@ +/* Copyright (C) 2004 BenoƮt Dejean + This file is part of LibGTop 2.0. + + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include + +#include +#include + + +int main(int argc, char *argv []) +{ + glibtop_netlist buf; + char **devices; + guint32 i; + + glibtop_init(); + + devices = glibtop_get_netlist(&buf); + + for(i = 0; i < buf.number; ++i) + { + printf("net device '%s'\n", devices[i]); + } + + g_strfreev(devices); + + glibtop_close(); + return 0; +} -- cgit v1.2.1