summaryrefslogtreecommitdiff
path: root/include/glibtop
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>1998-07-22 22:56:09 +0000
committerMartin Baulig <martin@src.gnome.org>1998-07-22 22:56:09 +0000
commit954a78f2007b2de71e8fba1078e11cd6c1456afc (patch)
tree66b759f492b68585d01876d7b678f8deb8f5c87a /include/glibtop
parenta90bffbbf66ff569aee93f918c943aad87a37464 (diff)
downloadlibgtop-954a78f2007b2de71e8fba1078e11cd6c1456afc.tar.gz
New file.
1998-07-22 Martin Baulig <martin@home-of-linux.org> * include/glibtop/fsusage.h: New file. * features.def: Added new feature `fsusage'. * sysdeps/common/fsusage.c (glibtop_get_fsusage_s): New function. (get_fs_usage): Declared as `static'. * sysdeps/names/fsusage.c: New file.
Diffstat (limited to 'include/glibtop')
-rw-r--r--include/glibtop/command.h3
-rw-r--r--include/glibtop/fsusage.h90
-rw-r--r--include/glibtop/sysdeps.h6
-rw-r--r--include/glibtop/union.h2
4 files changed, 98 insertions, 3 deletions
diff --git a/include/glibtop/command.h b/include/glibtop/command.h
index 1b7acd7a..ddd00055 100644
--- a/include/glibtop/command.h
+++ b/include/glibtop/command.h
@@ -49,8 +49,9 @@ __BEGIN_DECLS
#define GLIBTOP_CMND_PROC_SEGMENT 17
#define GLIBTOP_CMND_MOUNTLIST 18
+#define GLIBTOP_CMND_FSUSAGE 19
-#define GLIBTOP_MAX_CMND 19
+#define GLIBTOP_MAX_CMND 20
#define _GLIBTOP_PARAM_SIZE 16
diff --git a/include/glibtop/fsusage.h b/include/glibtop/fsusage.h
new file mode 100644
index 00000000..462eb6cd
--- /dev/null
+++ b/include/glibtop/fsusage.h
@@ -0,0 +1,90 @@
+/* $Id$ */
+
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the Gnome Top Library.
+ Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
+
+ The Gnome Top Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The Gnome Top Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef __GLIBTOP_FSUSAGE_H__
+#define __GLIBTOP_FSUSAGE_H__
+
+#include <glibtop.h>
+#include <glibtop/global.h>
+
+__BEGIN_DECLS
+
+#define GLIBTOP_FSUSAGE_BLOCKS 0
+#define GLIBTOP_FSUSAGE_BFREE 1
+#define GLIBTOP_FSUSAGE_BAVAIL 2
+#define GLIBTOP_FSUSAGE_FILES 3
+#define GLIBTOP_FSUSAGE_FFREE 4
+
+#define GLIBTOP_MAX_FSUSAGE 5
+
+typedef struct _glibtop_fsusage glibtop_fsusage;
+
+struct _glibtop_fsusage
+{
+ unsigned long flags,
+ blocks, /* Total blocks. */
+ bfree, /* Free blocks available to superuser. */
+ bavail, /* Free blocks available to non-superuser. */
+ files, /* Total file nodes. */
+ ffree; /* Free file nodes. */
+};
+
+#define glibtop_get_fsusage(fsusage,disk) glibtop_get_fsusage_l(glibtop_global_server, fsusage, disk)
+
+#define glibtop_get_fsusage_r glibtop_get_fsusage_s
+
+extern void glibtop_get_fsusage_l __P((glibtop *, glibtop_fsusage *, const char *));
+
+extern void glibtop_get_fsusage_s __P((glibtop *, glibtop_fsusage *, const char *));
+
+#ifdef HAVE_GUILE
+
+/* You need to link with -lgtop_guile to get this stuff here. */
+
+extern SCM glibtop_guile_get_fsusage __P((SCM));
+
+#endif
+
+#ifdef GLIBTOP_GUILE_NAMES
+
+/* You need to link with -lgtop_guile_names to get this stuff here. */
+
+extern SCM glibtop_guile_names_fsusage __P((void));
+extern SCM glibtop_guile_types_fsusage __P((void));
+extern SCM glibtop_guile_labels_fsusage __P((void));
+extern SCM glibtop_guile_descriptions_fsusage __P((void));
+
+#endif
+
+#ifdef GLIBTOP_NAMES
+
+/* You need to link with -lgtop_names to get this stuff here. */
+
+extern const char *glibtop_names_fsusage [];
+extern const unsigned glibtop_types_fsusage [];
+extern const char *glibtop_labels_fsusage [];
+extern const char *glibtop_descriptions_fsusage [];
+
+#endif
+
+__END_DECLS
+
+#endif
diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h
index 263245d3..b24e549e 100644
--- a/include/glibtop/sysdeps.h
+++ b/include/glibtop/sysdeps.h
@@ -45,8 +45,9 @@ __BEGIN_DECLS
#define GLIBTOP_SYSDEPS_PROC_KERNEL 15
#define GLIBTOP_SYSDEPS_PROC_SEGMENT 16
#define GLIBTOP_SYSDEPS_MOUNTLIST 17
+#define GLIBTOP_SYSDEPS_FSUSAGE 18
-#define GLIBTOP_MAX_SYSDEPS 18
+#define GLIBTOP_MAX_SYSDEPS 19
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
@@ -72,7 +73,8 @@ struct _glibtop_sysdeps
proc_signal, /* glibtop_proc_signal */
proc_kernel, /* glibtop_proc_kernel */
proc_segment, /* glibtop_proc_segment */
- mountlist; /* glibtop_mountlist */
+ mountlist, /* glibtop_mountlist */
+ fsusage; /* glibtop_fsusage */
};
#define glibtop_get_sysdeps(sysdeps) glibtop_get_sysdeps_r(glibtop_global_server,sysdeps)
diff --git a/include/glibtop/union.h b/include/glibtop/union.h
index c8a983f7..b04cf808 100644
--- a/include/glibtop/union.h
+++ b/include/glibtop/union.h
@@ -41,6 +41,7 @@
#include <glibtop/procsegment.h>
#include <glibtop/mountlist.h>
+#include <glibtop/fsusage.h>
__BEGIN_DECLS
@@ -65,6 +66,7 @@ union _glibtop_union
glibtop_proc_kernel proc_kernel;
glibtop_proc_segment proc_segment;
glibtop_mountlist mountlist;
+ glibtop_fsusage fsusage;
};
__END_DECLS