From 7cadf4450cfdf3a15affb8423e05b6a4a01028cb Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sat, 12 Sep 1998 17:55:52 +0000 Subject: [PATCH] New file. This is used in guname to fetch as many information about the 1998-09-12 Martin Baulig * include/glibtop/sysinfo.h: New file. This is used in guname to fetch as many information about the system as possible like detailed information about hardware etc. --- ChangeLog | 8 +++-- configure.in | 4 +++ include/glibtop/Makefile.am | 2 +- include/glibtop/sysinfo.h | 62 +++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 include/glibtop/sysinfo.h diff --git a/ChangeLog b/ChangeLog index 45555f82..c2e8bcf2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,15 @@ 1998-09-12 Martin Baulig + * include/glibtop/sysinfo.h: New file. This is used in guname to + fetch as many information about the system as possible like detailed + information about hardware etc. + * configure.in (AM_PATH_GLIB): LibGTop now requires glib. 1998-09-09 Martin Baulig - * include/glibtop/proctime.h (glibtop_proc_time): Added `xcpu_utime' and - `xcpu_stime'. + * include/glibtop/proctime.h (glibtop_proc_time): Added `xcpu_utime' + and `xcpu_stime'. * sysdeps/linux/ChangeLog: New file. diff --git a/configure.in b/configure.in index f9323fdc..e365d050 100644 --- a/configure.in +++ b/configure.in @@ -235,6 +235,10 @@ if test x$build_inodedb = xyes ; then LIBGTOP_INCS="$LIBGTOP_INCS -DGLIBTOP_INODEDB" fi +if test x$libgtop_have_sysinfo = xyes ; then + LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SYSINFO" +fi + LIBGTOP_INCS="$LIBGTOP_INCS $SUPPORTINCS" LIBGTOP_GUILE_LIBS="$LIBGTOP_LIBS" diff --git a/include/glibtop/Makefile.am b/include/glibtop/Makefile.am index dcd3540f..329b8db0 100644 --- a/include/glibtop/Makefile.am +++ b/include/glibtop/Makefile.am @@ -7,4 +7,4 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \ procsegment.h read.h sysdeps.h xmalloc.h global.h \ procsignal.h read_data.h union.h types.h gnuserv.h \ parameter.h mountlist.h fsusage.h procmap.h signal.h \ - inodedb.h + inodedb.h sysinfo.h diff --git a/include/glibtop/sysinfo.h b/include/glibtop/sysinfo.h new file mode 100644 index 00000000..e9922465 --- /dev/null +++ b/include/glibtop/sysinfo.h @@ -0,0 +1,62 @@ +/* $Id$ */ + +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the Gnome Top Library. + Contributed by Martin Baulig , 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_SYSINFO_H__ +#define __GLIBTOP_SYSINFO_H__ + +#include +#include +#include + +#include + +__BEGIN_DECLS + +#define GLIBTOP_SYSINFO_CPUINFO 0 + +#define GLIBTOP_MAX_SYSINFO 1 + +typedef struct _glibtop_sysinfo glibtop_sysinfo; + +typedef struct _glibtop_entry glibtop_entry; + +struct _glibtop_entry +{ + GPtrArray *labels; + GHashTable *values; + GHashTable *descriptions; +}; + +struct _glibtop_sysinfo +{ + u_int64_t flags, ncpu; + glibtop_entry cpuinfo [GLIBTOP_NCPU]; +}; + +#define glibtop_get_sysinfo() glibtop_get_sysinfo_s(glibtop_global_server) + +#define glibtop_get_sysinfo_r glibtop_get_sysinfo_s + +extern glibtop_sysinfo * glibtop_get_sysinfo_s __P((glibtop *)); + +__END_DECLS + +#endif