diff options
author | Martin Baulig <martin@home-of-linux.org> | 1999-10-24 15:51:28 +0000 |
---|---|---|
committer | Martin Baulig <martin@src.gnome.org> | 1999-10-24 15:51:28 +0000 |
commit | 3c3dfcd77d0f715a49947a66ac1593c302d503a2 (patch) | |
tree | 60458d15ac833c035b322107a8dcdb1397fc8284 /examples/mountlist.c | |
parent | 0adc3bd9ab9841303361ea250747082d12a4e4b9 (diff) | |
download | libgtop-3c3dfcd77d0f715a49947a66ac1593c302d503a2.tar.gz |
The LibGTop examples have been moved into their own top-level module
1999-10-24 Martin Baulig <martin@home-of-linux.org>
The LibGTop examples have been moved into their own top-level
module libgtop-examples.
* examples/*: Removed.
* configure.in: Removed all checks for the examples.
* libgtop-sysdeps.m4: Removed --with-libgtop-examples parameter.
* Makefile.am: Removed examples from the subdir list.
Diffstat (limited to 'examples/mountlist.c')
-rw-r--r-- | examples/mountlist.c | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/examples/mountlist.c b/examples/mountlist.c deleted file mode 100644 index c0ac1aff..00000000 --- a/examples/mountlist.c +++ /dev/null @@ -1,113 +0,0 @@ -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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 <locale.h> - -#include <glibtop.h> -#include <glibtop/open.h> -#include <glibtop/close.h> -#include <glibtop/xmalloc.h> - -#include <glibtop/parameter.h> - -#include <glibtop/mountlist.h> -#include <glibtop/fsusage.h> - -#ifndef PROFILE_COUNT -#define PROFILE_COUNT 1000 -#endif - -int -main (int argc, char *argv []) -{ - glibtop_fsusage fsusage; - glibtop_mountlist mount_list; - glibtop_mountentry *mount_entries; - unsigned c, index, method, count, port; - char buffer [BUFSIZ]; - - setlocale (LC_ALL, ""); - bindtextdomain (PACKAGE, GTOPLOCALEDIR); - textdomain (PACKAGE); - - glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN); - - glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method)); - - printf ("Method = %d\n", method); - - count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ); - buffer [count] = 0; - - printf ("Command = '%s'\n", buffer); - - count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ); - buffer [count] = 0; - - glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port)); - - printf ("Host = '%s' - %u\n\n", buffer, port); - - printf ("sbrk (0) = %p\n\n", sbrk (0)); - - for (c = 0; c < PROFILE_COUNT; c++) { - mount_entries = glibtop_get_mountlist (&mount_list, 1); - - glibtop_free (mount_entries); - } - - printf ("sbrk (0) = %p\n\n", sbrk (0)); - - mount_entries = glibtop_get_mountlist (&mount_list, 1); - - if (mount_entries == NULL) - _exit (1); - - for (index = 0; index < mount_list.number; index++) - printf ("Mount_Entry: %-30s %-10s %-20s\n", - mount_entries [index].mountdir, - mount_entries [index].type, - mount_entries [index].devname); - - printf ("\n\n%-23s %9s %9s %9s %9s %9s\n\n", - "", "Blocks", "Free", "Avail", "Files", "Free"); - - for (index = 0; index < mount_list.number; index++) { - glibtop_get_fsusage (&fsusage, - mount_entries [index].mountdir); - - printf ("Usage: %-16s %9llu %9llu %9llu %9llu %9llu\n", - mount_entries [index].mountdir, - fsusage.blocks, fsusage.bfree, - fsusage.bavail, fsusage.files, - fsusage.ffree); - } - - glibtop_free (mount_entries); - - printf ("\nsbrk (0) = %p\n\n", sbrk (0)); - - glibtop_close (); - - exit (0); -} |