Blame examples/netlist.c

Packit d37888
/* Copyright (C) 2004 BenoƮt Dejean
Packit d37888
   This file is part of LibGTop 2.0.
Packit d37888
Packit d37888
Packit d37888
   LibGTop is free software; you can redistribute it and/or modify it
Packit d37888
   under the terms of the GNU General Public License as published by
Packit d37888
   the Free Software Foundation; either version 2 of the License,
Packit d37888
   or (at your option) any later version.
Packit d37888
Packit d37888
   LibGTop is distributed in the hope that it will be useful, but WITHOUT
Packit d37888
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Packit d37888
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
Packit d37888
   for more details.
Packit d37888
Packit d37888
   You should have received a copy of the GNU General Public License
Packit d37888
   along with LibGTop; see the file COPYING. If not, write to the
Packit d37888
   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Packit d37888
   Boston, MA 02110-1301, USA.
Packit d37888
*/
Packit d37888
Packit d37888
#ifdef HAVE_CONFIG_H
Packit d37888
#  include <config.h>
Packit d37888
#endif
Packit d37888
Packit d37888
#include <stdio.h>
Packit d37888
Packit d37888
#include <glibtop.h>
Packit d37888
#include <glibtop/netlist.h>
Packit d37888
Packit d37888
Packit d37888
int main(int argc, char *argv [])
Packit d37888
{
Packit d37888
	glibtop_netlist buf;
Packit d37888
	char **devices;
Packit d37888
	guint32 i;
Packit d37888
Packit d37888
	glibtop_init();
Packit d37888
Packit d37888
	devices = glibtop_get_netlist(&buf;;
Packit d37888
Packit d37888
	for(i = 0; i < buf.number; ++i)
Packit d37888
	{
Packit d37888
		printf("net device '%s'\n", devices[i]);
Packit d37888
	}
Packit d37888
Packit d37888
	g_strfreev(devices);
Packit d37888
Packit d37888
	glibtop_close();
Packit d37888
	return 0;
Packit d37888
}