Compare commits
9 Commits
linux_daem
...
LIBGTOP_ST
Author | SHA1 | Date | |
---|---|---|---|
|
321f5180f7 | ||
|
d9874dca81 | ||
|
0d744987ff | ||
|
e6b544af80 | ||
|
266d62bc3c | ||
|
4c3fb58e3e | ||
|
223f986205 | ||
|
ec0d751472 | ||
|
005eaa8e95 |
26
.cvsignore
Normal file
26
.cvsignore
Normal file
@@ -0,0 +1,26 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
alpha-dec-osf1
|
||||
autoh31167
|
||||
config.cache
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
gtopConf.sh
|
||||
i386-bsdi
|
||||
i686-pc-linux-gnu
|
||||
intl
|
||||
libgtop-0.01.tar.gz
|
||||
libgtop-mirror.sh.swp
|
||||
libgtopConf.sh
|
||||
libtool
|
||||
ltconfig
|
||||
ltmain.sh
|
||||
macros
|
||||
stamp-h
|
||||
sun4
|
||||
sun4sol2
|
||||
support
|
225
ABOUT-NLS
Normal file
225
ABOUT-NLS
Normal file
@@ -0,0 +1,225 @@
|
||||
Notes on the Free Translation Project
|
||||
*************************************
|
||||
|
||||
Free software is going international! The Free Translation Project
|
||||
is a way to get maintainers of free software, translators, and users all
|
||||
together, so that will gradually become able to speak many languages.
|
||||
A few packages already provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
||||
assume that the distributed package does use GNU `gettext' internally,
|
||||
itself available at your nearest GNU archive site. But you do *not*
|
||||
need to install GNU `gettext' prior to configuring, installing or using
|
||||
this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
available translations. They tell how people wanting to contribute and
|
||||
work at translations should contact the appropriate team.
|
||||
|
||||
When reporting bugs in the `intl/' directory or bugs which may be
|
||||
related to internationalization, you should tell about the version of
|
||||
`gettext' which is used. The information can be found in the
|
||||
`intl/VERSION' file, in internationalized packages.
|
||||
|
||||
One advise in advance
|
||||
=====================
|
||||
|
||||
If you want to exploit the full power of internationalization, you
|
||||
should configure it using
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in the
|
||||
operating system where this package is being installed. So far, only
|
||||
the `gettext' implementation in the GNU C library version 2 provides as
|
||||
many features (such as locale alias or message inheritance) as the
|
||||
implementation here. It is also not possible to offer this additional
|
||||
functionality on top of a `catgets' implementation. Future versions of
|
||||
GNU `gettext' will very likely convey even more functionality. So it
|
||||
might be a good idea to change to GNU `gettext' as soon as possible.
|
||||
|
||||
So you need not provide this option if you are using GNU libc 2 or
|
||||
you have installed a recent copy of the GNU gettext package with the
|
||||
included `libintl'.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
|
||||
By default, this package will be installed to allow translation of
|
||||
messages. It will automatically detect whether the system provides
|
||||
usable `catgets' (if using this is selected by the installer) or
|
||||
`gettext' functions. If neither is available, the GNU `gettext' own
|
||||
library will be used. This library is wholly contained within this
|
||||
package, usually in the `intl/' subdirectory, so prior installation of
|
||||
the GNU `gettext' package is *not* required. Installers may use
|
||||
special options at configuration time for changing the default
|
||||
behaviour. The commands:
|
||||
|
||||
./configure --with-included-gettext
|
||||
./configure --with-catgets
|
||||
./configure --disable-nls
|
||||
|
||||
will respectively bypass any pre-existing `catgets' or `gettext' to use
|
||||
the internationalizing routines provided within this package, enable
|
||||
the use of the `catgets' functions (if found on the locale system), or
|
||||
else, *totally* disable translation of messages.
|
||||
|
||||
When you already have GNU `gettext' installed on your system and run
|
||||
configure without an option for your new package, `configure' will
|
||||
probably detect the previously built and installed `libintl.a' file and
|
||||
will decide to use this. This might be not what is desirable. You
|
||||
should use the more recent version of the GNU `gettext' library. I.e.
|
||||
if the file `intl/VERSION' shows that the library which comes with this
|
||||
package is more recent, you should use
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to prevent auto-detection.
|
||||
|
||||
By default the configuration process will not test for the `catgets'
|
||||
function and therefore they will not be used. The reasons are already
|
||||
given above: the emulation on top of `catgets' cannot provide all the
|
||||
extensions provided by the GNU `gettext' library. If you nevertheless
|
||||
want to use the `catgets' functions use
|
||||
|
||||
./configure --with-catgets
|
||||
|
||||
to enable the test for `catgets' (this causes no harm if `catgets' is
|
||||
not available on your system). If you really select this option we
|
||||
would like to hear about the reasons because we cannot think of any
|
||||
good one ourself.
|
||||
|
||||
Internationalized packages have usually many `po/LL.po' files, where
|
||||
LL gives an ISO 639 two-letter code identifying the language. Unless
|
||||
translations have been forbidden at `configure' time by using the
|
||||
`--disable-nls' switch, all available translations are installed
|
||||
together with the package. However, the environment variable `LINGUAS'
|
||||
may be set, prior to configuration, to limit the installed set.
|
||||
`LINGUAS' should then contain a space separated list of two-letter
|
||||
codes, stating which languages are allowed.
|
||||
|
||||
Using This Package
|
||||
==================
|
||||
|
||||
As a user, if your language has been installed for this package, you
|
||||
only have to set the `LANG' environment variable to the appropriate
|
||||
ISO 639 `LL' two-letter code prior to using the programs in the
|
||||
package. For example, let's suppose that you speak German. At the
|
||||
shell prompt, merely execute `setenv LANG de' (in `csh'),
|
||||
`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
|
||||
can be done from your `.login' or `.profile' file, once and for all.
|
||||
|
||||
An operating system might already offer message localization for
|
||||
many of its programs, while other programs have been installed locally
|
||||
with the full capabilities of GNU `gettext'. Just using `gettext'
|
||||
extended syntax for `LANG' would break proper localization of already
|
||||
available operating system programs. In this case, users should set
|
||||
both `LANGUAGE' and `LANG' variables in their environment, as programs
|
||||
using GNU `gettext' give preference to `LANGUAGE'. For example, some
|
||||
Swedish users would rather read translations in German than English for
|
||||
when Swedish is not available. This is easily accomplished by setting
|
||||
`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the Free Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
Each translation team has its own mailing list, courtesy of Linux
|
||||
International. You may reach your translation team at the address
|
||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
||||
language. Language codes are *not* the same as the country codes given
|
||||
in ISO 3166. The following translation teams exist, as of August 1997:
|
||||
|
||||
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
|
||||
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
|
||||
`hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
|
||||
Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
|
||||
`pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
|
||||
Swedish `sv', and Turkish `tr'.
|
||||
|
||||
For example, you may reach the Chinese translation team by writing to
|
||||
`zh@li.org'.
|
||||
|
||||
If you'd like to volunteer to *work* at translating messages, you
|
||||
should become a member of the translating team for your own language.
|
||||
The subscribing address is *not* the same as the list itself, it has
|
||||
`-request' appended. For example, speakers of Swedish can send a
|
||||
message to `sv-request@li.org', having this message body:
|
||||
|
||||
subscribe
|
||||
|
||||
Keep in mind that team members are expected to participate
|
||||
*actively* in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `translation@iro.umontreal.ca' to reach the
|
||||
coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology in use. Proven linguistic skill are praised more than
|
||||
programming skill, here.
|
||||
|
||||
Available Packages
|
||||
==================
|
||||
|
||||
Languages are not equally supported in all packages. The following
|
||||
matrix shows the current state of internationalization, as of August
|
||||
1997. The matrix shows, in regard of each package, for which languages
|
||||
PO files have been submitted to translation coordination.
|
||||
|
||||
Ready PO files cs da de en es fi fr it ja ko nl no pl pt sl sv
|
||||
.-------------------------------------------------.
|
||||
bash | [] [] [] | 3
|
||||
bison | [] [] [] | 3
|
||||
clisp | [] [] [] [] | 4
|
||||
cpio | [] [] [] [] [] | 5
|
||||
diffutils | [] [] [] [] [] | 5
|
||||
enscript | [] [] [] [] [] [] | 6
|
||||
fileutils | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
findutils | [] [] [] [] [] [] [] [] | 8
|
||||
flex | [] [] [] [] | 4
|
||||
gcal | [] [] [] [] [] | 5
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] | 11
|
||||
grep | [] [] [] [] [] [] [] [] [] | 9
|
||||
hello | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
id-utils | [] [] [] | 3
|
||||
indent | [] [] [] [] | 4
|
||||
libc | [] [] [] [] [] [] [] | 7
|
||||
m4 | [] [] [] [] [] | 5
|
||||
make | [] [] [] [] [] [] | 6
|
||||
music | [] [] | 2
|
||||
ptx | [] [] [] [] [] [] [] [] | 8
|
||||
recode | [] [] [] [] [] [] [] [] [] | 9
|
||||
sh-utils | [] [] [] [] [] [] [] | 7
|
||||
sharutils | [] [] [] [] [] | 5
|
||||
tar | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
texinfo | [] | 1
|
||||
textutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
||||
`-------------------------------------------------'
|
||||
16 languages cs da de en es fi fr it ja ko nl no pl pt sl sv
|
||||
27 packages 3 2 24 1 17 1 26 2 1 11 20 9 19 7 7 17 167
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
used for implementing regional variants of languages, or language
|
||||
dialects.
|
||||
|
||||
For a PO file in the matrix above to be effective, the package to
|
||||
which it applies should also have been internationalized and
|
||||
distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
distribution.
|
||||
|
||||
If August 1997 seems to be old, you may fetch a more recent copy of
|
||||
this `ABOUT-NLS' file on most GNU archive sites.
|
||||
|
95
ANNOUNCE
Normal file
95
ANNOUNCE
Normal file
@@ -0,0 +1,95 @@
|
||||
Hi all,
|
||||
|
||||
I just uploaded the first working draft alpha version 0.01 to my website:
|
||||
|
||||
http://www.home-of-linux.org/gnome/libgtop/
|
||||
|
||||
Libgtop is a library that fetches information about the running system such as cpu and
|
||||
memory usage, active processes etc. On Linux systems, these information are taken directly
|
||||
from the /proc filesystem. For other systems such as Solaris, where such programs need to be
|
||||
suid root (or only setgid kmem/mem on some systems), it provides a suid/setgid server that
|
||||
fetches those information and a client-side library that talks to this server. Main idea
|
||||
was to have the same interface for all operating systems, thus all system dependent details
|
||||
are hidden in the implementation of that server.
|
||||
|
||||
Currently, it only works for Linux, documentation on how to port it to other systems is on
|
||||
the way. I'm planning to keep this site an up-to-date mirror of my local machine (which is
|
||||
connected to the internet over some expensive dialup connection, so I'll upload it about
|
||||
once every day I made significant changes) so that you can always find the latest version
|
||||
of the software here.
|
||||
|
||||
I've written a simple guile interface for the library to show which information it can
|
||||
already fetch. See examples/third for details.
|
||||
|
||||
===========================================================================================
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.h>
|
||||
|
||||
#include <glibtop/cpu.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop server;
|
||||
glibtop_cpu cpu;
|
||||
unsigned i, *ptr;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
glibtop_open (&server, argv [0]);
|
||||
|
||||
glibtop_get_cpu (&server, &cpu);
|
||||
|
||||
fprintf (stderr, "CPU: %lu, %lu, %lu, %lu, %lu\n",
|
||||
cpu.total, cpu.user, cpu.nice, cpu.sys, cpu.idle);
|
||||
|
||||
glibtop_close (&server);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
===========================================================================================
|
||||
|
||||
The following scheme code is used in examples/third to show all information that is
|
||||
currently available:
|
||||
|
||||
(display (get-cpu)) (newline)
|
||||
(display (get-mem)) (newline)
|
||||
(display (get-swap)) (newline)
|
||||
(display (get-uptime)) (newline)
|
||||
(display (get-loadavg)) (newline)
|
||||
(display (get-shm_limits)) (newline)
|
||||
(display (get-msg_limits)) (newline)
|
||||
(display (get-sem_limits)) (newline)
|
||||
(display (get-sysdeps)) (newline)
|
||||
(display (get-proclist)) (newline)
|
||||
|
||||
On my system, this yields:
|
||||
|
||||
(3796245 348706 66 89999 3357474)
|
||||
(31715328 31354880 360448 13385728 401408 7237632 17567744)
|
||||
(133885952 42160128 91725824)
|
||||
(37962.49 33574.74)
|
||||
(0.01 0.02 0.0)
|
||||
(33554432 1 128 128 4194304)
|
||||
(2048 16384 4056 16384 128 16 16384)
|
||||
(4096 128 4096 4096 32 32 32 20 32767 16383)
|
||||
(31 127 7 3 1 31 127 1023 3)
|
||||
(71 4 284 1 2 3 246 247 210 8 48 81 83 153 157 167 170 171 172 173 174 175 178 181 195 191 200 203 207 248 215 216 217 220 222 227 245 249 250 251 253 254 315 267 331 373 338 334 335 345 337 372 374 342 343 344 375 14445 13119 6438 14555 13118 13801 6439 17362 18411 18455 6521 6522 6523 23979 23980 7905 7906)
|
||||
|
||||
===========================================================================================
|
||||
|
||||
Better documentation is on the way! There's still a little bit under the URL above.
|
||||
|
||||
Enjoy it!
|
||||
|
||||
Martin <martin@home-of-linux.org>
|
||||
|
||||
|
||||
|
||||
|
||||
|
2
AUTHORS
2
AUTHORS
@@ -1,3 +1 @@
|
||||
Martin Baulig (martin@home-of-linux.org)
|
||||
Drazen Kacar (dave@srce.hr)
|
||||
Benoît Dejean (tazforever@dlfp.org)
|
||||
|
@@ -1 +0,0 @@
|
||||
Benoît Dejean (benoit@placenet.org)
|
68
Makefile.am
68
Makefile.am
@@ -1,35 +1,53 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
if EXAMPLES
|
||||
EXAMPLES_DIR = examples
|
||||
else
|
||||
EXAMPLES_DIR =
|
||||
if GLIBTOP_EXAMPLES
|
||||
examples_SUBDIRS = examples
|
||||
endif
|
||||
|
||||
SUBDIRS = po misc include sysdeps lib src $(EXAMPLES_DIR) doc
|
||||
built_SUBDIRS = include sysdeps src lib
|
||||
|
||||
libgtopinclude_HEADERS = glibtop.h libgtopconfig.h
|
||||
libgtopincludedir = $(includedir)/libgtop-2.0
|
||||
SUBDIRS = po intl macros $(built_SUBDIRS) $(examples_SUBDIRS)
|
||||
|
||||
EXTRA_DIST = autogen.sh libgtop.spec.in copyright.txt \
|
||||
features.def libgtopconfig.h.in \
|
||||
libgtop-sysdeps.m4 README \
|
||||
libgtop-2.0.pc.in acinclude.m4 \
|
||||
intltool-extract.in \
|
||||
intltool-merge.in \
|
||||
intltool-update.in
|
||||
DIST_SUBDIRS = po intl macros include sysdeps src lib examples
|
||||
|
||||
DISTCLEANFILES = \
|
||||
intltool-extract \
|
||||
intltool-merge \
|
||||
intltool-update
|
||||
include_HEADERS = glibtop.h
|
||||
|
||||
dist-hook:
|
||||
cp libgtop.spec $(distdir)
|
||||
EXTRA_DIST = autogen.sh libgtop.spec copyright.txt libgtopConf.sh.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libgtop-2.0.pc
|
||||
release:
|
||||
$(MAKE) dist distdir=$(PACKAGE)$(VERSION)
|
||||
|
||||
libgtop-features.def: features.def
|
||||
@LN_S@ $< $@
|
||||
## Put `exec' in the name because this should be installed by
|
||||
## `install-exec', not `install-data'.
|
||||
confexecdir=$(libdir)
|
||||
confexec_DATA = $(top_builddir)/libgtopConf.sh
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
|
||||
## to automatically rebuild aclocal.m4 if any of the macros in
|
||||
## `macros/' change
|
||||
@MAINT@include macros/macros.dep
|
||||
@MAINT@macros/macros.dep: macros/Makefile.am
|
||||
@MAINT@ cd macros && $(MAKE) macros.dep
|
||||
|
||||
## We create libgtopConf.sh here and not from configure because we want
|
||||
## to get the paths expanded correctly. Macros like srcdir are given
|
||||
## the value NONE in configure if the user doesn't specify them (this
|
||||
## is an autoconf feature, not a bug).
|
||||
libgtopConf.sh: libgtopConf.sh.in Makefile
|
||||
## Use sed and then mv to avoid problems if the user interrupts.
|
||||
sed -e 's,\@LIBGTOP_LIBDIR\@,$(libdir),g' \
|
||||
-e 's,\@LIBGTOP_INCLUDEDIR\@,$(includedir),g' \
|
||||
-e 's,\@LIBGTOP_LIBS\@,$(LIBGTOP_LIBS),g' \
|
||||
-e 's,\@LIBGTOP_INCS\@,$(LIBGTOP_INCS),g' \
|
||||
-e 's,\@LIBGTOP_GUILE_LIBS\@,$(LIBGTOP_GUILE_LIBS),g' \
|
||||
-e 's,\@LIBGTOP_GUILE_INCS\@,$(LIBGTOP_GUILE_INCS),g' \
|
||||
-e 's,\@LIBGTOP_BINDIR\@,$(LIBGTOP_BINDIR),g' \
|
||||
-e 's,\@LIBGTOP_SERVER\@,$(LIBGTOP_SERVER),g' \
|
||||
-e 's,\@libgtop_sysdeps_dir\@,$(libgtop_sysdeps_dir),g' \
|
||||
-e 's,\@libgtop_need_server\@,$(libgtop_need_server),g' \
|
||||
-e 's,\@libgtop_use_machine_h\@,$(libgtop_use_machine_h),g' \
|
||||
-e 's,\@libgtop_guile_found\@,$(libgtop_guile_found),g' \
|
||||
-e 's,\@libgtop_want_names\@,$(libgtop_want_names),g' \
|
||||
-e 's,\@libgtop_want_guile_names\@,$(libgtop_want_guile_names),g' \
|
||||
-e 's,\@libgtop_want_examples\@,$(libgtop_want_examples),g' \
|
||||
< $(srcdir)/libgtopConf.sh.in > libgtopConf.tmp \
|
||||
&& mv libgtopConf.tmp libgtopConf.sh
|
||||
|
375
NEWS
375
NEWS
@@ -1,320 +1,133 @@
|
||||
18 June 2007: Overview of changes in 2.19.4
|
||||
===========================================
|
||||
* solaris:
|
||||
- fixed build. Damien Carbery.
|
||||
|
||||
3 June 2007: Overview of changes in 2.19.3
|
||||
==========================================
|
||||
* Small API change. get_proclist returns pid_t instead of unsigned
|
||||
for consistency.
|
||||
* linux:
|
||||
- fixed an typo bug in open_files.
|
||||
- got rid of useless glibtop_init_s calls.
|
||||
* Enable example build by defaut.
|
||||
* Dropped G_GNUC_INTERNAL attributes no longer needed.
|
||||
This will please people trying to implement G_GNUC macro with a non
|
||||
GNU Compiler.
|
||||
|
||||
13 May 2007: Overview of changes in 2.19.2
|
||||
==========================================
|
||||
* This is the first release of the 2.19.x series.
|
||||
* Got rid of inodedb (you don't even know what it is ;)
|
||||
* New unstable API glibtop_get_proc_wd to get working directories of
|
||||
a process.
|
||||
* Fixed OpenBSD build. Jasper Lievisse Adriaanse.
|
||||
|
||||
25 February 2007: Overview of changes in 2.14.8
|
||||
===============================================
|
||||
* bsd implementations have been splitted by Joe Marcus Clarke
|
||||
and Alexander Nedotsukov. (k)freeBSD now has a separate implementation.
|
||||
|
||||
February 10, 2007: Overview of changes in 2.14.7
|
||||
================================================
|
||||
* bsd:
|
||||
- massive kfreeBSD and FreeBSD updates by Roy Marples and Petr Salinger.
|
||||
* mountlist can now ignore objfs and ctfs filesystems.
|
||||
* fsusage won't return bavail > bfree anymore.
|
||||
|
||||
January 14, 2007: Overview of changes in 2.14.6
|
||||
===============================================
|
||||
* linux:
|
||||
- fixed stack overflow in glibtop_get_proc_map
|
||||
- fixed handling of long filenames in glibtop_get_proc_map and glibtop_get_proc_open_files.
|
||||
- micro-optimization
|
||||
|
||||
December 3, 2006: Overview of changes in 2.14.5
|
||||
===============================================
|
||||
* Added kfreebsd support (Petr Salinger <Petr.Salinger@seznam.cz>).
|
||||
* Added solaris glibtop_get_proc_open_files (Henry Zhang <hua.zhang@sun.com>).
|
||||
* Migrated to gtk-doc (Germán Poó-Caamaño <gpoo@ubiobio.cl>).
|
||||
* glibtop_get_mountlist can now ignore nsfd FS.
|
||||
|
||||
September 16, 2006: Overview of changes in 2.14.4
|
||||
=================================================
|
||||
* Fixed linux maps/smaps parsing on 64bit kernel.
|
||||
|
||||
September 5, 2006: Overview of changes in 2.14.3
|
||||
================================================
|
||||
* Fixed build with --as-needed.
|
||||
* Added missing G_BEGIN_DECLS/G_END_DECLS.
|
||||
|
||||
July 27, 2006: Overview of changes in 2.14.2
|
||||
============================================
|
||||
* Updated solaris support (hua.zhang@sun.com)
|
||||
* Small linux updates and improvments.
|
||||
|
||||
April 10, 2006: Overview of changes in 2.14.1
|
||||
=============================================
|
||||
* Updated translations.
|
||||
* Fixed NetBSD port (Julio M. Merino Vidal <jmmv@NetBSD.org>).
|
||||
* Fixed some warnings.
|
||||
|
||||
Mars 13, 2006: Overview of changes in 2.14.0
|
||||
============================================
|
||||
* Updated translations.
|
||||
|
||||
February 27, 2006: Overview of changes in 2.13.92
|
||||
=================================================
|
||||
* Fixed proc_state documentation.
|
||||
* Updated mountlist ignore list.
|
||||
|
||||
January 23, 2006: Overview of changes in 2.13.3
|
||||
===============================================
|
||||
* linux:
|
||||
- fixe get_procmap for linux < 2.6.14.
|
||||
|
||||
January 2, 2006: Overview of changes in 2.13.2
|
||||
==============================================
|
||||
* Fixed libtool versioning (James Henstridge)
|
||||
|
||||
December 15, 2005: Overview of changes in 2.13.1
|
||||
================================================
|
||||
* linux:
|
||||
- fixed proclist
|
||||
- implemented server->real_ncpu
|
||||
|
||||
December 13, 2005: Overview of changes in 2.13.0
|
||||
================================================
|
||||
* Requires automake-1.9 (James Henstridge)
|
||||
* Supports up to 32 CPU
|
||||
* Supports Linux smaps
|
||||
* linux: fixed SMP detection
|
||||
|
||||
This release is not ABI compatible with previous releases. Sorry.
|
||||
|
||||
November 29, 2005: Overview of changes from 2.12.0 to 2.12.1
|
||||
============================================================
|
||||
* Dropped dead files
|
||||
* linux: 1-line cleanup.
|
||||
|
||||
September 4, 2005: Overview of changes from 2.11.92 to 2.12.0
|
||||
=============================================================
|
||||
* Updated translations.
|
||||
|
||||
August 22, 2005: Overview of changes from 2.11.91 to 2.11.92
|
||||
============================================================
|
||||
* Linux:
|
||||
- fixed for 2.6 without /sys
|
||||
- glibtop_get_cpu() : Do not add irq, softirq and iowait to idle.
|
||||
|
||||
August 9, 2005: Overview of changes from 2.11.90 to 2.11.91
|
||||
===========================================================
|
||||
* All:
|
||||
- cleaned some headers.
|
||||
- removed static examples.
|
||||
* Linux:
|
||||
- fixed some issues with 2.6 without /sys
|
||||
|
||||
July 24, 2005: Overview of changes from 2.11.2 to 2.11.90
|
||||
=========================================================
|
||||
* Linux:
|
||||
- fixed glibtop_uptime .flags.
|
||||
|
||||
July &3, 2005: Overview of changes from 2.11.1 to 2.11.2
|
||||
========================================================
|
||||
* Linux:
|
||||
- little improvements for 2.6.
|
||||
|
||||
July 3, 2005: Overview of changes from 2.11.0 to 2.11.1
|
||||
=======================================================
|
||||
* Linux:
|
||||
- glibtop_get_swap : added page(in|out) for linux 2.6.
|
||||
|
||||
June 8, 2005: Overview of changes from 2.10.x to 2.11.0
|
||||
=======================================================
|
||||
* Replaced a lot of macros by functions
|
||||
* Got rid of dozens of useless files.
|
||||
* libgtop 2.11.x are and will stay API and ABI compatible with 2.10.x, i swear.
|
||||
|
||||
April 10, 2005: Overview of changes from 2.10.0 to 2.10.1
|
||||
=========================================================
|
||||
* Updated i18n.
|
||||
* Little cleanup and fixed gcc-4.0 compilation.
|
||||
* linux: fixed loadavg and uptime if locale != C.
|
||||
Updated siglist.
|
||||
* Tighter libgtop-2.0.pc.
|
||||
|
||||
Mars 7, 2005: Overview of Changes from 2.9.92 to 2.10.0
|
||||
=======================================================
|
||||
* Updated i18n.
|
||||
|
||||
February 28, 2005: Overview of Changes from 2.9.90 to 2.9.92
|
||||
============================================================
|
||||
* *BSD updated by marcus@freebsd.org (Joe Marcus Clarke).
|
||||
* Removed a lot of dead files :)
|
||||
* Don't build&install libgtop_daemon when it's never used.
|
||||
|
||||
February 6, 2004: Overview of Changes from 2.9.90 to 2.9.91
|
||||
==========================================================
|
||||
* Fixed typo in stub.
|
||||
* Updated i18n.
|
||||
$Id$
|
||||
|
||||
January 24, 2004: Overview of Changes from 2.9.4 to 2.9.90
|
||||
==========================================================
|
||||
* Updated Linux support.
|
||||
May/21/1998
|
||||
===========
|
||||
|
||||
January 10, 2004: Overview of Changes from 2.9.3 to 2.9.4
|
||||
=========================================================
|
||||
* New glibtop_proc_open_files nick@reloco.com.ar (Nicolás Lichtmaier).
|
||||
* Updated AIX support (Christophe Belle).
|
||||
* doc/gnome-hackers.sgml: This is a short intro on how to use libgtop
|
||||
in the GNOME project. It covers especially the use of its 'configure'
|
||||
script and the automatically generated 'gtopConf.sh'.
|
||||
|
||||
December 20, 2004: Overview of Changes from 2.9.0 to 2.9.3
|
||||
==========================================================
|
||||
* Removed libgtop_names.
|
||||
* Fixed Argument passing between library and server. #139809.
|
||||
* *BSD updated by marcus@freebsd.org (Joe Marcus Clarke).
|
||||
* glibtop_get_mountlist(False) now ignores 'unknown' fs.
|
||||
May/20/1998
|
||||
===========
|
||||
|
||||
* 'gtopConf.sh' now defines 'GTOP_LIBS' and 'GTOP_INCS' in a manner
|
||||
that they contain everything that is needed to link some program with
|
||||
libgtop. It will use '-lgtop' only if the server is really needed and
|
||||
'-lgtop_sysdeps' otherwise;
|
||||
|
||||
November 30, 2004: Overview of Changes from 2.8.1 to 2.9.0
|
||||
=========================================================
|
||||
* glibtop_get_netload : Fixed segfault on linux with ppp devices.
|
||||
* NEW glibtop_get_netlist : retrieves the list of all available interfaces.
|
||||
* NEW LIBGTOP_CHECK_VERSION(major, minor, micro)
|
||||
* Removed dead kernel patch and implementation.
|
||||
* Cleanups on Linux and Solaris.
|
||||
* 'gtopConf.sh' additionally defines 'GTOP_GUILE_LIBS' and 'GTOP_GUILE_INCS'
|
||||
containing everything that is needed to link some program both with
|
||||
libgtop and its guile interface. They are identically to 'GTOP_LIBS'
|
||||
and 'GTOP_INCS' if building the guile interface is disabled or guile
|
||||
cannot be found on the system.
|
||||
|
||||
October 11, 2004: Overview of Changes from 2.8.0 to 2.8.1
|
||||
=========================================================
|
||||
* Improved Solaris and AIX support.
|
||||
* 'configure' takes additional arguments '--enable-libgtop-server' and
|
||||
'--disable-libgtop-server' to use the server even when it's not needed
|
||||
or to disable it's use where it's needed.
|
||||
|
||||
* 'configure' takes an argument '--without-libgtop-guile' to disable
|
||||
guile support.
|
||||
|
||||
August 13, 2004: Overview of Changes from 2.7.92 to 2.8.0
|
||||
=========================================================
|
||||
* No changes
|
||||
* 'configure takes an argument '--without-libgtop-names' to remove
|
||||
'-lgtop_names' (and '-lgtop_guile_names' when we have guile) from
|
||||
'GTOP_LIBS'; in this case these libraries are not even built.
|
||||
|
||||
May/19/1998
|
||||
===========
|
||||
|
||||
August 30, 2004:
|
||||
===============
|
||||
* Applied some *BSD patches.
|
||||
* Removed old files.
|
||||
* Libgtop is now in the GNOME CVS Repository.
|
||||
|
||||
May/17/1998
|
||||
===========
|
||||
|
||||
August 15, 2004:
|
||||
===============
|
||||
* Fixed compilation with C89-only compilers and old libc.
|
||||
* we have now 'const char *glibtop_types_* []' consisting
|
||||
of the C types of the corresponding files of '_glibtop_*'.
|
||||
|
||||
* added guile function '(glibtop-types-*)' and '(glibtop-descriptions-*)'.
|
||||
|
||||
August 3, 2004:
|
||||
==============
|
||||
* Some cleanups.
|
||||
* Fixed the behaviour of some linux proc_*() functions.
|
||||
* Updated the documentation.
|
||||
May/10/1998
|
||||
===========
|
||||
|
||||
* Port to DEC OSF1 3.0 has been made:
|
||||
|
||||
July 19, 2004: Overview of Changes from 2.6.1 to 2.7.4
|
||||
======================================================
|
||||
* Plenty of code cleanups. Uninlined a lot of functions. ~5-10KB object size
|
||||
reduction.
|
||||
* Glibify a bit more.
|
||||
* API changes:
|
||||
- glibtop_fsusage provides total read and writes since boot_time.
|
||||
- glibtop_netload provides hardware address. IPv6 enable.
|
||||
- Added glibtop_get_proc_argv.
|
||||
cpu (total, user, nice, sys, idle)
|
||||
mem (total, used, free)
|
||||
|
||||
Work in progress :
|
||||
* Finish glibtop_fsusage implementation for Linux.
|
||||
* Some fuctions don't conform to the documentation, e.g. proctime.
|
||||
loadavg (loadavg)
|
||||
uptime (uptime)
|
||||
|
||||
March 11, 2004:
|
||||
===============
|
||||
msg_limits (map, max, mnb, mni, tql)
|
||||
sem_limits (mni, msl, opm, vmx, aem)
|
||||
shm_limits (max, min, mni, seg)
|
||||
|
||||
* Released LibGTop 2.5.99 "Gross Work", dedicated to people who do push-ups
|
||||
in the loos.
|
||||
The following need the server to be SUID root:
|
||||
|
||||
- plenty of code cleanups
|
||||
proclist (total, number, size)
|
||||
procdata (cmd, state, uid, pid, ppid, pgrp, tty, k_flags,
|
||||
session, tpgid, sigignore, sigcatch, signal, nice,
|
||||
priority, resident, rss, vsize, utime, stime,
|
||||
cutime, cstime, trs, drs)
|
||||
|
||||
- removed the dependency on libgnome, only glib required now
|
||||
May/07/1998
|
||||
===========
|
||||
|
||||
- Linux 2.6 support, NetBSD support and better FreeBSD support
|
||||
* 'flags' member of sysdeps/linux/procdata.c is now
|
||||
'unsigned long flags [2]'.
|
||||
|
||||
- Make the block size available for filesystem statistics
|
||||
* When we give glibtop_get_procdata () a pid of zero, only
|
||||
the flags are returned.
|
||||
|
||||
February 27, 2001:
|
||||
=================
|
||||
* We now use static constants instead of #defines for sysdeps flags.
|
||||
|
||||
* Released LibGTop 1.0.12 "Gerolzhofen".
|
||||
May/03/1998
|
||||
===========
|
||||
|
||||
- fix for Solaris 8 from Laszlo PETER (msg_limits, sem_limits).
|
||||
* VPATH-Build now working; sometimes it's necessary to copy
|
||||
$(top_srcdir)/po/cat-id-tbl.c to $(top_builddir)/po.
|
||||
|
||||
- fix for FreeBSD 4.2 from Rolf Grossmann (FreeBSD now uses
|
||||
`_KERNEL' instead of `KERNEL'). Bug #51334.
|
||||
* The library has been tested on the following systems:
|
||||
|
||||
- for BSDI, comment out `subnet' field in netload; this should make
|
||||
it compile, but there may be other problems. Bug #13345.
|
||||
- i686-pc-linux-gnu
|
||||
- sparc-sun-sunos4.1.1
|
||||
- alpha-dec-osf1 (that's DEC OSF1 3.0 and 3.2)
|
||||
|
||||
This release is for GNOME 1.4 Beta2.
|
||||
* Compilation has been tested on the following systems (I have no root
|
||||
access there and cannot test the library because of this):
|
||||
|
||||
February 14, 2001:
|
||||
=================
|
||||
- sparc-sun-solaris2
|
||||
- i386-bsdi
|
||||
|
||||
* Released LibGTop 1.0.11 "Jasmin":
|
||||
* Does no longer require Gnome.
|
||||
|
||||
[The release which was supposed to be called "Gerolzhofen".]
|
||||
* Guile-Parts are compiled only if guile can be found.
|
||||
|
||||
- merged in the Solaris code from LIBGTOP_1_1_2_PATCHES.
|
||||
* Some of the executables are statically linked to copy them more easily
|
||||
between machines.
|
||||
|
||||
- minor OpenBSD fixes.
|
||||
May/02/1998
|
||||
===========
|
||||
|
||||
- again a bunch of updated translations.
|
||||
* Global changes to the interfaces, all functions except glibtop_open()
|
||||
and glibtop_close() that took a server argument have now a '__r' suffix;
|
||||
the original name is now a macro that uses glibtop_global_server.
|
||||
|
||||
Please test the Solaris stuff and report and bugs and
|
||||
problems as soon as possible; I'll make a new release
|
||||
for the 2nd beta of GNOME 1.4 if necessary.
|
||||
Apr/10/1998
|
||||
===========
|
||||
Added new directory sysdeps/guile/names. It is the guile interface
|
||||
to the gtop_names library found in sysdeps/names. Changed
|
||||
GLIBTOP_DESCRIPTIONS to GLIBTOP_NAMES and added GLIBTOP_GUILE_NAMES
|
||||
to the header files.
|
||||
|
||||
November 20, 2000:
|
||||
=================
|
||||
Apr/09/1998
|
||||
===========
|
||||
Added new directories guile and names to sysdeps. In names are
|
||||
some string constants about the data stored in the structures.
|
||||
guile is a guile interface for the library. It is used in
|
||||
examples/third (which has been completely rewritten).
|
||||
The header files define things from names when GLIBTOP_DESCRIPTIONS
|
||||
if defined and/or from guile when HAVE_GUILE is defined.
|
||||
|
||||
* Released LibGTop 1.0.10 "November Rain":
|
||||
|
||||
- this release contains a bunch of updated translations.
|
||||
|
||||
May 25, 2000:
|
||||
============
|
||||
|
||||
* Released LibGTop 1.0.9 "Stuttgart".
|
||||
|
||||
(LibGTop 1.0.8 "Frankfurt" was not publically released.)
|
||||
|
||||
February 15, 2000:
|
||||
=================
|
||||
|
||||
* Released LibGTop 1.0.7 "Copenhagen":
|
||||
|
||||
- this is a bug fix release for the GUADEC CD-ROM;
|
||||
it contains fixes in both the Linux and *BSD sysdeps
|
||||
directory.
|
||||
|
||||
October 18, 1999:
|
||||
================
|
||||
|
||||
* Released LibGTop 1.0.6 "October LibGTop":
|
||||
|
||||
- compilation fixes for FreeBSD.
|
||||
- updated reference manual.
|
||||
|
||||
September 29, 1999:
|
||||
==================
|
||||
|
||||
* Released LibGTop 1.0.5.
|
||||
Apr/08/1998
|
||||
===========
|
||||
|
||||
Added guile wrapper for the library (see examples/third).
|
||||
|
61
README
61
README
@@ -1,20 +1,57 @@
|
||||
LATEST NEWS:
|
||||
Hi all,
|
||||
|
||||
[PLEASE READ THE FILE ``README.LATEST'' FOR LATEST NEWS]
|
||||
|
||||
this is the latest alpha version of libgtop, a library that fetches
|
||||
information about the running system such as cpu and memory usage,
|
||||
active processes etc. On Linux systems, these information are taken
|
||||
directly from the /proc filesystem. For other systems such as Solaris,
|
||||
where such programs need to be suid root (or only setgid kmem/mem on
|
||||
some systems), it provides a suid/setgid server that fetches those
|
||||
information and a client-side library that talks to this server.
|
||||
|
||||
Main idea was to have the same interface for all operating systems,
|
||||
thus all system dependent details are hidden in the implementation
|
||||
of that server.
|
||||
|
||||
Currently, it only works for Linux, documentation on how to port it
|
||||
to other systems is on the way. I'm planning to keep this site an
|
||||
up-to-date mirror of my local machine (which is connected to the
|
||||
internet over some expensive dialup connection, so I'll upload it about
|
||||
once every day I made significant changes) so that you can always find
|
||||
the latest version of the software here.
|
||||
|
||||
I've written a simple guile interface for the library to show which
|
||||
information it can already fetch. See examples/third for details.
|
||||
|
||||
Source Code:
|
||||
===========
|
||||
|
||||
Please look also in the file 'NEWS' for latest news.
|
||||
libgtop-current-cvs.cpio.gz is a cpio archive from the CVS repository
|
||||
libgtop-current.cpio.gz contains the lates checked out sources
|
||||
libgtop-stable.cpio.gz if present, it contains the last stable release
|
||||
|
||||
Martin
|
||||
Documentation:
|
||||
=============
|
||||
|
||||
libgtop.sgml is the SGML source of the (DocBook) documentation
|
||||
|
||||
ChangeLogs:
|
||||
==========
|
||||
The next three files are only provided until they get too big to upload.
|
||||
|
||||
LibGTop has many ChangeLogs files. The following files are the the
|
||||
most important :
|
||||
libgtop.tex TEX file of the documentation
|
||||
libgtop.dvi DVI file of the documentation
|
||||
libgtop.ps Postscript file of the documentation
|
||||
|
||||
- ChangeLog is the main ChangeLog.
|
||||
- sysdeps/<arch>/ChangeLog is the ChangeLog for arch specific changes.
|
||||
- sysdeps/common/ChangeLog is the ChangeLog for common changes (shared
|
||||
implementation between archs).
|
||||
HTML-Documentation:
|
||||
==================
|
||||
|
||||
Benoît
|
||||
libgtop.shtml Start here to browse the HTML documentation
|
||||
|
||||
Other stuff:
|
||||
===========
|
||||
|
||||
README, NEWS, ChangeLog copied from the sources
|
||||
|
||||
Enjoy it!
|
||||
|
||||
Martin (martin@home-of-linux.org - baulig@merkur.uni-trier.de)
|
||||
|
8
README.LATEST
Normal file
8
README.LATEST
Normal file
@@ -0,0 +1,8 @@
|
||||
$Id$
|
||||
|
||||
LATEST NEWS:
|
||||
===========
|
||||
|
||||
Please look also in the file 'NEWS' for latest news.
|
||||
|
||||
Martin
|
35
acconfig.h
Normal file
35
acconfig.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#undef ENABLE_NLS
|
||||
#undef HAVE_CATGETS
|
||||
#undef HAVE_GETTEXT
|
||||
#undef HAVE_LC_MESSAGES
|
||||
#undef HAVE_STPCPY
|
||||
#undef HAVE_STRUCT_OSOCKADDR
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
#undef HAVE_LIBSM
|
||||
#undef HAVE_LIBINTL_H
|
||||
#undef HAVE_GTK_SIGNAL_HANDLER_PENDING
|
||||
|
||||
/* Do not remove this comments and the empty lines; they are needed */
|
||||
#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME
|
||||
|
||||
/* to fix a bug in autoheader on DEC OSF1. */
|
||||
#undef HAVE_PROGRAM_INVOCATION_NAME
|
||||
|
||||
#undef HAVE_LIBJPEG
|
||||
#undef HAVE_LIBGIF
|
||||
#undef HAVE_LIBTIFF
|
||||
#undef HAVE_LIBZ
|
||||
#undef HAVE_LIBPNG
|
||||
#undef GNOME_ENABLE_DEBUG
|
||||
#undef HAVE_GMP2_INCLUDE_DIR
|
||||
#undef HAVE_GUILE
|
||||
#undef ssize_t
|
||||
|
||||
#undef HAVE_GLIBTOP_MACHINE_H
|
||||
|
||||
#undef GLIBTOP_NAMES
|
||||
#undef GLIBTOP_GUILE_NAMES
|
||||
#undef GLIBTOP_EXAMPLES
|
||||
|
||||
#undef NEED_LIBGTOP
|
964
acinclude.m4
964
acinclude.m4
@@ -1,525 +1,491 @@
|
||||
dnl This is just copied m4s from need-declaration.m4 gnome-fileutils.m4
|
||||
dnl gnome-supprt-checks.m4 and a little from gnome-libgtop-check.m4
|
||||
dnl and finally libgtop-sysdeps.m4
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.2h
|
||||
|
||||
dnl
|
||||
dnl LIBGTOP_CHECK_TYPE
|
||||
dnl
|
||||
dnl Improved version of AC_CHECK_TYPE which takes into account
|
||||
dnl that we need to #include some other header files on some
|
||||
dnl systems to get some types.
|
||||
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
dnl This Makefile.in is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl AC_LIBGTOP_CHECK_TYPE(TYPE, DEFAULT)
|
||||
AC_DEFUN([AC_LIBGTOP_CHECK_TYPE],
|
||||
[AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
AC_MSG_CHECKING(for $1)
|
||||
AC_CACHE_VAL(ac_cv_type_$1,
|
||||
[AC_EGREP_CPP(dnl
|
||||
changequote(<<,>>)dnl
|
||||
<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
|
||||
changequote([,]), [#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
/* For Tru64 */
|
||||
#ifdef HAVE_SYS_BITYPES_H
|
||||
#include <sys/bitypes.h>
|
||||
#endif
|
||||
], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
|
||||
AC_MSG_RESULT($ac_cv_type_$1)
|
||||
if test $ac_cv_type_$1 = no; then
|
||||
AC_DEFINE($1, $2, [Define to $2 if <sys/types.h> does not define.])
|
||||
fi
|
||||
AC_DEFUN([AC_LC_CANONICAL_HOST],[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
# The way shlib-versions is used to generate soversions.mk uses a
|
||||
# fairly simplistic model for name recognition that can't distinguish
|
||||
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
|
||||
# of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
|
||||
# tell. This doesn't get used much beyond that, so it's fairly safe.
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
;;
|
||||
gnu*)
|
||||
host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl GNOME_LIBGTOP_TYPES
|
||||
dnl
|
||||
dnl some typechecks for libgtop.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([GNOME_LIBGTOP_TYPES],
|
||||
[
|
||||
AC_CHECK_HEADERS(sys/bitypes.h)
|
||||
AC_DEFUN([AC_LC_SYSDEPS],[
|
||||
AC_REQUIRE([AC_LC_CANONICAL_HOST])
|
||||
AC_REQUIRE([GNOME_LIBGTOP_SYSDEPS])
|
||||
|
||||
AC_MSG_CHECKING(whether we need the gtop_server)
|
||||
|
||||
AC_ARG_ENABLE(libgtop-server,
|
||||
[ --enable-libgtop-server use gtop_server [default=auto]],
|
||||
[if test "x$enableval" = "xyes" ; then
|
||||
libgtop_need_server=yes
|
||||
elif test "x$enableval" = "xno" ; then
|
||||
libgtop_need_server=no
|
||||
fi])
|
||||
|
||||
AC_MSG_RESULT($libgtop_need_server)
|
||||
|
||||
AC_MSG_CHECKING(whether building of libgtop names is requested)
|
||||
|
||||
AC_ARG_ENABLE(libgtop-names,
|
||||
[ --enable-libgtop-names enable building of 'names' subdirs [default=yes]],
|
||||
[if test "x$enableval" = "xyes" ; then
|
||||
libgtop_want_names=yes
|
||||
else
|
||||
libgtop_want_names=$enableval
|
||||
fi],[libgtop_want_names=yes])
|
||||
|
||||
AC_MSG_RESULT($libgtop_want_names)
|
||||
|
||||
if test x$libgtop_want_names = xyes ; then
|
||||
AC_DEFINE(GLIBTOP_NAMES)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(GLIBTOP_NAMES, test x$libgtop_want_names = xyes)
|
||||
|
||||
AC_MSG_CHECKING(whether building of the guile interface is requested)
|
||||
|
||||
AC_ARG_ENABLE(libgtop-guile,
|
||||
[ --enable-libgtop-guile enable building of the guile interface [default=yes]],
|
||||
[if test "x$enableval" = "xyes" ; then
|
||||
libgtop_want_guile=yes
|
||||
else
|
||||
libgtop_want_guile=$enableval
|
||||
fi],[libgtop_want_guile=yes])
|
||||
|
||||
AC_MSG_RESULT($libgtop_want_guile)
|
||||
|
||||
AC_MSG_CHECKING(whether building of the examples is requested)
|
||||
|
||||
AC_ARG_ENABLE(libgtop-examples,
|
||||
[ --disable-libgtop-examples disable building of the examples],
|
||||
[if test "x$enableval" = "xyes" ; then
|
||||
libgtop_want_examples=yes
|
||||
else
|
||||
libgtop_want_examples=$enableval
|
||||
fi],[libgtop_want_examples=yes])
|
||||
|
||||
AC_MSG_RESULT($libgtop_want_examples)
|
||||
|
||||
if test x$libgtop_want_examples = xyes ; then
|
||||
AC_DEFINE(GLIBTOP_EXAMPLES)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(GLIBTOP_EXAMPLES, test x$libgtop_want_examples = xyes)
|
||||
|
||||
if test x$libgtop_use_machine_h = xyes ; then
|
||||
machine_incs="-I\$(top_srcdir)/sysdeps/$sysdeps_dir"
|
||||
fi
|
||||
|
||||
AC_SUBST(machine_incs)
|
||||
AC_SUBST(libgtop_want_names)
|
||||
AC_SUBST(libgtop_want_guile)
|
||||
AC_SUBST(libgtop_want_examples)
|
||||
])
|
||||
|
||||
dnl See whether we need a declaration for a function.
|
||||
dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
|
||||
AC_DEFUN([GCC_NEED_DECLARATION],
|
||||
[AC_MSG_CHECKING([whether $1 must be declared])
|
||||
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
|
||||
[AC_TRY_COMPILE([
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
$2],
|
||||
[char *(*pfn) = (char *(*)) $1],
|
||||
eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
|
||||
if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
gcc_need_declarations="$gcc_need_declarations $1"
|
||||
gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
|
||||
AC_DEFINE_UNQUOTED($gcc_tr_decl, 1, [Define if $1 () must be declared.])
|
||||
######################################################################
|
||||
# progtest.m4 from gettext 0.32
|
||||
######################################################################
|
||||
# Search path for a program which passes the given test.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
#
|
||||
# This file file be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
||||
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
||||
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
|
||||
[# Extract the first word of "$2", so it can be a program name with args.
|
||||
set dummy $2; ac_word=[$]2
|
||||
AC_MSG_CHECKING([for $ac_word])
|
||||
AC_CACHE_VAL(ac_cv_path_$1,
|
||||
[case "[$]$1" in
|
||||
/*)
|
||||
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in ifelse([$5], , $PATH, [$5]); do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
if [$3]; then
|
||||
ac_cv_path_$1="$ac_dir/$ac_word"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
dnl If no 4th arg is given, leave the cache variable unset,
|
||||
dnl so AC_PATH_PROGS will keep looking.
|
||||
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
|
||||
])dnl
|
||||
;;
|
||||
esac])dnl
|
||||
$1="$ac_cv_path_$1"
|
||||
if test -n "[$]$1"; then
|
||||
AC_MSG_RESULT([$]$1)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
])dnl
|
||||
AC_SUBST($1)dnl
|
||||
])
|
||||
|
||||
dnl Check multiple functions to see whether each needs a declaration.
|
||||
dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
|
||||
AC_DEFUN([GCC_NEED_DECLARATIONS],
|
||||
[for ac_func in $1
|
||||
do
|
||||
GCC_NEED_DECLARATION($ac_func, $2)
|
||||
done
|
||||
]
|
||||
)
|
||||
|
||||
dnl
|
||||
dnl GNOME_FILEUTILS_CHECKS
|
||||
dnl
|
||||
dnl checks that are needed for the diskusage applet.
|
||||
dnl
|
||||
######################################################################
|
||||
# lcmessage.m4 from gettext 0.32
|
||||
######################################################################
|
||||
# Check whether LC_MESSAGES is available in <locale.h>.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
#
|
||||
# This file file be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
AC_DEFUN([GNOME_FILEUTILS_CHECKS],
|
||||
[
|
||||
AC_CHECK_HEADERS(fcntl.h sys/param.h sys/statfs.h sys/fstyp.h \
|
||||
mnttab.h mntent.h sys/statvfs.h sys/vfs.h sys/mount.h \
|
||||
sys/filsys.h sys/fs_types.h sys/fs/s5param.h)
|
||||
# serial 1
|
||||
|
||||
AC_CHECK_FUNCS(bcopy endgrent endpwent fchdir ftime ftruncate \
|
||||
getcwd getmntinfo gettimeofday isascii lchown \
|
||||
listmntent memcpy mkfifo strchr strerror strrchr vprintf)
|
||||
AC_DEFUN(AM_LC_MESSAGES,
|
||||
[if test $ac_cv_header_locale_h = yes; then
|
||||
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
|
||||
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
|
||||
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
|
||||
if test $am_cv_val_LC_MESSAGES = yes; then
|
||||
AC_DEFINE(HAVE_LC_MESSAGES)
|
||||
fi
|
||||
fi])
|
||||
|
||||
dnl Set some defaults when cross-compiling
|
||||
|
||||
if test x$cross_compiling = xyes ; then
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
fu_cv_sys_mounted_getmntent1=yes
|
||||
fu_cv_sys_stat_statfs2_bsize=yes
|
||||
;;
|
||||
sunos*)
|
||||
fu_cv_sys_stat_statfs4=yes
|
||||
;;
|
||||
freebsd*)
|
||||
fu_cv_sys_stat_statfs2_bsize=yes
|
||||
;;
|
||||
osf*)
|
||||
fu_cv_sys_stat_statfs3_osf1=yes
|
||||
;;
|
||||
|
||||
######################################################################
|
||||
# gettext.m4 from gettext 0.32
|
||||
######################################################################
|
||||
# Macro to add for using GNU gettext.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
#
|
||||
# This file file be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 3
|
||||
|
||||
AC_DEFUN(AM_WITH_NLS,
|
||||
[AC_MSG_CHECKING([whether NLS is requested])
|
||||
dnl Default is enabled NLS
|
||||
AC_ARG_ENABLE(nls,
|
||||
[ --disable-nls do not use Native Language Support],
|
||||
USE_NLS=$enableval, USE_NLS=yes)
|
||||
AC_MSG_RESULT($USE_NLS)
|
||||
AC_SUBST(USE_NLS)
|
||||
|
||||
USE_INCLUDED_LIBINTL=no
|
||||
|
||||
dnl If we use NLS figure out what method
|
||||
if test "$USE_NLS" = "yes"; then
|
||||
AC_DEFINE(ENABLE_NLS)
|
||||
AC_MSG_CHECKING([whether included gettext is requested])
|
||||
AC_ARG_WITH(included-gettext,
|
||||
[ --with-included-gettext use the GNU gettext library included here],
|
||||
nls_cv_force_use_gnu_gettext=$withval,
|
||||
nls_cv_force_use_gnu_gettext=no)
|
||||
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
|
||||
|
||||
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
|
||||
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
|
||||
dnl User does not insist on using GNU NLS library. Figure out what
|
||||
dnl to use. If gettext or catgets are available (in this order) we
|
||||
dnl use this. Else we have to fall back to GNU NLS library.
|
||||
dnl catgets is only used if permitted by option --with-catgets.
|
||||
nls_cv_header_intl=
|
||||
nls_cv_header_libgt=
|
||||
CATOBJEXT=NONE
|
||||
|
||||
AC_CHECK_HEADER(libintl.h,
|
||||
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
|
||||
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
|
||||
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" != "yes"; then
|
||||
AC_CHECK_LIB(intl, bindtextdomain,
|
||||
[AC_CACHE_CHECK([for gettext in libintl],
|
||||
gt_cv_func_gettext_libintl,
|
||||
[AC_TRY_LINK([], [return (int) gettext ("")],
|
||||
gt_cv_func_gettext_libintl=yes,
|
||||
gt_cv_func_gettext_libintl=no)])])
|
||||
fi
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" = "yes" \
|
||||
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETTEXT)
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
|
||||
if test "$MSGFMT" != "no"; then
|
||||
AC_CHECK_FUNCS(dcgettext)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
|
||||
return _nl_msg_cat_cntr],
|
||||
[CATOBJEXT=.gmo
|
||||
DATADIRNAME=share],
|
||||
[CATOBJEXT=.mo
|
||||
DATADIRNAME=lib])
|
||||
INSTOBJEXT=.mo
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$CATOBJEXT" = "NONE"; then
|
||||
AC_MSG_CHECKING([whether catgets can be used])
|
||||
AC_ARG_WITH(catgets,
|
||||
[ --with-catgets use catgets functions if available],
|
||||
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
|
||||
AC_MSG_RESULT($nls_cv_use_catgets)
|
||||
|
||||
if test "$nls_cv_use_catgets" = "yes"; then
|
||||
dnl No gettext in C library. Try catgets next.
|
||||
AC_CHECK_LIB(i, main)
|
||||
AC_CHECK_FUNC(catgets,
|
||||
[AC_DEFINE(HAVE_CATGETS)
|
||||
INTLOBJS="\$(CATOBJS)"
|
||||
AC_PATH_PROG(GENCAT, gencat, no)dnl
|
||||
if test "$GENCAT" != "no"; then
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
|
||||
if test "$GMSGFMT" = "no"; then
|
||||
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
|
||||
fi
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
CATOBJEXT=.cat
|
||||
INSTOBJEXT=.cat
|
||||
DATADIRNAME=lib
|
||||
INTLDEPS='$(top_builddir)/intl/libintl.a'
|
||||
INTLLIBS=$INTLDEPS
|
||||
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$CATOBJEXT" = "NONE"; then
|
||||
dnl Neither gettext nor catgets in included in the C library.
|
||||
dnl Fall back on GNU gettext library.
|
||||
nls_cv_use_gnu_gettext=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$nls_cv_use_gnu_gettext" = "yes"; then
|
||||
dnl Mark actions used to generate GNU NLS library.
|
||||
INTLOBJS="\$(GETTOBJS)"
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
AC_SUBST(MSGFMT)
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
CATOBJEXT=.gmo
|
||||
INSTOBJEXT=.mo
|
||||
DATADIRNAME=share
|
||||
INTLDEPS='$(top_builddir)/intl/libintl.a'
|
||||
INTLLIBS=$INTLDEPS
|
||||
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi
|
||||
|
||||
dnl Test whether we really found GNU xgettext.
|
||||
if test "$XGETTEXT" != ":"; then
|
||||
dnl If it is no GNU xgettext we define it as : so that the
|
||||
dnl Makefiles still can work.
|
||||
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
|
||||
: ;
|
||||
else
|
||||
AC_MSG_RESULT(
|
||||
[found xgettext programs is not GNU xgettext; ignore it])
|
||||
XGETTEXT=":"
|
||||
fi
|
||||
fi
|
||||
|
||||
# We need to process the po/ directory.
|
||||
POSUB=po
|
||||
else
|
||||
DATADIRNAME=share
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi
|
||||
|
||||
# If this is used in GNU gettext we have to set USE_NLS to `yes'
|
||||
# because some of the sources are only built for this goal.
|
||||
if test "$PACKAGE" = gettext; then
|
||||
USE_NLS=yes
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
fi
|
||||
|
||||
dnl These rules are solely for the distribution goal. While doing this
|
||||
dnl we only have to keep exactly one list of the available catalogs
|
||||
dnl in configure.in.
|
||||
for lang in $ALL_LINGUAS; do
|
||||
GMOFILES="$GMOFILES $lang.gmo"
|
||||
POFILES="$POFILES $lang.po"
|
||||
done
|
||||
|
||||
dnl Make all variables we use known to autoconf.
|
||||
AC_SUBST(USE_INCLUDED_LIBINTL)
|
||||
AC_SUBST(CATALOGS)
|
||||
AC_SUBST(CATOBJEXT)
|
||||
AC_SUBST(DATADIRNAME)
|
||||
AC_SUBST(GMOFILES)
|
||||
AC_SUBST(INSTOBJEXT)
|
||||
AC_SUBST(INTLDEPS)
|
||||
AC_SUBST(INTLLIBS)
|
||||
AC_SUBST(INTLOBJS)
|
||||
AC_SUBST(POFILES)
|
||||
AC_SUBST(POSUB)
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_GNU_GETTEXT,
|
||||
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_ISC_POSIX])dnl
|
||||
AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
AC_REQUIRE([AC_C_CONST])dnl
|
||||
AC_REQUIRE([AC_C_INLINE])dnl
|
||||
AC_REQUIRE([AC_TYPE_OFF_T])dnl
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
|
||||
AC_REQUIRE([AC_FUNC_MMAP])dnl
|
||||
|
||||
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
|
||||
unistd.h values.h sys/param.h])
|
||||
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
|
||||
__argz_count __argz_stringify __argz_next])
|
||||
|
||||
if test "${ac_cv_func_stpcpy+set}" != "set"; then
|
||||
AC_CHECK_FUNCS(stpcpy)
|
||||
fi
|
||||
if test "${ac_cv_func_stpcpy}" = "yes"; then
|
||||
AC_DEFINE(HAVE_STPCPY)
|
||||
fi
|
||||
|
||||
AM_LC_MESSAGES
|
||||
AM_WITH_NLS
|
||||
|
||||
if test "x$CATOBJEXT" != "x"; then
|
||||
if test "x$ALL_LINGUAS" = "x"; then
|
||||
LINGUAS=
|
||||
else
|
||||
AC_MSG_CHECKING(for catalogs to be installed)
|
||||
NEW_LINGUAS=
|
||||
for lang in ${LINGUAS=$ALL_LINGUAS}; do
|
||||
case "$ALL_LINGUAS" in
|
||||
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
LINGUAS=$NEW_LINGUAS
|
||||
AC_MSG_RESULT($LINGUAS)
|
||||
fi
|
||||
|
||||
# Determine how to get the list of mounted filesystems.
|
||||
list_mounted_fs=
|
||||
dnl Construct list of names of catalog files to be constructed.
|
||||
if test -n "$LINGUAS"; then
|
||||
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
|
||||
fi
|
||||
fi
|
||||
|
||||
# If the getmntent function is available but not in the standard library,
|
||||
# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
|
||||
AC_FUNC_GETMNTENT
|
||||
dnl The reference to <locale.h> in the installed <libintl.h> file
|
||||
dnl must be resolved because we cannot expect the users of this
|
||||
dnl to define HAVE_LOCALE_H.
|
||||
if test $ac_cv_header_locale_h = yes; then
|
||||
INCLUDE_LOCALE_H="#include <locale.h>"
|
||||
else
|
||||
INCLUDE_LOCALE_H="\
|
||||
/* The system does not provide the header <locale.h>. Take care yourself. */"
|
||||
fi
|
||||
AC_SUBST(INCLUDE_LOCALE_H)
|
||||
|
||||
# This test must precede the ones for getmntent because Unicos-9 is
|
||||
# reported to have the getmntent function, but its support is incompatible
|
||||
# with other getmntent implementations.
|
||||
dnl Determine which catalog format we have (if any is needed)
|
||||
dnl For now we know about two different formats:
|
||||
dnl Linux libc-5 and the normal X/Open format
|
||||
test -d intl || mkdir intl
|
||||
if test "$CATOBJEXT" = ".cat"; then
|
||||
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
|
||||
|
||||
# NOTE: Normally, I wouldn't use a check for system type as I've done for
|
||||
# `CRAY' below since that goes against the whole autoconf philosophy. But
|
||||
# I think there is too great a chance that some non-Cray system has a
|
||||
# function named listmntent to risk the false positive.
|
||||
dnl Transform the SED scripts while copying because some dumb SEDs
|
||||
dnl cannot handle comments.
|
||||
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
|
||||
fi
|
||||
dnl po2tbl.sed is always needed.
|
||||
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
|
||||
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
# Cray UNICOS 9
|
||||
AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
|
||||
[fu_cv_sys_mounted_cray_listmntent=no
|
||||
AC_EGREP_CPP(yes,
|
||||
[#ifdef _CRAY
|
||||
yes
|
||||
#endif
|
||||
], [test $ac_cv_func_listmntent = yes \
|
||||
&& fu_cv_sys_mounted_cray_listmntent=yes]
|
||||
)
|
||||
]
|
||||
)
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
|
||||
if test $fu_cv_sys_mounted_cray_listmntent = yes; then
|
||||
list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_LISTMNTENT, 1,
|
||||
[Define if there is a function named listmntent that can be used to list all mounted filesystems. [UNICOS]])
|
||||
fi
|
||||
fi
|
||||
dnl In the intl/Makefile.in we have a special dependency which makes
|
||||
dnl only sense for gettext. We comment this out for non-gettext
|
||||
dnl packages.
|
||||
if test "$PACKAGE" = "gettext"; then
|
||||
GT_NO="#NO#"
|
||||
GT_YES=
|
||||
else
|
||||
GT_NO=
|
||||
GT_YES="#YES#"
|
||||
fi
|
||||
AC_SUBST(GT_NO)
|
||||
AC_SUBST(GT_YES)
|
||||
|
||||
if test $ac_cv_func_getmntent = yes; then
|
||||
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
|
||||
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
|
||||
dnl Try to locate is.
|
||||
MKINSTALLDIRS=
|
||||
if test -n "$ac_aux_dir"; then
|
||||
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
|
||||
fi
|
||||
if test -z "$MKINSTALLDIRS"; then
|
||||
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
|
||||
fi
|
||||
AC_SUBST(MKINSTALLDIRS)
|
||||
|
||||
# This system has the getmntent function.
|
||||
# Determine whether it's the one-argument variant or the two-argument one.
|
||||
dnl *** For now the libtool support in intl/Makefile is not for real.
|
||||
l=
|
||||
AC_SUBST(l)
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
# 4.3BSD, SunOS, HP-UX, Dynix, Irix
|
||||
AC_MSG_CHECKING([for one-argument getmntent function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
|
||||
[test $ac_cv_header_mntent_h = yes \
|
||||
&& fu_cv_sys_mounted_getmntent1=yes \
|
||||
|| fu_cv_sys_mounted_getmntent1=no])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
|
||||
if test $fu_cv_sys_mounted_getmntent1 = yes; then
|
||||
list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETMNTENT1, 1,
|
||||
[Define if there is a function named getmntent for reading the list of mounted filesystems, and that function takes a single argument. [4.3BSD, SunOS, HP-UX, Dynix, Irix]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
# SVR4
|
||||
AC_MSG_CHECKING([for two-argument getmntent function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
|
||||
[AC_EGREP_HEADER(getmntent, sys/mnttab.h,
|
||||
fu_cv_sys_mounted_getmntent2=yes,
|
||||
fu_cv_sys_mounted_getmntent2=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
|
||||
if test $fu_cv_sys_mounted_getmntent2 = yes; then
|
||||
list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETMNTENT2, 1,
|
||||
[Define if there is a function named getmntent for reading the list of mounted filesystems, and that function takes two arguments. [SVR4]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
# DEC Alpha running OSF/1.
|
||||
AC_MSG_CHECKING([for getfsstat function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
|
||||
[AC_TRY_LINK([
|
||||
#include <sys/types.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/fs_types.h>],
|
||||
[struct statfs *stats;
|
||||
int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
|
||||
fu_cv_sys_mounted_getsstat=yes,
|
||||
fu_cv_sys_mounted_getsstat=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
|
||||
if test $fu_cv_sys_mounted_getsstat = yes; then
|
||||
list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETFSSTAT, 1,
|
||||
[Define if there is a function named getfsstat for reading the list of mounted filesystems. [DEC Alpha running OSF/1]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
# AIX.
|
||||
AC_MSG_CHECKING([for mntctl function and struct vmount])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
|
||||
[AC_TRY_CPP([#include <fshelp.h>],
|
||||
fu_cv_sys_mounted_vmount=yes,
|
||||
fu_cv_sys_mounted_vmount=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
|
||||
if test $fu_cv_sys_mounted_vmount = yes; then
|
||||
list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_VMOUNT, 1,
|
||||
[Define if there is a function named mntctl that can be used to read the list of mounted filesystems, and there is a system header file that declares `struct vmount.' [AIX]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
# SVR3
|
||||
AC_MSG_CHECKING([for FIXME existence of three headers])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
|
||||
[AC_TRY_CPP([
|
||||
#include <sys/statfs.h>
|
||||
#include <sys/fstyp.h>
|
||||
#include <mnttab.h>],
|
||||
fu_cv_sys_mounted_fread_fstyp=yes,
|
||||
fu_cv_sys_mounted_fread_fstyp=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
|
||||
if test $fu_cv_sys_mounted_fread_fstyp = yes; then
|
||||
list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
|
||||
[Define if (like SVR2) there is no specific function for reading the list of mounted filesystems, and your system has these header files: <sys/fstyp.h> and <sys/statfs.h>. [SVR3]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
# 4.4BSD and DEC OSF/1.
|
||||
AC_MSG_CHECKING([for getmntinfo function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
|
||||
[
|
||||
ok=
|
||||
if test $ac_cv_func_getmntinfo = yes; then
|
||||
AC_EGREP_HEADER(f_type;, sys/mount.h,
|
||||
ok=yes)
|
||||
fi
|
||||
test -n "$ok" \
|
||||
&& fu_cv_sys_mounted_getmntinfo=yes \
|
||||
|| fu_cv_sys_mounted_getmntinfo=no
|
||||
])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
|
||||
if test $fu_cv_sys_mounted_getmntinfo = yes; then
|
||||
list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETMNTINFO, 1,
|
||||
[Define if there is a function named getmntinfo for reading the list of mounted filesystems. [4.4BSD]])
|
||||
fi
|
||||
fi
|
||||
|
||||
# FIXME: add a test for netbsd-1.1 here
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
# Ultrix
|
||||
AC_MSG_CHECKING([for getmnt function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
|
||||
[AC_TRY_CPP([
|
||||
#include <sys/fs_types.h>
|
||||
#include <sys/mount.h>],
|
||||
fu_cv_sys_mounted_getmnt=yes,
|
||||
fu_cv_sys_mounted_getmnt=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
|
||||
if test $fu_cv_sys_mounted_getmnt = yes; then
|
||||
list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETMNT, 1,
|
||||
[Define if there is a function named getmnt for reading the list of mounted filesystems. [Ultrix]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
# SVR2
|
||||
AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_fread,
|
||||
[AC_TRY_CPP([#include <mnttab.h>],
|
||||
fu_cv_sys_mounted_fread=yes,
|
||||
fu_cv_sys_mounted_fread=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_fread)
|
||||
if test $fu_cv_sys_mounted_fread = yes; then
|
||||
list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_FREAD, 1,
|
||||
[Define if there is no specific function for reading the list of mounted filesystems. fread will be used to read /etc/mnttab. [SVR2]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
|
||||
# FIXME -- no need to abort building the whole package
|
||||
# Cannot build mountlist.c or anything that needs its functions
|
||||
fi
|
||||
|
||||
AC_CHECKING(how to get filesystem space usage)
|
||||
space=no
|
||||
|
||||
# Perform only the link test since it seems there are no variants of the
|
||||
# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
|
||||
# because that got a false positive on SCO OSR5. Adding the declaration
|
||||
# of a `struct statvfs' causes this test to fail (as it should) on such
|
||||
# systems. That system is reported to work fine with STAT_STATFS4 which
|
||||
# is what it gets when this test fails.
|
||||
if test $space = no; then
|
||||
# SVR4
|
||||
AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
|
||||
[AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <sys/statvfs.h>],
|
||||
[struct statvfs fsd; statvfs (0, &fsd);],
|
||||
fu_cv_sys_stat_statvfs=yes,
|
||||
fu_cv_sys_stat_statvfs=no)])
|
||||
if test $fu_cv_sys_stat_statvfs = yes; then
|
||||
space=yes
|
||||
AC_DEFINE(STAT_STATVFS, 1,
|
||||
[Define if there is a function named statvfs. [SVR4]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $space = no; then
|
||||
# DEC Alpha running OSF/1
|
||||
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
|
||||
[AC_TRY_RUN([
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mount.h>
|
||||
int main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
fsd.f_fsize = 0;
|
||||
return (statfs (".", &fsd, sizeof (struct statfs)));
|
||||
}],
|
||||
fu_cv_sys_stat_statfs3_osf1=yes,
|
||||
fu_cv_sys_stat_statfs3_osf1=no,
|
||||
fu_cv_sys_stat_statfs3_osf1=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
|
||||
if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
|
||||
space=yes
|
||||
AC_DEFINE(STAT_STATFS3_OSF1, 1,
|
||||
[Define if statfs takes 3 args. [DEC Alpha running OSF/1]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $space = no; then
|
||||
# AIX
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
|
||||
member (AIX, 4.3BSD)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
|
||||
[AC_TRY_RUN([
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_VFS_H
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
int main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
fsd.f_bsize = 0;
|
||||
return (statfs (".", &fsd));
|
||||
}],
|
||||
fu_cv_sys_stat_statfs2_bsize=yes,
|
||||
fu_cv_sys_stat_statfs2_bsize=no,
|
||||
fu_cv_sys_stat_statfs2_bsize=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
|
||||
if test $fu_cv_sys_stat_statfs2_bsize = yes; then
|
||||
space=yes
|
||||
AC_DEFINE(STAT_STATFS2_BSIZE, 1,
|
||||
[Define if statfs takes 2 args and struct statfs has a field named f_bsize. [4.3BSD, SunOS 4, HP-UX, AIX PS/2]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $space = no; then
|
||||
# SVR3
|
||||
AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
|
||||
[AC_TRY_RUN([#include <sys/types.h>
|
||||
#include <sys/statfs.h>
|
||||
int main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
return (statfs (".", &fsd, sizeof fsd, 0));
|
||||
}],
|
||||
fu_cv_sys_stat_statfs4=yes,
|
||||
fu_cv_sys_stat_statfs4=no,
|
||||
fu_cv_sys_stat_statfs4=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
|
||||
if test $fu_cv_sys_stat_statfs4 = yes; then
|
||||
space=yes
|
||||
AC_DEFINE(STAT_STATFS4, 1,
|
||||
[Define if statfs takes 4 args. [SVR3, Dynix, Irix, Dolphin]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $space = no; then
|
||||
# 4.4BSD and NetBSD
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
|
||||
member (4.4BSD and NetBSD)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
|
||||
[AC_TRY_RUN([#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
int main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
fsd.f_fsize = 0;
|
||||
return (statfs (".", &fsd));
|
||||
}],
|
||||
fu_cv_sys_stat_statfs2_fsize=yes,
|
||||
fu_cv_sys_stat_statfs2_fsize=no,
|
||||
fu_cv_sys_stat_statfs2_fsize=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
|
||||
if test $fu_cv_sys_stat_statfs2_fsize = yes; then
|
||||
space=yes
|
||||
AC_DEFINE(STAT_STATFS2_FSIZE, 1,
|
||||
[Define if statfs takes 2 args and struct statfs has a field named f_fsize. [4.4BSD, NetBSD]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $space = no; then
|
||||
# Ultrix
|
||||
AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
|
||||
[AC_TRY_RUN([#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_FS_TYPES_H
|
||||
#include <sys/fs_types.h>
|
||||
#endif
|
||||
int main ()
|
||||
{
|
||||
struct fs_data fsd;
|
||||
/* Ultrix's statfs returns 1 for success,
|
||||
0 for not mounted, -1 for failure. */
|
||||
return (statfs (".", &fsd) != 1);
|
||||
}],
|
||||
fu_cv_sys_stat_fs_data=yes,
|
||||
fu_cv_sys_stat_fs_data=no,
|
||||
fu_cv_sys_stat_fs_data=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
|
||||
if test $fu_cv_sys_stat_fs_data = yes; then
|
||||
space=yes
|
||||
AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
|
||||
[Define if statfs takes 2 args and the second argument has type struct fs_data. [Ultrix]])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $space = no; then
|
||||
# SVR2
|
||||
AC_TRY_CPP([#include <sys/filsys.h>],
|
||||
AC_DEFINE(STAT_READ_FILSYS, 1,
|
||||
[Define if there is no specific function for reading filesystems usage information and you have the <sys/filsys.h> header file. [SVR2]])
|
||||
space=yes)
|
||||
fi
|
||||
|
||||
if test -n "$list_mounted_fs" && test $space != no; then
|
||||
DF_PROG="df"
|
||||
# AC_LIBOBJ(fsusage)
|
||||
# AC_LIBOBJ(mountlist)
|
||||
fi
|
||||
|
||||
# Check for SunOS statfs brokenness wrt partitions 2GB and larger.
|
||||
# If <sys/vfs.h> exists and struct statfs has a member named f_spare,
|
||||
# enable the work-around code in fsusage.c.
|
||||
AC_MSG_CHECKING([for statfs that truncates block counts])
|
||||
AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
|
||||
[AC_TRY_COMPILE([
|
||||
#if !defined(sun) && !defined(__sun)
|
||||
choke -- this is a workaround for a Sun-specific problem
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/vfs.h>],
|
||||
[struct statfs t; long c = *(t.f_spare);],
|
||||
fu_cv_sys_truncating_statfs=yes,
|
||||
fu_cv_sys_truncating_statfs=no,
|
||||
)])
|
||||
if test $fu_cv_sys_truncating_statfs = yes; then
|
||||
AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
|
||||
[Define if the block counts reported by statfs may be truncated to 2GB and the correct values may be stored in the f_spare array. [SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem. SunOS 4.1.1 seems not to be affected.]])
|
||||
fi
|
||||
AC_MSG_RESULT($fu_cv_sys_truncating_statfs)
|
||||
|
||||
AC_CHECKING(for AFS)
|
||||
test -d /afs && AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
|
||||
])
|
||||
|
||||
|
||||
m4_include([libgtop-sysdeps.m4])
|
||||
dnl Generate list of files to be processed by xgettext which will
|
||||
dnl be included in po/Makefile.
|
||||
test -d po || mkdir po
|
||||
if test "x$srcdir" != "x."; then
|
||||
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
|
||||
posrcprefix="$srcdir/"
|
||||
else
|
||||
posrcprefix="../$srcdir/"
|
||||
fi
|
||||
else
|
||||
posrcprefix="../"
|
||||
fi
|
||||
rm -f po/POTFILES
|
||||
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
|
||||
< $srcdir/po/POTFILES.in > po/POTFILES
|
||||
])
|
||||
|
@@ -14,9 +14,4 @@ PKG_NAME="Gnome Top Library"
|
||||
exit 1
|
||||
}
|
||||
|
||||
which gnome-autogen.sh || {
|
||||
echo "You need to install gnome-common from the GNOME CVS"
|
||||
exit 1
|
||||
}
|
||||
REQUIRED_AUTOMAKE_VERSION=1.9
|
||||
. gnome-autogen.sh
|
||||
. $srcdir/macros/autogen.sh
|
||||
|
883
config.guess
vendored
Executable file
883
config.guess
vendored
Executable file
@@ -0,0 +1,883 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
#
|
||||
# This program 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 this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# The master version of this file is at the FSF in /home/gd/gnu/lib.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit system type (host/target name).
|
||||
#
|
||||
# Only a few systems have been added to this list; please add others
|
||||
# (but try to keep the structure clean).
|
||||
#
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 8/24/94.)
|
||||
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
|
||||
PATH=$PATH:/.attbin ; export PATH
|
||||
fi
|
||||
|
||||
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
|
||||
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
alpha:OSF1:*:*)
|
||||
if test $UNAME_RELEASE = "V4.0"; then
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
fi
|
||||
# A Vn.n version is a released version.
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
cat <<EOF >dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,0,\$26,0
|
||||
.prologue 0
|
||||
.long 0x47e03d80 # implver $0
|
||||
lda \$2,259
|
||||
.long 0x47e20c21 # amask $2,$1
|
||||
srl \$1,8,\$2
|
||||
sll \$2,2,\$2
|
||||
sll \$0,3,\$0
|
||||
addl \$1,\$0,\$0
|
||||
addl \$2,\$0,\$0
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
EOF
|
||||
${CC-cc} dummy.s -o dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
15)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
14)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
10)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
16)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f dummy.s dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
|
||||
exit 0 ;;
|
||||
21064:Windows_NT:50:3)
|
||||
echo alpha-dec-winnt3.5
|
||||
exit 0 ;;
|
||||
Amiga*:UNIX_System_V:4.0:*)
|
||||
echo m68k-cbm-sysv4
|
||||
exit 0;;
|
||||
amiga:NetBSD:*:*)
|
||||
echo m68k-cbm-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc64:OpenBSD:*:*)
|
||||
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hkmips:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sgi:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
wgrisc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
arm32:NetBSD:*:*)
|
||||
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
SR2?01:HI-UX/MPP:*:*)
|
||||
echo hppa1.1-hitachi-hiuxmpp
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
|
||||
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
|
||||
if test "`(/bin/universe) 2>/dev/null`" = att ; then
|
||||
echo pyramid-pyramid-sysv3
|
||||
else
|
||||
echo pyramid-pyramid-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
NILE:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
|
||||
# it's likely to be more like Solaris than SunOS4.
|
||||
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:*:*)
|
||||
case "`/usr/bin/arch -k`" in
|
||||
Series*|S4*)
|
||||
UNAME_RELEASE=`uname -v`
|
||||
;;
|
||||
esac
|
||||
# Japanese Language versions have a version number like `4.1.3-JL'.
|
||||
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
|
||||
exit 0 ;;
|
||||
sun3*:SunOS:*:*)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun*:*:4.2BSD:*)
|
||||
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
|
||||
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
|
||||
case "`/bin/arch`" in
|
||||
sun3)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
;;
|
||||
sun4)
|
||||
echo sparc-sun-sunos${UNAME_RELEASE}
|
||||
;;
|
||||
esac
|
||||
exit 0 ;;
|
||||
aushp:SunOS:*:*)
|
||||
echo sparc-auspex-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:NetBSD:*:*)
|
||||
echo m68k-atari-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:NetBSD:*:*)
|
||||
echo m68k-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme88k:OpenBSD:*:*)
|
||||
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RISC*:Mach:*:*)
|
||||
echo mips-dec-mach_bsd4.3
|
||||
exit 0 ;;
|
||||
RISC*:ULTRIX:*:*)
|
||||
echo mips-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
VAX*:ULTRIX*:*:*)
|
||||
echo vax-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
2020:CLIX:*:*)
|
||||
echo clipper-intergraph-clix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mips:*:*:UMIPS | mips:*:*:RISCos)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
int main (argc, argv) int argc; char **argv; {
|
||||
#if defined (host_mips) && defined (MIPSEB)
|
||||
#if defined (SYSTYPE_SYSV)
|
||||
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#if defined (SYSTYPE_SVR4)
|
||||
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
|
||||
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy \
|
||||
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Night_Hawk:Power_UNIX:*:*)
|
||||
echo powerpc-harris-powerunix
|
||||
exit 0 ;;
|
||||
m88k:CX/UX:7*:*)
|
||||
echo m88k-harris-cxux7
|
||||
exit 0 ;;
|
||||
m88k:*:4*:R4*)
|
||||
echo m88k-motorola-sysv4
|
||||
exit 0 ;;
|
||||
m88k:*:3*:R3*)
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
AViiON:dgux:*:*)
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
|
||||
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
|
||||
echo m88k-dg-dgux${UNAME_RELEASE}
|
||||
else
|
||||
echo m88k-dg-dguxbcs${UNAME_RELEASE}
|
||||
fi
|
||||
else echo i586-dg-dgux${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
||||
echo m88k-dolphin-sysv3
|
||||
exit 0 ;;
|
||||
M88*:*:R3*:*)
|
||||
# Delta 88k system running SVR3
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
|
||||
echo m88k-tektronix-sysv3
|
||||
exit 0 ;;
|
||||
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
|
||||
echo m68k-tektronix-bsd
|
||||
exit 0 ;;
|
||||
*:IRIX*:*:*)
|
||||
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
|
||||
exit 0 ;;
|
||||
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
|
||||
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
|
||||
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
|
||||
i?86:AIX:*:*)
|
||||
echo i386-ibm-aix
|
||||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
main()
|
||||
{
|
||||
if (!__power_pc())
|
||||
exit(1);
|
||||
puts("powerpc-ibm-aix3.2.5");
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
else
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit 0 ;;
|
||||
*:AIX:*:4)
|
||||
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
else
|
||||
IBM_ARCH=powerpc
|
||||
fi
|
||||
if [ -x /usr/bin/oslevel ] ; then
|
||||
IBM_REV=`/usr/bin/oslevel`
|
||||
else
|
||||
IBM_REV=4.${UNAME_RELEASE}
|
||||
fi
|
||||
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
|
||||
exit 0 ;;
|
||||
*:AIX:*:*)
|
||||
echo rs6000-ibm-aix
|
||||
exit 0 ;;
|
||||
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
|
||||
echo romp-ibm-bsd4.4
|
||||
exit 0 ;;
|
||||
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
|
||||
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
|
||||
exit 0 ;; # report: romp-ibm BSD 4.3
|
||||
*:BOSX:*:*)
|
||||
echo rs6000-bull-bosx
|
||||
exit 0 ;;
|
||||
DPX/2?00:B.O.S.:*:*)
|
||||
echo m68k-bull-sysv3
|
||||
exit 0 ;;
|
||||
9000/[34]??:4.3bsd:1.*:*)
|
||||
echo m68k-hp-bsd
|
||||
exit 0 ;;
|
||||
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
|
||||
echo m68k-hp-bsd4.4
|
||||
exit 0 ;;
|
||||
9000/[3478]??:HP-UX:*:*)
|
||||
case "${UNAME_MACHINE}" in
|
||||
9000/31? ) HP_ARCH=m68000 ;;
|
||||
9000/[34]?? ) HP_ARCH=m68k ;;
|
||||
9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
|
||||
9000/8?? ) HP_ARCH=hppa1.0 ;;
|
||||
esac
|
||||
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
3050*:HI-UX:*:*)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
|
||||
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
|
||||
results, however. */
|
||||
if (CPU_IS_PA_RISC (cpu))
|
||||
{
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
|
||||
default: puts ("hppa-hitachi-hiuxwe2"); break;
|
||||
}
|
||||
}
|
||||
else if (CPU_IS_HP_MC68K (cpu))
|
||||
puts ("m68k-hitachi-hiuxwe2");
|
||||
else puts ("unknown-hitachi-hiuxwe2");
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
echo hppa1.1-hp-bsd
|
||||
exit 0 ;;
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
||||
echo hppa1.1-hp-osf
|
||||
exit 0 ;;
|
||||
hp8??:OSF1:*:*)
|
||||
echo hppa1.0-hp-osf
|
||||
exit 0 ;;
|
||||
i?86:OSF1:*:*)
|
||||
if [ -x /usr/sbin/sysversion ] ; then
|
||||
echo ${UNAME_MACHINE}-unknown-osf1mk
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-osf1
|
||||
fi
|
||||
exit 0 ;;
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
CRAY*X-MP:*:*:*)
|
||||
echo xmp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY*[A-Z]90:*:*:*)
|
||||
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
|
||||
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
|
||||
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
exit 0 ;;
|
||||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
F300:UNIX_System_V:*:*)
|
||||
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
F301:UNIX_System_V:*:*)
|
||||
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:NetBSD:*:*)
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | *:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:NetBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo i386-pc-cygwin32
|
||||
exit 0 ;;
|
||||
i*:MINGW*:*)
|
||||
echo i386-pc-mingw32
|
||||
exit 0 ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin32
|
||||
exit 0 ;;
|
||||
prep*:SunOS:5.*:*)
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
*:GNU:*:*)
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us.
|
||||
ld_help_string=`ld --help 2>&1`
|
||||
ld_supported_emulations=`echo $ld_help_string \
|
||||
| sed -ne '/supported emulations:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported emulations: *//
|
||||
s/ .*//
|
||||
p'`
|
||||
case "$ld_supported_emulations" in
|
||||
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
|
||||
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
|
||||
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
|
||||
esac
|
||||
|
||||
if test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
sed 's/^ //' <<EOF >dummy.s
|
||||
.globl main
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,0,\$26,0
|
||||
.prologue 0
|
||||
.long 0x47e03d80 # implver $0
|
||||
lda \$2,259
|
||||
.long 0x47e20c21 # amask $2,$1
|
||||
srl \$1,8,\$2
|
||||
sll \$2,2,\$2
|
||||
sll \$0,3,\$0
|
||||
addl \$1,\$0,\$0
|
||||
addl \$2,\$0,\$0
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
EOF
|
||||
LIBC=""
|
||||
${CC-cc} dummy.s -o dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./dummy
|
||||
case "$?" in
|
||||
7)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
15)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
14)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
10)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
16)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
esac
|
||||
|
||||
objdump --private-headers dummy | \
|
||||
grep ld.so.1 > /dev/null
|
||||
if test "$?" = 0 ; then
|
||||
LIBC="libc1"
|
||||
fi
|
||||
fi
|
||||
rm -f dummy.s dummy
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "mips" ; then
|
||||
cat >dummy.c <<EOF
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __MIPSEB__
|
||||
printf ("%s-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
#ifdef __MIPSEL__
|
||||
printf ("%sel-unknown-linux-gnu\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld)
|
||||
# or one that does not give us useful --help.
|
||||
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
|
||||
# If ld does not provide *any* "supported emulations:"
|
||||
# that means it is gnuoldld.
|
||||
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
|
||||
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
|
||||
|
||||
case "${UNAME_MACHINE}" in
|
||||
i?86)
|
||||
VENDOR=pc;
|
||||
;;
|
||||
*)
|
||||
VENDOR=unknown;
|
||||
;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
cat >dummy.c <<EOF
|
||||
#include <features.h>
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
|
||||
# else
|
||||
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
# else
|
||||
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
#else
|
||||
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
fi ;;
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
|
||||
# are messed up and put the nodename in both sysname and nodename.
|
||||
i?86:DYNIX/ptx:4*:*)
|
||||
echo i386-sequent-sysv4
|
||||
exit 0 ;;
|
||||
i?86:UNIX_SV:4.2MP:2.*)
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
# I just have to hope. -- rms.
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
||||
elif /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
pc:*:*:*)
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i386.
|
||||
echo i386-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-pc-mach3
|
||||
exit 0 ;;
|
||||
paragon:*:*:*)
|
||||
echo i860-intel-osf1
|
||||
exit 0 ;;
|
||||
i860:*:4.*:*) # i860-SVR4
|
||||
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
|
||||
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
|
||||
else # Add other i860-SVR4 vendors below as they are discovered.
|
||||
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
|
||||
fi
|
||||
exit 0 ;;
|
||||
mini*:CTIX:SYS*5:*)
|
||||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
|
||||
OS_REL=''
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
|
||||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4 && exit 0 ;;
|
||||
m68*:LynxOS:2.*:*)
|
||||
echo m68k-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i?86:LynxOS:2.*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
echo sparc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
|
||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
echo mips-dde-sysv${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RM*:SINIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
*:SINIX-*:*:*)
|
||||
if uname -p 2>/dev/null >/dev/null ; then
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
echo ${UNAME_MACHINE}-sni-sysv4
|
||||
else
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit 0 ;;
|
||||
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit 0 ;;
|
||||
*:UNIX_System_V:4*:FTX*)
|
||||
# From Gerald Hewes <hewes@openmarket.com>.
|
||||
# How about differentiating between stratus architectures? -djm
|
||||
echo hppa1.1-stratus-sysv4
|
||||
exit 0 ;;
|
||||
*:*:*:FTX*)
|
||||
# From seanf@swdc.stratus.com.
|
||||
echo i860-stratus-sysv4
|
||||
exit 0 ;;
|
||||
mc68*:A/UX:*:*)
|
||||
echo m68k-apple-aux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
news*:NEWS-OS:*:6*)
|
||||
echo mips-sony-newsos6
|
||||
exit 0 ;;
|
||||
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
cat >dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
#if defined (MIPSEB)
|
||||
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
||||
I don't know.... */
|
||||
printf ("mips-sony-bsd\n"); exit (0);
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
printf ("m68k-sony-newsos%s\n",
|
||||
#ifdef NEWSOS4
|
||||
"4"
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
||||
printf ("arm-acorn-riscix"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (hp300) && !defined (hpux)
|
||||
printf ("m68k-hp-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (NeXT)
|
||||
#if !defined (__ARCHITECTURE__)
|
||||
#define __ARCHITECTURE__ "m68k"
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (MULTIMAX) || defined (n16)
|
||||
#if defined (UMAXV)
|
||||
printf ("ns32k-encore-sysv\n"); exit (0);
|
||||
#else
|
||||
#if defined (CMU)
|
||||
printf ("ns32k-encore-mach\n"); exit (0);
|
||||
#else
|
||||
printf ("ns32k-encore-bsd\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__386BSD__)
|
||||
printf ("i386-pc-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (sequent)
|
||||
#if defined (i386)
|
||||
printf ("i386-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#if defined (ns32000)
|
||||
printf ("ns32k-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_SEQUENT_)
|
||||
struct utsname un;
|
||||
|
||||
uname(&un);
|
||||
|
||||
if (strncmp(un.version, "V2", 2) == 0) {
|
||||
printf ("i386-sequent-ptx2\n"); exit (0);
|
||||
}
|
||||
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
|
||||
printf ("i386-sequent-ptx1\n"); exit (0);
|
||||
}
|
||||
printf ("i386-sequent-ptx\n"); exit (0);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (vax)
|
||||
#if !defined (ultrix)
|
||||
printf ("vax-dec-bsd\n"); exit (0);
|
||||
#else
|
||||
printf ("vax-dec-ultrix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (alliant) && defined (i860)
|
||||
printf ("i860-alliant-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
exit (1);
|
||||
}
|
||||
EOF
|
||||
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
|
||||
|
||||
# Convex versions that predate uname can use getsysinfo(1)
|
||||
|
||||
if [ -x /usr/convex/getsysinfo ]
|
||||
then
|
||||
case `getsysinfo -f cpu_type` in
|
||||
c1*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
c2*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
c34*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
c38*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
c4*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
#echo '(Unable to guess system type)' 1>&2
|
||||
|
||||
exit 1
|
954
config.sub
vendored
Executable file
954
config.sub
vendored
Executable file
@@ -0,0 +1,954 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script, version 1.1.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# This file 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.
|
||||
#
|
||||
# This program 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 this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
# that are meaningful with *any* GNU software.
|
||||
# Each package is responsible for reporting which valid configurations
|
||||
# it does not support. The user should be able to distinguish
|
||||
# a failure to support a valid configuration from a meaningless
|
||||
# configuration.
|
||||
|
||||
# The goal of this file is to map all the various variations of a given
|
||||
# machine specification into a single specification in the form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or in some cases, the newer four-part form:
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# It is wrong to echo any other type of specification.
|
||||
|
||||
if [ x$1 = x ]
|
||||
then
|
||||
echo Configuration name missing. 1>&2
|
||||
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
|
||||
echo "or $0 ALIAS" 1>&2
|
||||
echo where ALIAS is a recognized configuration type. 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# First pass through any local machine types.
|
||||
case $1 in
|
||||
*local*)
|
||||
echo $1
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
linux-gnu*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
*)
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
then os=`echo $1 | sed 's/.*-/-/'`
|
||||
else os=; fi
|
||||
;;
|
||||
esac
|
||||
|
||||
### Let's recognize common machines as not being operating systems so
|
||||
### that things like config.sub decstation-3100 work. We also
|
||||
### recognize some manufacturers as not being operating systems, so we
|
||||
### can provide default operating systems below.
|
||||
case $os in
|
||||
-sun*os*)
|
||||
# Prevent following clause from handling this invalid input.
|
||||
;;
|
||||
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
|
||||
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
|
||||
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco5)
|
||||
os=sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco4)
|
||||
os=-sco3.2v4
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2.[4-9]*)
|
||||
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2v[4-9]*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco*)
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-isc)
|
||||
os=-isc2.2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-clix*)
|
||||
basic_machine=clipper-intergraph
|
||||
;;
|
||||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
;;
|
||||
-ptx*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
|
||||
;;
|
||||
-windowsnt*)
|
||||
os=`echo $os | sed -e 's/windowsnt/winnt/'`
|
||||
;;
|
||||
-psos*)
|
||||
os=-psos
|
||||
;;
|
||||
esac
|
||||
|
||||
# Decode aliases for certain CPU-COMPANY combinations.
|
||||
case $basic_machine in
|
||||
# Recognize the basic CPU types without company name.
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
||||
| arme[lb] | pyramid | mn10200 | mn10300 \
|
||||
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
|
||||
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
|
||||
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
|
||||
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| sparc | sparclet | sparclite | sparc64 | v850)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
i[3456]86)
|
||||
basic_machine=$basic_machine-pc
|
||||
;;
|
||||
# Object if more than one company name word.
|
||||
*-*-*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
# Recognize the basic CPU types with company name.
|
||||
vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
|
||||
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
|
||||
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
|
||||
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
|
||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
| sparc64-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| f301-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
|
||||
basic_machine=m68000-att
|
||||
;;
|
||||
3b*)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
alliant | fx80)
|
||||
basic_machine=fx80-alliant
|
||||
;;
|
||||
altos | altos3068)
|
||||
basic_machine=m68k-altos
|
||||
;;
|
||||
am29k)
|
||||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
;;
|
||||
amiga | amiga-*)
|
||||
basic_machine=m68k-cbm
|
||||
;;
|
||||
amigaos | amigados)
|
||||
basic_machine=m68k-cbm
|
||||
os=-amigaos
|
||||
;;
|
||||
amigaunix | amix)
|
||||
basic_machine=m68k-cbm
|
||||
os=-sysv4
|
||||
;;
|
||||
apollo68)
|
||||
basic_machine=m68k-apollo
|
||||
os=-sysv
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
;;
|
||||
balance)
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c2)
|
||||
basic_machine=c2-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c32)
|
||||
basic_machine=c32-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c34)
|
||||
basic_machine=c34-convex
|
||||
os=-bsd
|
||||
;;
|
||||
convex-c38)
|
||||
basic_machine=c38-convex
|
||||
os=-bsd
|
||||
;;
|
||||
cray | ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cray2)
|
||||
basic_machine=cray2-cray
|
||||
os=-unicos
|
||||
;;
|
||||
[ctj]90-cray)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
crds | unos)
|
||||
basic_machine=m68k-crds
|
||||
;;
|
||||
da30 | da30-*)
|
||||
basic_machine=m68k-da30
|
||||
;;
|
||||
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
|
||||
basic_machine=mips-dec
|
||||
;;
|
||||
delta | 3300 | motorola-3300 | motorola-delta \
|
||||
| 3300-motorola | delta-motorola)
|
||||
basic_machine=m68k-motorola
|
||||
;;
|
||||
delta88)
|
||||
basic_machine=m88k-motorola
|
||||
os=-sysv3
|
||||
;;
|
||||
dpx20 | dpx20-*)
|
||||
basic_machine=rs6000-bull
|
||||
os=-bosx
|
||||
;;
|
||||
dpx2* | dpx2*-bull)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv3
|
||||
;;
|
||||
ebmon29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-ebmon
|
||||
;;
|
||||
elxsi)
|
||||
basic_machine=elxsi-elxsi
|
||||
os=-bsd
|
||||
;;
|
||||
encore | umax | mmax)
|
||||
basic_machine=ns32k-encore
|
||||
;;
|
||||
fx2800)
|
||||
basic_machine=i860-alliant
|
||||
;;
|
||||
genix)
|
||||
basic_machine=ns32k-ns
|
||||
;;
|
||||
gmicro)
|
||||
basic_machine=tron-gmicro
|
||||
os=-sysv
|
||||
;;
|
||||
h3050r* | hiux*)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
h8300hms)
|
||||
basic_machine=h8300-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
harris)
|
||||
basic_machine=m88k-harris
|
||||
os=-sysv3
|
||||
;;
|
||||
hp300-*)
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp300bsd)
|
||||
basic_machine=m68k-hp
|
||||
os=-bsd
|
||||
;;
|
||||
hp300hpux)
|
||||
basic_machine=m68k-hp
|
||||
os=-hpux
|
||||
;;
|
||||
hp9k2[0-9][0-9] | hp9k31[0-9])
|
||||
basic_machine=m68000-hp
|
||||
;;
|
||||
hp9k3[2-9][0-9])
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hppa-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i[3456]86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
;;
|
||||
i[3456]86v4*)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv4
|
||||
;;
|
||||
i[3456]86v)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv
|
||||
;;
|
||||
i[3456]86sol2)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
iris | iris4d)
|
||||
basic_machine=mips-sgi
|
||||
case $os in
|
||||
-irix*)
|
||||
;;
|
||||
*)
|
||||
os=-irix4
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
isi68 | isi)
|
||||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
magnum | m3230)
|
||||
basic_machine=mips-mips
|
||||
os=-sysv
|
||||
;;
|
||||
merlin)
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips*-linux*)
|
||||
basic_machine=mips-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
mips3*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
;;
|
||||
news | news700 | news800 | news900)
|
||||
basic_machine=m68k-sony
|
||||
os=-newsos
|
||||
;;
|
||||
news1000)
|
||||
basic_machine=m68030-sony
|
||||
os=-newsos
|
||||
;;
|
||||
news-3600 | risc-news)
|
||||
basic_machine=mips-sony
|
||||
os=-newsos
|
||||
;;
|
||||
next | m*-next )
|
||||
basic_machine=m68k-next
|
||||
case $os in
|
||||
-nextstep* )
|
||||
;;
|
||||
-ns2*)
|
||||
os=-nextstep2
|
||||
;;
|
||||
*)
|
||||
os=-nextstep3
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
nh3000)
|
||||
basic_machine=m68k-harris
|
||||
os=-cxux
|
||||
;;
|
||||
nh[45]000)
|
||||
basic_machine=m88k-harris
|
||||
os=-cxux
|
||||
;;
|
||||
nindy960)
|
||||
basic_machine=i960-intel
|
||||
os=-nindy
|
||||
;;
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
pa-hitachi)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
paragon)
|
||||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
pbb)
|
||||
basic_machine=m68k-tti
|
||||
;;
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5)
|
||||
basic_machine=i586-intel
|
||||
;;
|
||||
pentiumpro | p6)
|
||||
basic_machine=i686-intel
|
||||
;;
|
||||
pentium-* | p5-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
k5)
|
||||
# We don't have specific support for AMD's K5 yet, so just call it a Pentium
|
||||
basic_machine=i586-amd
|
||||
;;
|
||||
nexen)
|
||||
# We don't have specific support for Nexgen yet, so just call it a Pentium
|
||||
basic_machine=i586-nexgen
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
power) basic_machine=rs6000-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
;;
|
||||
ppcle-* | powerpclittle-*)
|
||||
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ps2)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
rm[46]00)
|
||||
basic_machine=mips-siemens
|
||||
;;
|
||||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
sh)
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sps7)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv2
|
||||
;;
|
||||
spur)
|
||||
basic_machine=spur-unknown
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
sun2os3)
|
||||
basic_machine=m68000-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun2os4)
|
||||
basic_machine=m68000-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun3os3)
|
||||
basic_machine=m68k-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun3os4)
|
||||
basic_machine=m68k-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun4os3)
|
||||
basic_machine=sparc-sun
|
||||
os=-sunos3
|
||||
;;
|
||||
sun4os4)
|
||||
basic_machine=sparc-sun
|
||||
os=-sunos4
|
||||
;;
|
||||
sun4sol2)
|
||||
basic_machine=sparc-sun
|
||||
os=-solaris2
|
||||
;;
|
||||
sun3 | sun3-*)
|
||||
basic_machine=m68k-sun
|
||||
;;
|
||||
sun4)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
sun386 | sun386i | roadrunner)
|
||||
basic_machine=i386-sun
|
||||
;;
|
||||
symmetry)
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
tx39el)
|
||||
basic_machine=mipstx39el-unknown
|
||||
;;
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
udi29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
ultra3)
|
||||
basic_machine=a29k-nyu
|
||||
os=-sym1
|
||||
;;
|
||||
vaxv)
|
||||
basic_machine=vax-dec
|
||||
os=-sysv
|
||||
;;
|
||||
vms)
|
||||
basic_machine=vax-dec
|
||||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
vxworks68)
|
||||
basic_machine=m68k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
vxworks29k)
|
||||
basic_machine=a29k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
;;
|
||||
|
||||
# Here we handle the default manufacturer of certain CPU types. It is in
|
||||
# some cases the only manufacturer, in others, it is the most popular.
|
||||
mips)
|
||||
if [ x$os = x-linux-gnu ]; then
|
||||
basic_machine=mips-unknown
|
||||
else
|
||||
basic_machine=mips-mips
|
||||
fi
|
||||
;;
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
rs6000)
|
||||
basic_machine=rs6000-ibm
|
||||
;;
|
||||
vax)
|
||||
basic_machine=vax-dec
|
||||
;;
|
||||
pdp11)
|
||||
basic_machine=pdp11-dec
|
||||
;;
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sparc)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
basic_machine=cydra-cydrome
|
||||
;;
|
||||
orion)
|
||||
basic_machine=orion-highlevel
|
||||
;;
|
||||
orion105)
|
||||
basic_machine=clipper-highlevel
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Here we canonicalize certain aliases for manufacturers.
|
||||
case $basic_machine in
|
||||
*-digital*)
|
||||
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
|
||||
;;
|
||||
*-commodore*)
|
||||
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Decode manufacturer-specific aliases for certain operating systems.
|
||||
|
||||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
;;
|
||||
-solaris)
|
||||
os=-solaris2
|
||||
;;
|
||||
-svr4*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-unixware*)
|
||||
os=-sysv4.2uw
|
||||
;;
|
||||
-gnu/linux*)
|
||||
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
||||
;;
|
||||
# First accept the basic system types.
|
||||
# The portable systems comes first.
|
||||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
-sunos5*)
|
||||
os=`echo $os | sed -e 's|sunos5|solaris2|'`
|
||||
;;
|
||||
-sunos6*)
|
||||
os=`echo $os | sed -e 's|sunos6|solaris3|'`
|
||||
;;
|
||||
-osfrose*)
|
||||
os=-osfrose
|
||||
;;
|
||||
-osf*)
|
||||
os=-osf
|
||||
;;
|
||||
-utek*)
|
||||
os=-bsd
|
||||
;;
|
||||
-dynix*)
|
||||
os=-bsd
|
||||
;;
|
||||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
;;
|
||||
# Preserve the version number of sinix5.
|
||||
-sinix5.*)
|
||||
os=`echo $os | sed -e 's|sinix|sysv|'`
|
||||
;;
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-triton*)
|
||||
os=-sysv3
|
||||
;;
|
||||
-oss*)
|
||||
os=-sysv3
|
||||
;;
|
||||
-svr4)
|
||||
os=-sysv4
|
||||
;;
|
||||
-svr3)
|
||||
os=-sysv3
|
||||
;;
|
||||
-sysvr4)
|
||||
os=-sysv4
|
||||
;;
|
||||
# This must come after -sysvr4.
|
||||
-sysv*)
|
||||
;;
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
# Get rid of the `-' at the beginning of $os.
|
||||
os=`echo $os | sed 's/[^-]*-//'`
|
||||
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
|
||||
# Here we handle the default operating systems that come with various machines.
|
||||
# The value should be what the vendor currently ships out the door with their
|
||||
# machine or put another way, the most popular os provided with the machine.
|
||||
|
||||
# Note that if you're going to try to match "-MANUFACTURER" here (say,
|
||||
# "-sun"), then you have to tell the case statement up towards the top
|
||||
# that MANUFACTURER isn't an operating system. Otherwise, code above
|
||||
# will signal an error saying that MANUFACTURER isn't an operating
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
pdp11-*)
|
||||
os=-none
|
||||
;;
|
||||
*-dec | vax-*)
|
||||
os=-ultrix4.2
|
||||
;;
|
||||
m68*-apollo)
|
||||
os=-domain
|
||||
;;
|
||||
i386-sun)
|
||||
os=-sunos4.0.2
|
||||
;;
|
||||
m68000-sun)
|
||||
os=-sunos3
|
||||
# This also exists in the configure program, but was not the
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
sparc-* | *-sun)
|
||||
os=-sunos4.1.1
|
||||
;;
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-hp)
|
||||
os=-hpux
|
||||
;;
|
||||
*-hitachi)
|
||||
os=-hiux
|
||||
;;
|
||||
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
|
||||
os=-sysv
|
||||
;;
|
||||
*-cbm)
|
||||
os=-amigaos
|
||||
;;
|
||||
*-dg)
|
||||
os=-dgux
|
||||
;;
|
||||
*-dolphin)
|
||||
os=-sysv3
|
||||
;;
|
||||
m68k-ccur)
|
||||
os=-rtu
|
||||
;;
|
||||
m88k-omron*)
|
||||
os=-luna
|
||||
;;
|
||||
*-next )
|
||||
os=-nextstep
|
||||
;;
|
||||
*-sequent)
|
||||
os=-ptx
|
||||
;;
|
||||
*-crds)
|
||||
os=-unos
|
||||
;;
|
||||
*-ns)
|
||||
os=-genix
|
||||
;;
|
||||
i370-*)
|
||||
os=-mvs
|
||||
;;
|
||||
*-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
*-gould)
|
||||
os=-sysv
|
||||
;;
|
||||
*-highlevel)
|
||||
os=-bsd
|
||||
;;
|
||||
*-encore)
|
||||
os=-bsd
|
||||
;;
|
||||
*-sgi)
|
||||
os=-irix
|
||||
;;
|
||||
*-siemens)
|
||||
os=-sysv4
|
||||
;;
|
||||
*-masscomp)
|
||||
os=-rtu
|
||||
;;
|
||||
f301-fujitsu)
|
||||
os=-uxpv
|
||||
;;
|
||||
*)
|
||||
os=-none
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Here we handle the case where we know the os, and the CPU type, but not the
|
||||
# manufacturer. We pick the logical manufacturer.
|
||||
vendor=unknown
|
||||
case $basic_machine in
|
||||
*-unknown)
|
||||
case $os in
|
||||
-riscix*)
|
||||
vendor=acorn
|
||||
;;
|
||||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-hpux*)
|
||||
vendor=hp
|
||||
;;
|
||||
-hiux*)
|
||||
vendor=hitachi
|
||||
;;
|
||||
-unos*)
|
||||
vendor=crds
|
||||
;;
|
||||
-dgux*)
|
||||
vendor=dg
|
||||
;;
|
||||
-luna*)
|
||||
vendor=omron
|
||||
;;
|
||||
-genix*)
|
||||
vendor=ns
|
||||
;;
|
||||
-mvs*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-vxsim* | -vxworks*)
|
||||
vendor=wrs
|
||||
;;
|
||||
-aux*)
|
||||
vendor=apple
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
esac
|
||||
|
||||
echo $basic_machine$os
|
425
configure.in
425
configure.in
@@ -1,102 +1,70 @@
|
||||
dnl
|
||||
dnl Configure script for the Gnome library
|
||||
Mnl Configure script for the Gnome library
|
||||
dnl
|
||||
|
||||
m4_define([libgtop_major_version], [2])
|
||||
m4_define([libgtop_minor_version], [19])
|
||||
m4_define([libgtop_micro_version], [4])
|
||||
m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version])
|
||||
AC_INIT(copyright.txt)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl increment if the interface has additions, changes, removals.
|
||||
m4_define([libgtop_current], [8])
|
||||
AM_INIT_AUTOMAKE(libgtop, 0.01)
|
||||
|
||||
dnl increment any time the source changes; set to
|
||||
dnl 0 if you increment CURRENT
|
||||
m4_define([libgtop_revision], [0])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl increment if any interfaces have been added; set to 0
|
||||
dnl if any interfaces have been removed. removal has
|
||||
dnl precedence over adding, so set to 0 if both happened.
|
||||
m4_define([libgtop_age], [1])
|
||||
AM_ACLOCAL_INCLUDE(macros)
|
||||
|
||||
# Increase each time you change the client/server protocol.
|
||||
m4_define([libgtop_server_version], [5])
|
||||
|
||||
# Version code calculation
|
||||
m4_define([libgtop_version_code], [m4_eval(libgtop_major_version * 1000000 + libgtop_minor_version * 1000 + libgtop_micro_version)])
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT([libgtop], [libgtop_version],
|
||||
[http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop])
|
||||
AC_CONFIG_SRCDIR(copyright.txt)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_SUBST(ACLOCAL_AMFLAGS, [\${ACLOCAL_FLAGS}])
|
||||
|
||||
AC_SUBST(LIBGTOP_MAJOR_VERSION, [libgtop_major_version])
|
||||
AC_SUBST(LIBGTOP_MINOR_VERSION, [libgtop_minor_version])
|
||||
AC_SUBST(LIBGTOP_MICRO_VERSION, [libgtop_micro_version])
|
||||
AC_SUBST(LIBGTOP_SERVER_VERSION, [libgtop_server_version])
|
||||
AC_SUBST(LIBGTOP_VERSION, [libgtop_version])
|
||||
AC_SUBST(LIBGTOP_VERSION_CODE, [libgtop_version_code])
|
||||
|
||||
# libtool versioning
|
||||
AC_SUBST(LT_VERSION_INFO,
|
||||
["-version-info libgtop_current:libgtop_revision:libgtop_age"])
|
||||
|
||||
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I ."
|
||||
|
||||
AC_ISC_POSIX
|
||||
AC_PROG_CC
|
||||
AC_STDC_HEADERS
|
||||
dnl AC_ARG_PROGRAM
|
||||
|
||||
dnl We need this at some places.
|
||||
libgtop_top_builddir=`pwd`
|
||||
AC_SUBST(libgtop_top_builddir)
|
||||
|
||||
dnl We don't use `AC_PROG_AWK' since it checks for mawk first which
|
||||
dnl does not work for libgtop.
|
||||
AC_CHECK_PROGS(AWK, gawk awk, )
|
||||
test -z "$AWK" && AC_MSG_ERROR([Sorry, you need a working awk interpreter.])
|
||||
|
||||
dnl Most people should have a working perl interpreter on their system
|
||||
AC_CHECK_PROGS(PERL, perl5 perl)
|
||||
test -z "$PERL" && AC_MSG_ERROR([You need to have a working perl interpreter.])
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
AC_CHECK_TOOL(CC,gcc)
|
||||
AC_CHECK_TOOL(CXX,g++)
|
||||
AC_CHECK_TOOL(RANLIB,ranlib)
|
||||
AC_CHECK_TOOL(LD,ld)
|
||||
AC_CHECK_TOOL(AS,as)
|
||||
AC_CHECK_TOOL(AR,ar)
|
||||
AC_CHECK_TOOL(NM,nm)
|
||||
|
||||
export CC CXX RANLIB LD AS AR
|
||||
NM=`which $NM`
|
||||
export CC CXX RANLIB LD AS AR NM
|
||||
|
||||
dnl If you want to use libgtop without gnome, comment the following line out.
|
||||
GNOME_INIT
|
||||
|
||||
AC_LC_SYSDEPS
|
||||
|
||||
if test x$libgtop_want_guile = xyes ; then
|
||||
GNOME_CHECK_GUILE
|
||||
if test x$ac_cv_guile_found = xyes ; then
|
||||
if test x$libgtop_want_names = xyes ; then
|
||||
AC_DEFINE(GLIBTOP_GUILE_NAMES)
|
||||
fi
|
||||
guile_examples='third third_static third_linux'
|
||||
guile_subdirs='guile'
|
||||
else
|
||||
guile_examples=
|
||||
guile_subdirs=
|
||||
fi
|
||||
else
|
||||
guile_examples=
|
||||
guile_subdirs=
|
||||
fi
|
||||
|
||||
AC_SUBST(guile_examples)
|
||||
AC_SUBST(guile_subdirs)
|
||||
|
||||
AC_ISC_POSIX
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_STDC_HEADERS
|
||||
AC_ARG_PROGRAM
|
||||
AM_PROG_LEX
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
export cross_compiling
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
|
||||
|
||||
GNOME_LIBGTOP_SYSDEPS
|
||||
GNOME_LIBGTOP_TYPES
|
||||
|
||||
GLIB_REQUIRED=2.6.0
|
||||
|
||||
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED)
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
|
||||
AC_CHECK_HEADER(ifaddrs.h, [HAVE_IFADDRS_H=yes], [HAVE_IFADDRS_H=no])
|
||||
if test x$HAVE_IFADDRS_H = xyes ; then
|
||||
AC_DEFINE(HAVE_IFADDRS_H, 1, [defined if you have ifaddrs.h])
|
||||
fi
|
||||
dnl You need to uncomment the following line if you want to use libgtop without Gnome.
|
||||
dnl GNOME_SUPPORT_CHECKS
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
@@ -114,95 +82,11 @@ AC_CHECK_TYPE(ssize_t, int)
|
||||
AC_CHECK_HEADERS(memory.h)
|
||||
AC_CHECK_HEADERS(string.h strings.h, break)
|
||||
AC_REPLACE_FUNCS(strerror)
|
||||
|
||||
dnl dlopen() and dlsym()
|
||||
DL_LIB=
|
||||
AC_CHECK_FUNCS(dlopen,,[
|
||||
AC_CHECK_LIB(dl, dlopen, DL_LIB="-ldl", [
|
||||
AC_CHECK_LIB(dld, shl_load, DL_LIB="-ldld", [
|
||||
AC_CHECK_FUNCS(dlopen, DL_LIB="", DL_LIB="")
|
||||
])
|
||||
])
|
||||
])
|
||||
oLIBS="$LIBS"
|
||||
LIBS="$LIBS $DL_LIB"
|
||||
AC_CHECK_FUNCS(dlerror,,)
|
||||
LIBS="$oLIBS"
|
||||
AC_SUBST(DL_LIB)
|
||||
|
||||
dnl Linux
|
||||
AC_CHECK_HEADER(linux/isdn.h,[HAVE_ISDN_H=yes],[HAVE_ISDN_H=no])
|
||||
if test x$HAVE_ISDN_H = xyes ; then
|
||||
AC_DEFINE(HAVE_ISDN_H, 1, [defined if you have linux/isdn.h])
|
||||
fi
|
||||
|
||||
dnl AIX
|
||||
AC_CHECK_LIB(perfstat, vmgetinfo,
|
||||
AC_DEFINE(HAVE_VMGETINFO, 1,
|
||||
[Define to 1 if you have the 'vmgetinfo' function in libperfstat]))
|
||||
|
||||
dnl Solaris
|
||||
case "$host_os" in
|
||||
solaris*)
|
||||
AC_CHECK_LIB(kstat, kstat_open)
|
||||
AC_CHECK_FUNCS(getloadavg swapctl)
|
||||
AC_CHECK_HEADERS(procfs.h sys/procfs.h, break)
|
||||
|
||||
|
||||
dnl Some versions of Solaris require -lelf for -lkvm
|
||||
case $host_os in
|
||||
solaris[[8-9]] | solaris2.[[0-9]].*)
|
||||
AC_CHECK_LIB(kvm, kvm_open,[
|
||||
LIBS="-lkvm $LIBS"
|
||||
],[AC_MSG_CHECKING(for kvm_open in -lkvm with -lelf)
|
||||
AC_CACHE_VAL(ac_cv_lib_kvm_with_elf,
|
||||
[ac_save_LIBS="$LIBS"
|
||||
LIBS="-lkvm -lelf $LIBS"
|
||||
AC_TRY_LINK([char kvm_open();], [kvm_open()],
|
||||
ac_cv_lib_kvm_with_elf=yes, ac_cv_lib_kvm_with_elf=no)
|
||||
LIBS="$ac_save_LIBS"
|
||||
])
|
||||
if test "$ac_cv_lib_kvm_with_elf" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBS="-lkvm -lelf $LIBS"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
AC_CHECK_LIB(kvm, kvm_open)
|
||||
|
||||
dnl For DEC OSF1
|
||||
AC_CHECK_LIB(mach, vm_statistics)
|
||||
|
||||
dnl For some broken libc5 systems (Debian 1.3)
|
||||
saved_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS -D_GNU_SOURCE"
|
||||
GCC_NEED_DECLARATION(program_invocation_name, [
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
])
|
||||
|
||||
CFLAGS=$saved_CFLAGS
|
||||
|
||||
AC_CHECK_FUNC(socket,
|
||||
[AC_CHECK_HEADER(netinet/in.h,
|
||||
[AC_CHECK_HEADER(arpa/inet.h, [
|
||||
AC_DEFINE(HAVE_SOCKETS, 1, [Define if BSD sockets are supported])
|
||||
AC_MSG_CHECKING("for sun_len member in struct sockaddr_un")
|
||||
AC_TRY_LINK([
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
],
|
||||
[static struct sockaddr_un x; x.sun_len = 1;],
|
||||
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un has a sun_len member])],
|
||||
[AC_MSG_RESULT(no)])])])])
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_ALLOCA
|
||||
AC_FUNC_MMAP
|
||||
@@ -210,185 +94,116 @@ AC_TYPE_SIGNAL
|
||||
AC_FUNC_STRFTIME
|
||||
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
|
||||
|
||||
IT_PROG_INTLTOOL([0.35.0])
|
||||
ALL_LINGUAS=""
|
||||
AM_GNU_GETTEXT
|
||||
|
||||
GETTEXT_PACKAGE=libgtop-2.0
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
|
||||
[Define to the gettext package used by the library])
|
||||
CFLAGS="$CFLAGS -D_IN_LIBGTOP"
|
||||
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
GLIB_DEFINE_LOCALEDIR([GTOPLOCALEDIR])
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(CPPFLAGS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
|
||||
AC_PATH_XTRA
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(GNOME_ENABLE_DEBUG),)
|
||||
|
||||
dnl For Solaris
|
||||
dnl Please don't move this before AC_PATH_XTRA
|
||||
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
|
||||
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
|
||||
AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)])
|
||||
dnl If you want to use libgtop without gnome, uncomment the following paragraph:
|
||||
dnl LIBSUPPORT=
|
||||
dnl SUPPORTINCS=
|
||||
dnl if test "$need_gnome_support" = yes; then
|
||||
dnl LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
|
||||
dnl SUPPORTINCS='-I$(top_srcdir)/support'
|
||||
dnl fi
|
||||
dnl AC_SUBST(LIBSUPPORT)
|
||||
dnl AC_SUBST(SUPPORTINCS)
|
||||
|
||||
dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n
|
||||
dnl So we use the following instead.
|
||||
dnl XE_SPACE(var, words)
|
||||
define([XE_SPACE],[
|
||||
T=""
|
||||
for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
|
||||
$1="$T"
|
||||
])dnl
|
||||
|
||||
dnl Autodetect Xauth
|
||||
dnl -lXau is only used by gnuclient, so use a special variable for Xauth X libs
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
||||
test -z "$with_xauth" && { AC_CHECK_HEADER(X11/Xauth.h, ,with_xauth=no) }
|
||||
test -z "$with_xauth" && { AC_CHECK_LIB(Xau, XauGetAuthByAddr,[:],with_xauth=no, $X_LIBS) }
|
||||
test -z "$with_xauth" && with_xauth=yes
|
||||
if test "$with_xauth" = "yes"; then
|
||||
AC_DEFINE(HAVE_XAUTH, 1, [Define if Xauth is supported])
|
||||
XE_SPACE(libs_xauth, $X_LIBS -lXau)
|
||||
dnl Some ugly hack; if '-lgnomesupport' is part of $GNOME_LIBS, we include it here.
|
||||
echo "$GNOME_LIBS" | grep -q -e '-lgnomesupport'
|
||||
if test $? = 0 ; then
|
||||
LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
|
||||
SUPPORTINCS="$GNOME_INCLUDEDIR"
|
||||
fi
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
AC_SUBST(libs_xauth)
|
||||
|
||||
dnl For diskusage stuff
|
||||
GNOME_FILEUTILS_CHECKS
|
||||
|
||||
dnl Debugging
|
||||
AC_ARG_ENABLE(debug,
|
||||
AS_HELP_STRING([--enable-debug],
|
||||
[Turn on debugging @<:@default=no@:>@]),
|
||||
AC_DEFINE(LIBGTOP_ENABLE_DEBUG, 1, [Define to enable debugging]))
|
||||
AC_ARG_ENABLE(fatal-warnings,
|
||||
AS_HELP_STRING([--enable-fatal-warnings],
|
||||
[Make all warnings fatal @<:@debug=no@:>@]),
|
||||
AC_DEFINE(LIBGTOP_FATAL_WARNINGS, 1,
|
||||
[Define to enable fatal warnings]))
|
||||
AC_SUBST(LIBSUPPORT)
|
||||
AC_SUBST(SUPPORTINCS)
|
||||
|
||||
dnl These definitions are expanded in make.
|
||||
LIBGTOP_LIBS='-L$(libdir)'
|
||||
LIBGTOP_INCS='-I$(includedir)/libgtop-2.0'
|
||||
|
||||
if test x$libgtop_use_machine_h = xyes ; then
|
||||
LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_GLIBTOP_MACHINE_H"
|
||||
fi
|
||||
|
||||
if test x$libgtop_smp = xyes ; then
|
||||
LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SMP"
|
||||
fi
|
||||
|
||||
if test x$libgtop_have_sysinfo = xyes ; then
|
||||
LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SYSINFO"
|
||||
fi
|
||||
|
||||
LIBGTOP_INCS="$LIBGTOP_INCS $GLIB_CFLAGS"
|
||||
|
||||
libgtop_save_prefix="$prefix"
|
||||
libgtop_save_exec_prefix="$exec_prefix"
|
||||
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
||||
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
|
||||
LIBGTOP_BINDIR=`eval echo "${bindir}"`
|
||||
LIBGTOP_SERVER=`eval echo "${bindir}/libgtop_server2"`
|
||||
prefix="$libgtop_save_prefix"
|
||||
exec_prefix="$libgtop_save_exec_prefix"
|
||||
LIBGTOP_INCS='-I$(includedir)'
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_LIBS"
|
||||
LIBGTOP_GUILE_INCS="$LIBGTOP_INCS"
|
||||
LIBGTOP_BINDIR='$(bindir)'
|
||||
LIBGTOP_SERVER='$(bindir)/gtop_server'
|
||||
|
||||
sysdeps_dir="$libgtop_sysdeps_dir"
|
||||
AC_SUBST(sysdeps_dir)
|
||||
|
||||
if test -z "$LIBGTOP_EXTRA_LIBS" ; then
|
||||
LIBGTOP_EXTRA_LIBS="$libs_xauth"
|
||||
if test x$ac_cv_guile_found = xyes ; then
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_guile"
|
||||
libgtop_guile_found=yes
|
||||
else
|
||||
LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $libs_xauth"
|
||||
libgtop_guile_found=no
|
||||
fi
|
||||
|
||||
LIBGTOP_EXTRA_LIBS="$GLIB_LIBS $LIBGTOP_EXTRA_LIBS"
|
||||
AC_SUBST(libgtop_guile_found)
|
||||
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS"
|
||||
if test x$libgtop_want_names = xyes ; then
|
||||
if test x$ac_cv_guile_found = xyes ; then
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_guile_names"
|
||||
libgtop_want_guile_names=yes
|
||||
else
|
||||
libgtop_want_guile_names=no
|
||||
fi
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_names"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_names"
|
||||
fi
|
||||
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS"
|
||||
AC_SUBST(libgtop_want_guile_names)
|
||||
|
||||
machine_incs="-I\$(top_srcdir)/sysdeps/$sysdeps_dir"
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_common"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_common"
|
||||
|
||||
if test "x$need_server" = "xyes" ; then
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop"
|
||||
else
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_sysdeps"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_sysdeps"
|
||||
fi
|
||||
|
||||
if test "x$ac_cv_guile_found" = "xyes" ; then
|
||||
LIBGTOP_INCS="$LIBGTOP_INCS $GUILE_INCS"
|
||||
LIBGTOP_GUILE_INCS="$LIBGTOP_INCS $GUILE_INCS"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS $GUILE_LIBS"
|
||||
fi
|
||||
|
||||
if test "x$libgtop_use_machine_h" = "xyes" ; then
|
||||
machine_incs='-I$(top_srcdir)/sysdeps/@sysdeps_dir@'
|
||||
fi
|
||||
|
||||
AC_SUBST(machine_incs)
|
||||
|
||||
if test "$GCC" = "yes" ; then
|
||||
CFLAGS="\
|
||||
-Winline \
|
||||
-Wall \
|
||||
-std=gnu89 \
|
||||
-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
|
||||
-Wnested-externs -Wpointer-arith \
|
||||
-Wcast-align -Wsign-compare \
|
||||
$CFLAGS"
|
||||
fi
|
||||
|
||||
INCLUDES="-I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include $GLIB_CFLAGS $X_CFLAGS"
|
||||
|
||||
# Add various defines to the config.h file ...
|
||||
AH_VERBATIM([_GNU_SOURCE],
|
||||
[/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE
|
||||
#endif])
|
||||
AC_DEFINE([_IN_LIBGTOP], 1,
|
||||
[Note that we are building libgtop rather than using it])
|
||||
AC_DEFINE([LIBGTOP_VERSION], ["libgtop_version"],
|
||||
[The libgtop version number])
|
||||
AC_DEFINE([LIBGTOP_SERVER_VERSION], ["libgtop_server_version"],
|
||||
[The libgtop server version])
|
||||
AC_DEFINE([LIBGTOP_VERSION_CODE], [libgtop_version_code],
|
||||
[The libgtop version number as an integer])
|
||||
AC_DEFINE_UNQUOTED([LIBGTOP_SERVER], ["$LIBGTOP_SERVER"],
|
||||
[The path to the libgtop server])
|
||||
|
||||
AC_SUBST(INCLUDES)
|
||||
|
||||
AC_SUBST(LIBGTOP_EXTRA_LIBS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
AC_SUBST(LIBGTOP_LIBS)
|
||||
AC_SUBST(LIBGTOP_INCS)
|
||||
AC_SUBST(LIBGTOP_GUILE_LIBS)
|
||||
AC_SUBST(LIBGTOP_GUILE_INCS)
|
||||
AC_SUBST(LIBGTOP_BINDIR)
|
||||
AC_SUBST(LIBGTOP_SERVER)
|
||||
|
||||
if test x$libgtop_need_server = xyes ; then
|
||||
sysdeps_suid_lib="\$(top_builddir)/sysdeps/\$(sysdeps_dir)/libgtop_sysdeps_suid-2.0.la"
|
||||
server_programs='libgtop_server2'
|
||||
else
|
||||
sysdeps_suid_lib=
|
||||
server_programs=
|
||||
fi
|
||||
AC_SUBST(sysdeps_suid_lib)
|
||||
AC_SUBST(server_programs)
|
||||
|
||||
GTK_DOC_CHECK(1.4)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
libgtop.spec
|
||||
po/Makefile.in
|
||||
misc/Makefile
|
||||
intl/Makefile
|
||||
include/Makefile
|
||||
include/glibtop/Makefile
|
||||
sysdeps/Makefile
|
||||
sysdeps/common/Makefile
|
||||
sysdeps/names/Makefile
|
||||
sysdeps/guile/Makefile
|
||||
sysdeps/guile/names/Makefile
|
||||
sysdeps/stub/Makefile
|
||||
sysdeps/stub_suid/Makefile
|
||||
sysdeps/sun4/Makefile
|
||||
sysdeps/osf1/Makefile
|
||||
sysdeps/linux/Makefile
|
||||
sysdeps/freebsd/Makefile
|
||||
sysdeps/solaris/Makefile
|
||||
sysdeps/aix/Makefile
|
||||
sysdeps/bsd/Makefile
|
||||
src/Makefile
|
||||
src/daemon/Makefile
|
||||
src/server/Makefile
|
||||
lib/Makefile
|
||||
examples/Makefile
|
||||
doc/Makefile
|
||||
doc/reference/Makefile
|
||||
doc/reference/version.xml
|
||||
libgtop-2.0.pc
|
||||
libgtopconfig.h
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
macros/Makefile],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
|
||||
|
@@ -1,22 +1,21 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 2.0.
|
||||
/* $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.
|
||||
Contributed by Benoît Dejean <TazForEver@dlfp.org>, 2004.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
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. */
|
||||
|
||||
|
9
debian/README.Debian
vendored
9
debian/README.Debian
vendored
@@ -1,9 +0,0 @@
|
||||
LibGTop CVS snapshots for Debian
|
||||
--------------------------------
|
||||
|
||||
This is a debian package made from a stable release of LibGTop, but it
|
||||
should be considered "unofficial" since I'm not a Debian Maintainer.
|
||||
|
||||
|
||||
Martin Baulig <martin@home-of-linux.org>, Wed, 16 Feb 2000 16:40:50 +0100
|
||||
|
121
debian/changelog
vendored
121
debian/changelog
vendored
@@ -1,121 +0,0 @@
|
||||
libgtop (1.0.7-1) unstable; urgency=low
|
||||
* New upstream source (1.0.7 "Copenhagen" release)
|
||||
* Non-maintainer upload; since I'm not a Debian maintainer, this is some
|
||||
kind of "unofficial" debian package for LibGTop 1.0.7 - but I think it
|
||||
can be considered stable and working.
|
||||
|
||||
-- Martin Baulig <martin@home-of-linux.org> Wed, 16 Feb 2000 16:40:50 +0100
|
||||
|
||||
libgtop (1.0.6-1) unstable; urgency=low
|
||||
* New upstream source
|
||||
|
||||
-- Ian Lynagh (wibble) <igloo@debian.org> Wed, 20 Oct 1999 16:16:27 +0100
|
||||
|
||||
libgtop (1.0.4.5pre1-1) frozen unstable; urgency=low
|
||||
* New upstream source (1.0.5 pre release)
|
||||
* Maintainer e-mail address changed to igloo@debian.org
|
||||
|
||||
-- Ian Lynagh (wibble) <igloo@debian.org> Thu, 30 Sep 1999 22:37:33 +0100
|
||||
|
||||
libgtop (1.0.4-1) frozen unstable; urgency=low
|
||||
* New upstream source
|
||||
* Removed nasty sed stuff from the rules in favour of make install prefix=...
|
||||
* Added .la files to libgtop-dev
|
||||
* Added info to the copyright file
|
||||
* Wrote simple man page for libgtop-config.
|
||||
* Recompiled with later debhelper so docs go to /usr/share/doc as per FHS
|
||||
* changed infodir to /usr/share/info
|
||||
|
||||
-- Ian Lynagh (wibble) <igloo@debian.org> Mon, 20 Sep 1999 00:06:16 +0100
|
||||
|
||||
libgtop (1.0.1-2) frozen unstable; urgency=low
|
||||
|
||||
* Didn't actually use wildcards in libgtop-dev.files because tar complained
|
||||
* Set section names properly
|
||||
|
||||
-- Ian Lynagh <ian@lynagh.demon.co.uk> Sun, 7 Mar 1999 00:53:50 +0000
|
||||
|
||||
libgtop (1.0.1-1) frozen unstable; urgency=low
|
||||
|
||||
* SONAME changed back to 1. Fun fun fun.
|
||||
* Added RELNOTES-1.0 to debian/libgtop1.docs and debian/rules
|
||||
* Changed libgtop1.README.Debian to at least make sense
|
||||
* Used wildcards in libgtop-dev.files
|
||||
|
||||
-- Ian Lynagh <ian@lynagh.demon.co.uk> Sun, 7 Mar 1999 00:53:50 +0000
|
||||
|
||||
libgtop (1.0.1-0.1) unstable; urgency=low
|
||||
|
||||
* Non-maintainer upload for GNOME 1.0
|
||||
|
||||
-- Jules Bean <jules@debian.org> Thu, 4 Mar 1999 22:34:12 +0000
|
||||
|
||||
libgtop (0.99.2-0.2) unstable; urgency=low
|
||||
|
||||
* Oops, forgot some files.
|
||||
|
||||
-- Jim Pick <jim@jimpick.com> Sun, 24 Jan 1999 02:12:24 -0800
|
||||
|
||||
libgtop (0.99.2-0.1) unstable; urgency=low
|
||||
|
||||
* Non-maintainer upload.
|
||||
* New upstream source.
|
||||
* SONAME is now 0 again. Hmmm.
|
||||
|
||||
-- Jim Pick <jim@jimpick.com> Sat, 23 Jan 1999 20:21:38 -0800
|
||||
|
||||
libgtop (0.26.2-4) frozen unstable; urgency=low
|
||||
|
||||
* Upstream changelog installed as changelog
|
||||
* debian/shlibs.local removed in favour of the LD_LIBRARY_PATH line
|
||||
|
||||
-- Ian Lynagh <ian@lynagh.demon.co.uk> Thu, 26 Nov 1998 17:20:24 +0000
|
||||
|
||||
libgtop (0.26.2-3.1) frozen unstable; urgency=low
|
||||
|
||||
* Non-maintainer upload.
|
||||
* Upload to frozen, corrects Bug #29110, Bug #29111, which were
|
||||
already fixed.
|
||||
* Noticed that guile option is no longer being used, so I removed
|
||||
the dependency.
|
||||
* Added changelog (to fix lintian error).
|
||||
* Changed control file to use macro substitutions. This is a much
|
||||
less error-prone way of building dependencies than doing them by
|
||||
hand.
|
||||
* Added -V option to dh_makeshlibs to put version number on shlibs
|
||||
file.
|
||||
* Added shlibs.local file with null entry for "libgtop 1" (and
|
||||
others) so libgtop1 doesn't declare a relationship on itself.
|
||||
|
||||
-- Jim Pick <jim@jimpick.com> Wed, 25 Nov 1998 12:03:12 -0800
|
||||
|
||||
libgtop (0.26.2-3) frozen unstable; urgency=low
|
||||
|
||||
* libgtop0 changed to libgtop1
|
||||
* Added an #ifndef strstr around the prototype of strstr in
|
||||
sysdeps/common/mountlist.c as this is a macro under glibc 2.1.
|
||||
|
||||
-- Ian Lynagh <ian@lynagh.demon.co.uk> Sun, 8 Nov 1998 12:06:09 +0000
|
||||
|
||||
libgtop (0.26.2-2) frozen unstable; urgency=low
|
||||
|
||||
* Fixes minor bugs in debian/rules
|
||||
|
||||
-- Ian Lynagh <ian@lynagh.demon.co.uk> Fri, 16 Oct 1998 05:30:16 +0200
|
||||
|
||||
libgtop (0.26.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream version
|
||||
* Non-maintainer release
|
||||
|
||||
-- Martin Schulze <joey@finlandia.infodrom.north.de> Fri, 16 Oct 1998 05:30:16 +0200
|
||||
|
||||
libgtop (0.26.0-1) unstable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
-- Jim Pick <jim@jimpick.com> Thu, 24 Sep 1998 18:42:48 -0700
|
||||
|
||||
Local variables:
|
||||
mode: debian-changelog
|
||||
End:
|
33
debian/control.in
vendored
33
debian/control.in
vendored
@@ -1,33 +0,0 @@
|
||||
Source: libgtop@SUFFIX@
|
||||
Maintainer: Martin Baulig <martin@home-of-linux.org>
|
||||
Section: libs
|
||||
Priority: optional
|
||||
Standards-Version: 3.0.0
|
||||
|
||||
Package: libgtop1@SUFFIX@
|
||||
Architecture: any
|
||||
Section: libs
|
||||
Depends: ${shlibs:Depends}
|
||||
Description: Portable system access library (part of Gnome)
|
||||
Gnome is the "GNU Network Object Model Environment"
|
||||
.
|
||||
It is a project to build a complete, user-friendly desktop based
|
||||
entirely on free software.
|
||||
.
|
||||
This package contains the gtop libraries which read information about
|
||||
processes and the running systems.
|
||||
|
||||
Package: libgtop-dev@SUFFIX@
|
||||
Architecture: any
|
||||
Section: devel
|
||||
Depends: libgtop1@SUFFIX@ (= ${Source-Version})
|
||||
Description: Dev libraries for the portable system access library (part of Gnome)
|
||||
Gnome is the "GNU Network Object Model Environment"
|
||||
.
|
||||
It is a project to build a complete, user-friendly desktop based
|
||||
entirely on free software.
|
||||
.
|
||||
This package contains the include files and static library for the
|
||||
gtop libraries which read information about processes and the running
|
||||
systems.
|
||||
|
109
debian/debconfigure
vendored
109
debian/debconfigure
vendored
@@ -1,109 +0,0 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# debconfigure
|
||||
#
|
||||
# A script to generate a debian/rules file, with options.
|
||||
#
|
||||
# By Jim Pick <jim@jimpick.com>, GPL'd of course.
|
||||
# Adjusted for LibGTop by Martin Baulig <martin@home-of-linux.org>
|
||||
#
|
||||
|
||||
if [ ! -r rules.in ]; then
|
||||
echo "Please run the debconfigure script in the debian directory" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
debtype='official'
|
||||
prefix='/usr'
|
||||
gnomeprefix='/usr'
|
||||
localstatedir='/var/lib'
|
||||
pkgsuffix=''
|
||||
|
||||
for dc_option
|
||||
do
|
||||
case "$dc_option" in
|
||||
-*=*) dc_optarg=`echo "$dc_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) dc_optarg= ;;
|
||||
esac
|
||||
|
||||
case "$dc_option" in
|
||||
|
||||
--clean)
|
||||
rm -f control rules *~ core *files *menu *substvars *.postinst *.debhelper
|
||||
exit ;;
|
||||
|
||||
--prefix=*)
|
||||
prefix="$dc_optarg" ;;
|
||||
|
||||
--localstatedir=*)
|
||||
prefix="$dc_optarg" ;;
|
||||
|
||||
--pkgsuffix=*)
|
||||
pkgsuffix="$dc_optarg" ;;
|
||||
|
||||
--gnome-prefix=*)
|
||||
gnomeprefix="$dc_optarg" ;;
|
||||
|
||||
--debtype=*)
|
||||
debtype="$dc_optarg" ;;
|
||||
|
||||
*)
|
||||
cat <<EOF 1>&2
|
||||
Usage: debconfigure [options]
|
||||
Options: [defaults in brackets after descriptions]
|
||||
--help print this message
|
||||
--clean remove generated files
|
||||
--prefix=PREFIX install files under under PREFIX dir [/usr]
|
||||
--gnome-prefix=PREFIX look for GNOME under PREFIX dir [/usr]
|
||||
--localstatedir=DIR directory for things like game scores [/var/lib]
|
||||
--pkgsuffix=SUFFIX append SUFFIX onto package names []
|
||||
--debtype=DEBTYPE enable macros with the name of DEBTYPE [official]
|
||||
EOF
|
||||
exit ;;
|
||||
|
||||
esac
|
||||
done
|
||||
|
||||
# Strip leading slash
|
||||
prefix=`expr $prefix : '/\(.*\)'`
|
||||
gnomeprefix=`expr $gnomeprefix : '/\(.*\)'`
|
||||
localstatedir=`expr $localstatedir : '/\(.*\)'`
|
||||
|
||||
for infile in `ls control.in rules.in`
|
||||
do
|
||||
tofile=`expr $infile : '\(.*\)\.in'`
|
||||
cat $infile | \
|
||||
sed "s,@SUFFIX@,$pkgsuffix,g" | \
|
||||
sed "s,@PREFIX@,$prefix,g" | \
|
||||
sed "s,@GNOMEPREFIX@,$gnomeprefix,g" | \
|
||||
sed "s,@LOCALSTATEDIR@,$localstatedir,g" | \
|
||||
sed "s,%$debtype>,," | sed '/^%/d' > $tofile
|
||||
done
|
||||
chmod +x rules
|
||||
|
||||
for filesfile in `ls *.files.in`
|
||||
do
|
||||
tofile=`expr $filesfile : '\(.*\)\.files\.in'`
|
||||
tofile=`echo $tofile$pkgsuffix.files`
|
||||
cat $filesfile | \
|
||||
sed "s,@SUFFIX@,$pkgsuffix,g" | \
|
||||
sed "s,@PREFIX@,$prefix,g" | \
|
||||
sed "s,@GNOMEPREFIX@,$gnomeprefix,g" | \
|
||||
sed "s,@LOCALSTATEDIR@,$localstatedir,g" | \
|
||||
sed "s,%$debtype>,," | sed '/^%/d' > $tofile
|
||||
done
|
||||
|
||||
for postinst in libgtop1$pkgsuffix
|
||||
do
|
||||
|
||||
cat > $postinst.postinst <<EOF
|
||||
#! /bin/sh
|
||||
|
||||
set -e
|
||||
ldconfig
|
||||
|
||||
#DEBHELPER#
|
||||
EOF
|
||||
|
||||
done
|
||||
|
34
debian/libgtop-config.1
vendored
34
debian/libgtop-config.1
vendored
@@ -1,34 +0,0 @@
|
||||
.TH GTOP l "15 September 1999"
|
||||
.SH NAME
|
||||
\fBlibgtop-config\fP \- libgtop libraries and component information retrieval.
|
||||
.SH SYNTAX
|
||||
.B libgtop-config
|
||||
.RI [ --version ]
|
||||
.RI [ --config ]
|
||||
.RI [ --features-def-file ]
|
||||
.SH DESCRIPTION
|
||||
.B libgtop-config
|
||||
is used to retrieve information from installed libraries in the system.
|
||||
|
||||
This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page.
|
||||
.LP
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-\-version
|
||||
.PD
|
||||
Prints the version of libgtop that you're using.
|
||||
.TP
|
||||
.B \-\-config
|
||||
.PD
|
||||
Prints the location of libgtopConf.sh.
|
||||
.TP
|
||||
.B \-\-version
|
||||
.PD
|
||||
Prints the location of libgtop-features.def.
|
||||
.SH BUGS
|
||||
None known
|
||||
|
||||
.SH AUTHORS
|
||||
Martin Baulig (martin@home-of-linux.org)
|
||||
.TP
|
||||
Josh Sled (jsled@scam.XCF.Berkeley.EDU)
|
21
debian/libgtop-dev.files.in
vendored
21
debian/libgtop-dev.files.in
vendored
@@ -1,21 +0,0 @@
|
||||
@PREFIX@/lib/libgtop.a
|
||||
@PREFIX@/lib/libgtop_common.a
|
||||
@PREFIX@/lib/libgtop_suid_common.a
|
||||
@PREFIX@/lib/libgtop_sysdeps.a
|
||||
@PREFIX@/lib/libgtop.la
|
||||
@PREFIX@/lib/libgtop_common.la
|
||||
@PREFIX@/lib/libgtop_suid_common.la
|
||||
@PREFIX@/lib/libgtop_sysdeps.la
|
||||
@PREFIX@/lib/libgtopConf.sh
|
||||
@PREFIX@/lib/libgtop.so
|
||||
@PREFIX@/lib/libgtop_common.so
|
||||
@PREFIX@/lib/libgtop_suid_common.so
|
||||
@PREFIX@/lib/libgtop_sysdeps.so
|
||||
@PREFIX@/lib/libgtop-features.def
|
||||
@PREFIX@/lib/libgtop/include/*.h
|
||||
@PREFIX@/include/glibtop/*.h
|
||||
@PREFIX@/include/glibtop.h
|
||||
@PREFIX@/include/glibtop_server.h
|
||||
@PREFIX@/include/glibtop_machine.h
|
||||
@PREFIX@/info/libgtop.info
|
||||
@PREFIX@/bin/libgtop-config
|
5
debian/libgtop1.README.Debian
vendored
5
debian/libgtop1.README.Debian
vendored
@@ -1,5 +0,0 @@
|
||||
|
||||
The Debian package of libgtop, a GNOME library.
|
||||
|
||||
--
|
||||
Martin Baulig <martin@home-of-linux.org>
|
12
debian/libgtop1.copyright
vendored
12
debian/libgtop1.copyright
vendored
@@ -1,12 +0,0 @@
|
||||
|
||||
libgtop is released under the GPL.
|
||||
On Debian GNU/Linux systems, the complete text of the GNU General
|
||||
Public License can be found in /usr/share/common-licenses/GPL
|
||||
|
||||
Original authors: Martin Baulig <martin@home-of-linux.org>
|
||||
Drazen Kacar <dave@srce.hr>
|
||||
|
||||
Originally Debianised by Jim Pick <jim@jimpick.com>
|
||||
Then re-Debianised in October 1998 by Martin Schulze
|
||||
<joey@finlandia.infodrom.north.de> before being taken over by Ian Lynagh
|
||||
<ian@lynagh.demon.co.uk> in November 1998.
|
5
debian/libgtop1.docs
vendored
5
debian/libgtop1.docs
vendored
@@ -1,5 +0,0 @@
|
||||
RELNOTES-0.25
|
||||
RELNOTES-1.0.x
|
||||
NEWS
|
||||
AUTHORS
|
||||
debian/changelog
|
4
debian/libgtop1.files.in
vendored
4
debian/libgtop1.files.in
vendored
@@ -1,4 +0,0 @@
|
||||
@PREFIX@/lib/libgtop*.so.[0-9].[0-9][0-9].[0-9]
|
||||
@PREFIX@/lib/libgtop*.so.[0-9].[0-9].[0-9]
|
||||
@PREFIX@/lib/libgtop*.so.[0-9]
|
||||
@PREFIX@/share/locale/*/*/libgtop.mo
|
5
debian/libgtop2.README.Debian
vendored
5
debian/libgtop2.README.Debian
vendored
@@ -1,5 +0,0 @@
|
||||
|
||||
The Debian package of libgtop, a GNOME library.
|
||||
|
||||
--
|
||||
Ian Lynagh <ian@lynagh.demon.co.uk>
|
12
debian/libgtop2.copyright
vendored
12
debian/libgtop2.copyright
vendored
@@ -1,12 +0,0 @@
|
||||
|
||||
libgtop is released under the GPL.
|
||||
On Debian GNU/Linux systems, the complete text of the GNU General
|
||||
Public License can be found in /usr/share/common-licenses/GPL
|
||||
|
||||
Original authors: Martin Baulig <martin@home-of-linux.org>
|
||||
Drazen Kacar <dave@srce.hr>
|
||||
|
||||
Originally Debianised by Jim Pick <jim@jimpick.com>
|
||||
Then re-Debianised in October 1998 by Martin Schulze
|
||||
<joey@finlandia.infodrom.north.de> before being taken over by Ian Lynagh
|
||||
<ian@lynagh.demon.co.uk> in November 1998.
|
7
debian/libgtop2.docs
vendored
7
debian/libgtop2.docs
vendored
@@ -1,7 +0,0 @@
|
||||
RELNOTES-0.25
|
||||
RELNOTES-1.0
|
||||
RELNOTES-1.1.x
|
||||
NEWS
|
||||
AUTHORS
|
||||
TODO
|
||||
debian/changelog
|
2
debian/libgtop2.files.in
vendored
2
debian/libgtop2.files.in
vendored
@@ -1,2 +0,0 @@
|
||||
@PREFIX@/lib/libgtop*-1.1.so.*.*
|
||||
@PREFIX@/lib/libgtop*-1.1.so.*
|
115
debian/rules.in
vendored
115
debian/rules.in
vendored
@@ -1,115 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
|
||||
# This version is for a hypothetical package that builds an
|
||||
# architecture-dependant package, as well as an architecture-independent
|
||||
# package.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
i=$(shell pwd)/debian/tmp
|
||||
b=$(shell pwd)/debian/build
|
||||
|
||||
configure: configure.in
|
||||
@echo "--- Making configure script and configuring"
|
||||
chmod +x autogen.sh
|
||||
./autogen.sh --prefix=/@PREFIX@ --with-gnome=/@GNOMEPREFIX@ \
|
||||
--localstatedir=/@LOCALSTATEDIR@
|
||||
|
||||
Makefile: configure
|
||||
@echo "--- Configuring"
|
||||
./configure --prefix=/@PREFIX@ --with-gnome=/@GNOMEPREFIX@ \
|
||||
--localstatedir=/@LOCALSTATEDIR@
|
||||
|
||||
build: configure Makefile build-debstamp
|
||||
build-debstamp:
|
||||
@echo "--- Compiling"
|
||||
dh_testdir
|
||||
$(MAKE) all
|
||||
touch build-debstamp
|
||||
|
||||
clean: Makefile
|
||||
@echo "--- Cleaning"
|
||||
dh_testdir
|
||||
dh_clean
|
||||
-rm -rf static shared
|
||||
-rm -f build-debstamp install-debstamp
|
||||
-make -k distclean
|
||||
-rm -f `find . -name "*~"`
|
||||
-rm -f `find . -name "*\.la"`
|
||||
-rm -rf `find . -name "\.deps"`
|
||||
-rm -rf `find . -name "\.libs"`
|
||||
-rm -rf `find . -name "*\.rej"`
|
||||
-rm -rf debian/tmp `find debian/* -type d ! -name CVS` debian/files* core
|
||||
-rm -f debian/*substvars
|
||||
|
||||
install: build install-debstamp
|
||||
install-debstamp:
|
||||
@echo "--- Installing"
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -rf $(b)
|
||||
$(MAKE) install prefix=$(i)/@PREFIX@ exec_prefix=$(i)/@PREFIX@ \
|
||||
localstatedir=$(i)/@LOCALSTATEDIR@
|
||||
touch install-debstamp
|
||||
|
||||
install-save: install
|
||||
rm -rf $(i).saved
|
||||
cp -a $(i) $(i).saved
|
||||
|
||||
install-saved:
|
||||
rm -rf $(i)
|
||||
cp -a $(i).saved $(i)
|
||||
rm -rf $(b)
|
||||
touch install-debstamp
|
||||
|
||||
binary-indep: build install
|
||||
|
||||
binary-arch: build install \
|
||||
libgtop1@SUFFIX@ \
|
||||
libgtop-dev@SUFFIX@
|
||||
|
||||
#
|
||||
# libgtop1@SUFFIX@
|
||||
#
|
||||
|
||||
libgtop1@SUFFIX@: install
|
||||
@echo "--- Building: $@"
|
||||
dh_installdocs -p$@ -P$(b)/$@ README NEWS AUTHORS
|
||||
dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog
|
||||
dh_movefiles -p$@ -P$(b)/$@
|
||||
dh_strip -p$@ -P$(b)/$@
|
||||
dh_compress -p$@ -P$(b)/$@
|
||||
dh_fixperms -p$@ -P$(b)/$@
|
||||
dh_installdeb -p$@ -P$(b)/$@
|
||||
dh_shlibdeps -p$@ -P$(b)/$@
|
||||
dh_gencontrol -p$@ -P$(b)/$@
|
||||
dh_makeshlibs -p$@ -P$(b)/$@ -V
|
||||
dh_md5sums -p$@ -P$(b)/$@
|
||||
dh_builddeb -p$@ -P$(b)/$@
|
||||
|
||||
#
|
||||
# libgtop-dev
|
||||
#
|
||||
|
||||
libgtop-dev@SUFFIX@: install
|
||||
@echo "--- Building: $@"
|
||||
mkdir -p $(b)/$@/usr/doc
|
||||
cd $(b)/$@/usr/doc; ln -s libgtop1@SUFFIX@ $@
|
||||
dh_movefiles -p$@ -P$(b)/$@
|
||||
dh_strip -p$@ -P$(b)/$@
|
||||
dh_compress -p$@ -P$(b)/$@
|
||||
dh_fixperms -p$@ -P$(b)/$@
|
||||
dh_installdeb -p$@ -P$(b)/$@
|
||||
dh_shlibdeps -p$@ -P$(b)/$@
|
||||
dh_gencontrol -p$@ -P$(b)/$@
|
||||
dh_makeshlibs -p$@ -P$(b)/$@ -V
|
||||
dh_undocumented -p$@ -P$(b)/$@ \
|
||||
libgtop-config.1
|
||||
dh_md5sums -p$@ -P$(b)/$@
|
||||
dh_builddeb -p$@ -P$(b)/$@
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: binary clean binary-indep binary-arch build install install-save install-saved
|
||||
|
||||
|
22
doc/.cvsignore
Normal file
22
doc/.cvsignore
Normal file
@@ -0,0 +1,22 @@
|
||||
*.shml
|
||||
.timestamp
|
||||
.timestamp2
|
||||
.timestamp3
|
||||
dbtohtml-1.shtml
|
||||
dbtohtml-2.shtml
|
||||
dbtohtml-3.shtml
|
||||
dbtohtml.shtml
|
||||
gnome-hackers
|
||||
gnome-hackers.ced
|
||||
libgtop
|
||||
libgtop-1.shtml
|
||||
libgtop-2.shtml
|
||||
libgtop-3.shtml
|
||||
libgtop-4.shtml
|
||||
libgtop-5.shtml
|
||||
libgtop-INDEX.shtml
|
||||
libgtop-ref
|
||||
libgtop-ref.ced
|
||||
libgtop.ced
|
||||
libgtop.fot
|
||||
libgtop.shtml
|
@@ -1,90 +0,0 @@
|
||||
2007-02-15 Benoît Dejean <benoit@placenet.org>
|
||||
|
||||
* reference/Makefile.am:
|
||||
|
||||
Fixed distcheck.
|
||||
|
||||
2006-02-21 Benoît Dejean <benoit@placenet.org>
|
||||
|
||||
* reference.texi: Fixed glibtop_get_proc_state doc.
|
||||
Patch by Emil Nowak <emil5@go2.pl>.
|
||||
|
||||
2005-01-03 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* reference.texi: Updated.
|
||||
|
||||
2004-12-04 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* reference.texi: Updated.
|
||||
|
||||
2004-08-03 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* reference.texi: Updated.
|
||||
|
||||
2004-07-07 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* reference.texi: updated.
|
||||
Added glibtop_get_proc_argv.
|
||||
Added glibtop_fsusage.block_size.
|
||||
|
||||
2004-03-05 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* reference.texi: update for new API
|
||||
|
||||
2003-10-20 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* reference.texi: s/u_int64_t/guint64/
|
||||
|
||||
2003-10-20 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* Makefile.am: removed traces of guile, intllibs and libgnomesupport
|
||||
|
||||
2002-03-12 James Henstridge <james@daa.com.au>
|
||||
|
||||
* Makefile.am (MAKEINFO): using += seems to screw up the build
|
||||
with newer automakes. Set it explicitly (using @MAKEINFO@) seems
|
||||
to be compatible with both.
|
||||
|
||||
2001-11-26 Abel Cheung <maddog@linux.org.hk>
|
||||
|
||||
* libgtop.texi, Makefile.am: Renamed to libgtop2.texi
|
||||
* about.texi: Very minor update.
|
||||
|
||||
1999-10-18 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* about.texi: Added a note about LibGTop and GNOME.
|
||||
|
||||
* reference.texi (glibtop_proc_state): Fix description of the `state'
|
||||
field for LibGTop 1.0.x.
|
||||
|
||||
1999-09-29 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* Makefile.am (MAKEINFO): Add `-I @libgtop_top_builddir@/doc' here.
|
||||
|
||||
1999-05-16 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* main.texi: This is now the main file which will @include all
|
||||
chapter files so we can use `texinfo-multiple-files-update'.
|
||||
|
||||
* reference.texi: Added all missing sections with a "not yet written"
|
||||
notice.
|
||||
|
||||
1999-05-16 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* white-paper.texi: Initial version of the LibGTop White Paper.
|
||||
|
||||
* Makefile.am: Create `auto-macros.texi' from `auto-macros.texi.in'
|
||||
which will contain some `@set' commands for the LibGTop version etc.
|
||||
|
||||
* auto-macros.texi.in: New file. This is a template for
|
||||
`auto-macros.texi' which will be automatically generated.
|
||||
|
||||
1999-05-09 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* about.texi: Split the `libgtop.texi' into one file pro chapter,
|
||||
this is the "About LibGTop".
|
||||
|
||||
* reference.texi: The "LibGTop Reference Manual".
|
||||
|
||||
* libgtop.texi: Initial version of the new LibGTop Manual.
|
||||
|
22
doc/Makefile
Normal file
22
doc/Makefile
Normal file
@@ -0,0 +1,22 @@
|
||||
all: .timestamp .timestamp2 .timestamp3
|
||||
|
||||
.timestamp: libgtop.sgml
|
||||
rm -rf libgtop
|
||||
mkdir libgtop
|
||||
jade -D /usr/lib/sgml/jade_dsl -d libgtop.dsl -t sgml \
|
||||
-V %no-make-index% libgtop.sgml > /dev/null && \
|
||||
touch .timestamp
|
||||
|
||||
.timestamp2: gnome-hackers.sgml
|
||||
rm -rf gnome-hackers
|
||||
mkdir gnome-hackers
|
||||
jade -D /usr/lib/sgml/jade_dsl -d gnome-hackers.dsl -t sgml \
|
||||
-V %no-make-index% gnome-hackers.sgml > /dev/null && \
|
||||
touch .timestamp2
|
||||
|
||||
.timestamp3: libgtop-ref.sgml ../guile/reference.sgml
|
||||
rm -rf libgtop-ref
|
||||
mkdir libgtop-ref
|
||||
jade -D /usr/lib/sgml/jade_dsl -d libgtop-ref.dsl -t sgml \
|
||||
-V %no-make-index% libgtop-ref.sgml > /dev/null && \
|
||||
touch .timestamp3
|
@@ -1,8 +0,0 @@
|
||||
SUBDIRS = reference
|
||||
|
||||
info_TEXINFOS = libgtop2.texi
|
||||
|
||||
libgtop2_TEXINFOS = libgtop2.texi about.texi reference.texi \
|
||||
version.texi main.texi white-paper.texi
|
||||
|
||||
AM_MAKEINFOFLAGS = -I $(libgtop_top_builddir)/doc
|
123
doc/about.texi
123
doc/about.texi
@@ -1,123 +0,0 @@
|
||||
@node About, White Paper, Top, Top
|
||||
@chapter About LibGTop
|
||||
|
||||
LibGTop is a library to get system specific data such as CPU and Memory Usage
|
||||
and information about running Processes.
|
||||
|
||||
On Systems like Solaris or Digital Unix where you need special privileges to
|
||||
get those data, it uses a setuid/setgid server to do so.
|
||||
|
||||
Even if LibGTop is a part of the GNOME desktop environment
|
||||
(@uref{http://www.gnome.org}), the main interface of LibGTop is totally
|
||||
independent from any particular desktop environment, so you can also use it
|
||||
as a standalone library in any piece of GPLed software.
|
||||
|
||||
@menu
|
||||
* Availability:: Where to get LibGTop
|
||||
* Supported Platforms:: Supported Platforms
|
||||
* Mailing List:: Helping with LibGTop development
|
||||
* Thanks:: People who contributed to LibGTop
|
||||
@end menu
|
||||
|
||||
@node Availability, Supported Platforms, About, About
|
||||
@section Availability
|
||||
|
||||
The master source of LibGTop is the GNOME CVS tree
|
||||
(see @uref{http://www.gnome.org} for details), but you can also get the
|
||||
latest release tarballs from
|
||||
|
||||
@display
|
||||
@uref{ftp://ftp.gnome.org/pub/GNOME/sources/libgtop/}
|
||||
@end display
|
||||
|
||||
@noindent
|
||||
or any of its mirror sites.
|
||||
|
||||
The latest stable version of LibGTop is 1.0.12 which is also the one that comes
|
||||
together with GNOME 1.0. It belongs to @code{LIBGTOP_STABLE_1_0} branch in CVS.
|
||||
Actual development occurs in the @code{libgtop-GNOME-2-0-port} which is
|
||||
currently versioned 1.90.0.
|
||||
|
||||
@node Supported Platforms, Mailing List, Availability, About
|
||||
@section Supported Platforms
|
||||
|
||||
The stable branch currently supports the following platforms:
|
||||
|
||||
@itemize @bullet
|
||||
@item All versions of Linux
|
||||
|
||||
LibGTop was tested under Linux 2.0.x and 2.2.x on the ix86 and the alpha, but
|
||||
it should also work without problems on SparcLinux or Linux 2.4.x.
|
||||
|
||||
Note: I'm speaking of the Linux kernel here, not the GNU/Linux operating system.
|
||||
|
||||
@item FreeBSD, NetBSD and OpenBSD
|
||||
|
||||
LibGTop was tested under FreeBSD 2.2.6 and 3.0, NetBSD 1.3.2 and OpenBSD 2.4.
|
||||
Support for NetBSD 1.4 was added in LibGTop 1.0.2.
|
||||
|
||||
@end itemize
|
||||
|
||||
The platforms listed above are known to be stable and working. However, if
|
||||
you're using the latest development version, you can use it on the following
|
||||
platforms as well:
|
||||
|
||||
@itemize @bullet
|
||||
@item BSD/OS
|
||||
|
||||
There is a port for BSD/OS (aka BSDI) 2.x and 3.x from Timur Bakeyev which
|
||||
should also work with 4.x. This isn't tested very well, but it should be
|
||||
working.
|
||||
|
||||
@item Digital Unix
|
||||
|
||||
There is some basic support for Digital Unix (formerly DEC OSF/1) V3.2C, but
|
||||
this may still be a bit unstable. I'm currently working on this port as time
|
||||
permits so it should be fully supported soon.
|
||||
|
||||
@item Solaris
|
||||
|
||||
The Solaris port currently works on Solaris 7 and maybe also on other releases.
|
||||
Thanks a lot to Drazen Kacar and everyone who helped working on this port. They
|
||||
have really done excellent work here and I'm pretty sure that this port will be
|
||||
fully functional on most Solaris versions in near future.
|
||||
|
||||
@end itemize
|
||||
|
||||
@node Mailing List, Thanks, Supported Platforms, About
|
||||
@section Mailing List
|
||||
|
||||
There is a @email{libgtop-devel-list@@egroups.com} mailing list for people who
|
||||
want to help with the development of LibGTop.
|
||||
|
||||
It is meant as a low-traffic, but high content-list where we can discuss
|
||||
technical details such as adding new sysdeps ports etc.
|
||||
|
||||
Especially, I'd like to see people with a deeper knowledge of operating systems
|
||||
internals joining my list so we can discuss technical details of the sysdeps
|
||||
code.
|
||||
|
||||
It is *not* for users that want to know how to compile LibGTop etc.
|
||||
|
||||
You can subscribe to this mailing list and view the mailing list archives
|
||||
on the LibGTop Page at @uref{http://www.home-of-linux.org/gnome/libgtop}.
|
||||
|
||||
@node Thanks, , Mailing List, About
|
||||
@section Thanks
|
||||
|
||||
At the place I'd like to thank the following people who contributed to
|
||||
LibGTop (listed in chronological order):
|
||||
|
||||
@itemize @bullet
|
||||
@item Sebastian Wilhelmi who had the initial idea of LibGTop and helped
|
||||
me a lot in the early beginning.
|
||||
@item Josh Sled for the initial FreeBSD port.
|
||||
@item Jeremy Lea for his BSD patches.
|
||||
@item Timur Bakeyev for the BSDI port.
|
||||
@item Drazen Kacar and the other people on the LibGTop development mailing
|
||||
list for the Solaris port.
|
||||
@item Kevin Vandersloot for the effort to port to GNOME 2.0.
|
||||
@item All people sending me patches, having good ideas, ...
|
||||
@item Everyone I have forgotten in this list ...
|
||||
@end itemize
|
||||
|
3
doc/catalog
Normal file
3
doc/catalog
Normal file
@@ -0,0 +1,3 @@
|
||||
PUBLIC "-//James Clark//DTD DSSSL Flow Object Tree//EN" "fot.dtd"
|
||||
PUBLIC "ISO/IEC 10179:1996//DTD DSSSL Architecture//EN" "dsssl.dtd"
|
||||
PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" "style-sheet.dtd"
|
1627
doc/dbtohtml.dsl
Normal file
1627
doc/dbtohtml.dsl
Normal file
File diff suppressed because it is too large
Load Diff
12
doc/gnome-hackers.dsl
Normal file
12
doc/gnome-hackers.dsl
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
||||
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
|
||||
]>
|
||||
|
||||
<style-specification id="gnomehackersdbotohtml" use="dbtohtml">
|
||||
|
||||
(define %output-basename% "gnome-hackers")
|
||||
(define %output-directory% "gnome-hackers")
|
||||
|
||||
</style-specification>
|
||||
|
||||
<external-specification id="dbtohtml" document="dbtohtml.dsl">
|
393
doc/gnome-hackers.sgml
Normal file
393
doc/gnome-hackers.sgml
Normal file
@@ -0,0 +1,393 @@
|
||||
<!-- $Id$ -->
|
||||
|
||||
<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
|
||||
<!entity libgtopConf.sh SYSTEM "../libgtopConf.sh" >
|
||||
]>
|
||||
<book>
|
||||
<bookinfo>
|
||||
<title>Using LibGTop in the Gnome Project</title>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Martin</firstname>
|
||||
<surname>Baulig</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>martin@home-of-linux.org</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<copyright>
|
||||
<year>1998</year>
|
||||
<holder>Martin Baulig</holder>
|
||||
</copyright>
|
||||
|
||||
<legalnotice>
|
||||
|
||||
<para>
|
||||
This documentation 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.
|
||||
|
||||
<para>
|
||||
This 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 General Public License for more
|
||||
details.
|
||||
|
||||
<para>
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
MA 02111-1307 USA
|
||||
|
||||
<para>
|
||||
For more details see the file COPYING in the source
|
||||
distribution of LibGTop.</para>
|
||||
|
||||
</legalnotice>
|
||||
|
||||
<abstract>
|
||||
|
||||
<para>
|
||||
This is a short introduction in how to use
|
||||
<productname>libgtop</productname> in the GNOME project.
|
||||
It describes the additional options <filename>configure</filename>
|
||||
takes and the information stored in the automatically generated
|
||||
<filename>libgtopConf.sh</filename> configuration script.
|
||||
|
||||
</abstract>
|
||||
|
||||
</bookinfo>
|
||||
|
||||
<toc></toc>
|
||||
|
||||
<chapter id="macros">
|
||||
<title>Autoconf macros</title>
|
||||
|
||||
<sect1 id="gnome-libgtop-check">
|
||||
<title><filename>macros/gnome-libgtop-check.m4</filename></title>
|
||||
|
||||
<para>
|
||||
Contains all that you need to include libgtop in any Gnome application. It defines
|
||||
<function>GNOME_INIT_LIBGTOP</function> which you can use in the same way like
|
||||
<function>GNOME_INIT</function> to check whether libgtop is installed and to read
|
||||
its <filename>libgtopConf.sh</filename> script. It automatically invokes
|
||||
<function>GNOME_LIBGTOP_SYSDEPS</function>.
|
||||
|
||||
<para>
|
||||
When libgtop can be found, it defines <parameter>HAVE_LIBGTOP</parameter>. There's
|
||||
also an automake conditional <parameter>HAVE_LIBGTOP</parameter> which you can use.
|
||||
|
||||
<sect1 id="gnome-libgtop-sysdeps">
|
||||
<title><filename>macros/gnome-libgtop-sysdeps.m4</filename></title>
|
||||
|
||||
<para>
|
||||
This file defines <function>GNOME_LIBGTOP_SYSDEPS</function> which you can
|
||||
use to check which sysdeps directory <productname>libgtop</productname> should
|
||||
use and whether the <filename>gtop_server</filename> is needed.
|
||||
|
||||
<para>
|
||||
It defines the following variables:
|
||||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_sysdeps_dir</parameter>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The sysdeps dir <productname>libgtop</productname> uses.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_use_machine_h</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Some of the system dependent parts of <productname>libgtop</productname>
|
||||
provide a structure <structname>_glibtop_machine</structname> defined in
|
||||
a header file <filename>glibtop_machine.h</filename> they provide. This
|
||||
structure gets inserted into the <structfield>machine</structfield> member
|
||||
of <structname>_glibtop</structname> when <filename>config.h</filename>
|
||||
defines <parameter>HAVE_GLIBTOP_MACHINE_H</parameter>.
|
||||
|
||||
<para>
|
||||
This variable is either <literal>yes</literal> or <literal>no</literal> and
|
||||
tells you whether this is the case. If it is true, this macro wil automatically
|
||||
define <parameter>HAVE_GLIBTOP_MACHINE_H</parameter>.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_need_server</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Is either <literal>yes</literal> or <literal>no</literal> and tells you
|
||||
whether the server is needed. If it is needed, it will automatically
|
||||
define <parameter>NEED_LIBGTOP</parameter>.
|
||||
|
||||
<para>
|
||||
This macro also provides a conditional <parameter>NEED_LIBGTOP</parameter>
|
||||
which you can use in you <filename>Makefile.am</filename>.
|
||||
|
||||
</variablelist>
|
||||
|
||||
</sect1>
|
||||
|
||||
<chapter id="configure">
|
||||
<title>Configuration</title>
|
||||
|
||||
<para>
|
||||
The <filename>configure</filename> script of <productname>libgtop</productname>
|
||||
takes some non-standard options to let you decide which parts of the library
|
||||
should be build.
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
|
||||
<para>
|
||||
Normally, <filename>configure</filename> decides whether or not using the
|
||||
server is required. Depending upon this decision, it adds either
|
||||
<literal>-lgtop</literal> (when it's needed) or
|
||||
<literal>-lgtop_systems</literal> (when it's not needed) to
|
||||
<parameter>LIBGTOP_LIBS</parameter> and <parameter>LIBGTOP_GUILE_LIBS</parameter>.
|
||||
|
||||
<para>
|
||||
You can change this behaviour with the following options:
|
||||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>--enable-libgtop-server</parameter>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Use the server regardless whether or not it is required.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>--disable-libgtop-server</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Do not use the server regardless wheter or not it is required.
|
||||
|
||||
</variablelist>
|
||||
|
||||
<listitem>
|
||||
|
||||
<para>
|
||||
Normally, the guile interface of <productname>libgtop</productname> is build
|
||||
when <productname>guile</productname> can be found on the system.
|
||||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>--disable-libgtop-guile</parameter>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Disables building the guile interface even if you have
|
||||
<productname>guile</productname> installed.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>--enable-libgtop-guile</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Has no effect at all since you cannot build the guile interface without
|
||||
having <productname>guile</productname> installed on your system.
|
||||
|
||||
</variablelist>
|
||||
|
||||
<listitem>
|
||||
|
||||
<para>
|
||||
If you do not need the <filename>names</filename> subdirs, you can disable
|
||||
their building with the following option:
|
||||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>--disable-libgtop-names</parameter>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Disables building of the <filename>names</filename> subdirs.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>--enable-libgtop-names</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Is the default.
|
||||
|
||||
</variablelist>
|
||||
|
||||
<para>
|
||||
If it is enables, <parameter>GLIBTOP_NAMES</parameter> will be defined.
|
||||
|
||||
<listitem>
|
||||
|
||||
<para>
|
||||
To disable building of the examples, you can say:
|
||||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>--without-examples</parameter>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Disables building of the examples.
|
||||
|
||||
</variablelist>
|
||||
|
||||
</itemizedlist>
|
||||
|
||||
<chapter id="libgtopConf">
|
||||
<title>The <filename>libgtopConf.sh</filename> script</title>
|
||||
|
||||
<para>
|
||||
After a successful build of <productname>libgtop</productname>, a
|
||||
<filename>libgtopConf.sh</filename> script is generated which will later
|
||||
be used to decide how to link a program with <filename>libgtop</filename>.
|
||||
|
||||
<para>
|
||||
It defines the following variables:
|
||||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>LIBGTOP_LIBDIR</parameter>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Defaults to <literal>$(prefix)/lib</literal>. It is the directory
|
||||
where the <productname>libgtop</productname> libraries get installed.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>LIBGTOP_INCLUDEDIR</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Defaults to <literal>$(prefix)/include</literal>. It is the directory
|
||||
where the <productname>libgtop</productname> header files get installed.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>LIBGTOP_LIBS</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Contains everything that you need to add to the <parameter>_LDADD</parameter>
|
||||
variable of <productname>automake</productname> to link a program with
|
||||
<productname>libgtop</productname>.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>LIBGTOP_INCS</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Contains everything that you need to add to the <parameter>_INCLUDES</parameter>
|
||||
variable of <productname>automake</productname> to compile a program that uses
|
||||
<productname>libgtop</productname>.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>LIBGTOP_GUILE_INCS</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Contains everything that you need to add to the <parameter>_INCLUDES</parameter>
|
||||
variable of <productname>automake</productname> to compile a program that uses both
|
||||
<productname>libgtop</productname> and its guile interface.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>LIBGTOP_BINDIR</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Defaults to <literal>$(bindir)</literal>. It is the directory where the
|
||||
<productname>libgtop</productname> binaries get installed.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>LIBGTOP_SERVER</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Defaults to <literal>$(bindir)/gtop_server</literal>. It is the full pathname
|
||||
where the server gets installed.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_sysdeps_dir</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The sysdeps directory that is used on your system.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_need_server</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Is either <literal>yes</literal> or <literal>no</literal> and tells you
|
||||
whether using the server is needed or not.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_use_machine_h</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Is either <literal>yes</literal> or <literal>no</literal> and tells you
|
||||
whether <filename>glibtop_machine_h</filename> should be included in
|
||||
<filename>glibtop.h</filename>.
|
||||
|
||||
The system dependent part of the library may provide an additional header
|
||||
file, <filename>glibtop_machine_h</filename>. In this case, they define
|
||||
a structure <structname>_glibtop_machine</structname> in this header file.
|
||||
This structure represents the <structfield>machine</structfield> member of
|
||||
<structname>_glibtop</structname>.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_guile_found</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Is either <literal>yes</literal> or <literal>no</literal> and tells you
|
||||
whether <productname>guile</productname> has been found on your system
|
||||
(or if building the guile interface was disabled).
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_want_names</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Is either <literal>yes</literal> or <literal>no</literal> and tells you
|
||||
whether the <filename>sysdeps/names</filename> subdirectory was build.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_want_guile_names</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Is either <literal>yes</literal> or <literal>no</literal> and tells you
|
||||
whether the <filename>sysdeps/guile/names</filename> subdirectory was build.
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>libgtop_want_examples</parameter></term>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Is either <literal>yes</literal> or <literal>no</literal> and tells you
|
||||
whether the examples were build.
|
||||
|
||||
</variablelist>
|
||||
|
||||
<example>
|
||||
<title>Sample <filename>libgtopConf.sh</filename></title>
|
||||
|
||||
<programlisting>&libgtopConf.sh;</programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
</book>
|
@@ -1,107 +0,0 @@
|
||||
@node LibGTop Internals, , Reference Manual, Top
|
||||
@chapter LibGTop Internals
|
||||
|
||||
@menu
|
||||
* General Internals:: General Internals
|
||||
* Sysdeps Internals:: Sysdeps Internals
|
||||
@end menu
|
||||
|
||||
@node General Internals, Sysdeps Internals, LibGTop Internals, LibGTop Internals
|
||||
@section General Internals
|
||||
|
||||
@menu
|
||||
* glibtop:: The server structure
|
||||
@end menu
|
||||
|
||||
@node glibtop, , General Internals, General Internals
|
||||
@subsection The server structure - @code{glibtop}
|
||||
|
||||
@example
|
||||
@cartouche
|
||||
typedef struct _glibtop glibtop;
|
||||
|
||||
struct _glibtop
|
||||
@{
|
||||
unsigned flags;
|
||||
unsigned method;
|
||||
unsigned error_method;
|
||||
#ifdef HAVE_GLIBTOP_MACHINE_H
|
||||
glibtop_machine machine;
|
||||
#endif
|
||||
int input [2];
|
||||
int output [2];
|
||||
int socket;
|
||||
int ncpu;
|
||||
unsigned long os_version_code;
|
||||
const char *name;
|
||||
const char *server_command;
|
||||
const char *server_host;
|
||||
const char *server_user;
|
||||
const char *server_rsh;
|
||||
unsigned long features;
|
||||
unsigned long server_port;
|
||||
glibtop_sysdeps sysdeps;
|
||||
glibtop_sysdeps required;
|
||||
glibtop_sysdeps wanted;
|
||||
pid_t pid;
|
||||
@};
|
||||
@end cartouche
|
||||
@end example
|
||||
|
||||
@node Sysdeps Internals, , General Internals, LibGTop Internals
|
||||
@section Sysdeps Internals
|
||||
|
||||
@menu
|
||||
* glibtop_open_s:: Non-privileged initializations
|
||||
* glibtop_close_s:: Non-privileged cleanups
|
||||
@end menu
|
||||
|
||||
@node glibtop_open_s, glibtop_close_s, Sysdeps Internals, Sysdeps Internals
|
||||
@subsection glibtop_open_s
|
||||
|
||||
This function is used in the non-suid sysdeps library @samp{-lgtop_sysdeps} to
|
||||
initialize a server. It should do all initializations that do not need any
|
||||
privileges.
|
||||
|
||||
@example
|
||||
@cartouche
|
||||
void
|
||||
glibtop_open_s (glibtop *server, const char *program_name,
|
||||
const unsigned long features,
|
||||
const unsigned flags);
|
||||
@end cartouche
|
||||
@end example
|
||||
|
||||
@table @code
|
||||
@item server
|
||||
Pointer to the @code{glibtop} server structure.
|
||||
@item program_name
|
||||
Name of the calling program; the implementation will usually
|
||||
set @samp{server->name} to this so it'll be used as the program
|
||||
name in error messages.
|
||||
@end table
|
||||
|
||||
Typically, this function will set @code{server->name}, @code{server->ncpu} and
|
||||
@code{server->os_version_code} and initialize any of the @code{server->machine}
|
||||
fields which do not need any privileges.
|
||||
|
||||
It is normally implemented in @file{open.c} in the sysdeps directory.
|
||||
|
||||
@node glibtop_close_s, , glibtop_open_s, Sysdeps Internals
|
||||
@subsection glibtop_close_s
|
||||
|
||||
This function is used in the non-suid sysdeps library @samp{-lgtop_sysdeps} to
|
||||
clean-up a server when it's no longer used.
|
||||
|
||||
It must free all resources that were allocated in @code{glibtop_open_s}.
|
||||
|
||||
@example
|
||||
@cartouche
|
||||
void
|
||||
glibtop_close_s (glibtop *server);
|
||||
@end cartouche
|
||||
@end example
|
||||
|
||||
It is normally implemented in @file{close.c} in the sysdeps directory, but may
|
||||
be empty.
|
||||
|
12
doc/libgtop-ref.dsl
Normal file
12
doc/libgtop-ref.dsl
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
||||
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
|
||||
]>
|
||||
|
||||
<style-specification id="libgtoprefdbtohtml" use="dbtohtml">
|
||||
|
||||
(define %output-basename% "libgtop-ref")
|
||||
(define %output-directory% "libgtop-ref")
|
||||
|
||||
</style-specification>
|
||||
|
||||
<external-specification id="dbtohtml" document="dbtohtml.dsl">
|
67
doc/libgtop-ref.sgml
Normal file
67
doc/libgtop-ref.sgml
Normal file
@@ -0,0 +1,67 @@
|
||||
<!-- $Id$ -->
|
||||
|
||||
<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
|
||||
<!entity reference.sgml SYSTEM "../guile/reference.sgml" >
|
||||
]>
|
||||
<book>
|
||||
<bookinfo>
|
||||
<title>LibGTop Reference Manual</title>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Martin</firstname>
|
||||
<surname>Baulig</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>martin@home-of-linux.org</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<abstract>
|
||||
<para>
|
||||
<literal>$Id$</literal>
|
||||
|
||||
<para>
|
||||
This reference manual is automatically generated from <filename>doc/make-docbook.scm</filename>.
|
||||
It uses the guile interface of <productname>libgtop</productname> to get the names of all
|
||||
features the library defines and a description of the structures.
|
||||
</abstract>
|
||||
|
||||
<copyright>
|
||||
<year>1998</year>
|
||||
<holder>Martin Baulig</holder>
|
||||
</copyright>
|
||||
<legalnotice>
|
||||
|
||||
<para>
|
||||
This documentation 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.
|
||||
|
||||
<para>
|
||||
This 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 General Public License for more
|
||||
details.
|
||||
|
||||
<para>
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
MA 02111-1307 USA
|
||||
|
||||
<para>
|
||||
For more details see the file COPYING in the source
|
||||
distribution of LibGTop.</para>
|
||||
|
||||
</legalnotice>
|
||||
</bookinfo>
|
||||
|
||||
<toc></toc>
|
||||
|
||||
&reference.sgml;
|
||||
|
||||
</book>
|
12
doc/libgtop.dsl
Executable file
12
doc/libgtop.dsl
Executable file
@@ -0,0 +1,12 @@
|
||||
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
||||
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
|
||||
]>
|
||||
|
||||
<style-specification id="libgtopdbtohtml" use="dbtohtml">
|
||||
|
||||
(define %output-basename% "libgtop")
|
||||
(define %output-directory% "libgtop")
|
||||
|
||||
</style-specification>
|
||||
|
||||
<external-specification id="dbtohtml" document="dbtohtml.dsl">
|
1332
doc/libgtop.sgml
Normal file
1332
doc/libgtop.sgml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,88 +0,0 @@
|
||||
\input texinfo @c -*-texinfo-*-
|
||||
@c %**start of header
|
||||
@setfilename libgtop2.info
|
||||
@settitle LibGTop Reference Manual
|
||||
@setchapternewpage odd
|
||||
@c %**end of header
|
||||
|
||||
@include version.texi
|
||||
|
||||
@ifinfo
|
||||
This is the LibGTop Reference Manual version @value{VERSION}
|
||||
(last modified @value{UPDATED}).
|
||||
|
||||
Copyright 1999 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim
|
||||
copies of this manual provided the copyright notice and
|
||||
this permission notice are preserved on all copies.
|
||||
|
||||
@ignore
|
||||
Permission is granted to process this file through TeX
|
||||
and print the results, provided the printed document
|
||||
carries a copying permission notice identical to this
|
||||
one except for the removal of this paragraph (this
|
||||
paragraph not being relevant to the printed manual).
|
||||
|
||||
@end ignore
|
||||
Permission is granted to copy and distribute modified
|
||||
versions of this manual under the conditions for
|
||||
verbatim copying, provided also that the sections
|
||||
entitled ``Copying'' and ``GNU General Public License''
|
||||
are included exactly as in the original, and provided
|
||||
that the entire resulting derived work is distributed
|
||||
under the terms of a permission notice identical to this
|
||||
one.
|
||||
|
||||
Permission is granted to copy and distribute
|
||||
translations of this manual into another language,
|
||||
under the above conditions for modified versions,
|
||||
except that this permission notice may be stated in a
|
||||
translation approved by the Free Software Foundation.
|
||||
|
||||
@format
|
||||
@dircategory Libraries:
|
||||
@direntry
|
||||
* LibGTop2: (libgtop2). Library to get system specific data
|
||||
such as cpu and memory usage, active
|
||||
processes
|
||||
@end direntry
|
||||
@end format
|
||||
|
||||
@end ifinfo
|
||||
|
||||
@titlepage
|
||||
@title LibGTop Reference Manual
|
||||
@subtitle Version @value{VERSION} - @value{UPDATED}
|
||||
@author Martin Baulig
|
||||
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1999 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim
|
||||
copies of this manual provided the copyright notice and
|
||||
this permission notice are preserved on all copies.
|
||||
|
||||
Permission is granted to copy and distribute modified
|
||||
versions of this manual under the conditions for
|
||||
verbatim copying, provided also that the sections
|
||||
entitled ``Copying'' and ``GNU General Public License''
|
||||
are included exactly as in the original, and provided
|
||||
that the entire resulting derived work is distributed
|
||||
under the terms of a permission notice identical to this
|
||||
one.
|
||||
|
||||
Permission is granted to copy and distribute
|
||||
translations of this manual into another language,
|
||||
under the above conditions for modified versions,
|
||||
except that this permission notice may be stated in a
|
||||
translation approved by the Free Software Foundation.
|
||||
@end titlepage
|
||||
|
||||
@contents
|
||||
|
||||
@include main.texi
|
||||
|
||||
@bye
|
||||
|
@@ -1,68 +0,0 @@
|
||||
@node Top, About, (dir), (dir)
|
||||
|
||||
@menu
|
||||
* About:: About LibGTop
|
||||
* White Paper:: LibGTop White Paper
|
||||
* Reference Manual:: LibGTop Reference Manual
|
||||
|
||||
--- The Detailed Node Listing ---
|
||||
|
||||
About LibGTop
|
||||
|
||||
* Availability:: Where to get LibGTop
|
||||
* Supported Platforms:: Supported Platforms
|
||||
* Mailing List:: Helping with LibGTop development
|
||||
* Thanks:: People who contributed to LibGTop
|
||||
|
||||
LibGTop White Paper
|
||||
|
||||
* Introduction:: Introduction
|
||||
* Overview:: Overview
|
||||
|
||||
Overview
|
||||
|
||||
* Interface Design:: Things that need to be considered
|
||||
* Server Implementation:: The LibGTop "server"
|
||||
|
||||
LibGTop Reference Manual
|
||||
|
||||
* System Dependent:: System Dependent Functions.
|
||||
* Common Functions:: Common Functions.
|
||||
* Library Functions:: Library Functions.
|
||||
|
||||
System Dependent Functions
|
||||
|
||||
* glibtop_cpu:: CPU Usage.
|
||||
* glibtop_mem:: Memory Usage.
|
||||
* glibtop_swap:: Swap Usage.
|
||||
* glibtop_uptime:: System Uptime.
|
||||
* glibtop_loadavg:: Load Average.
|
||||
* glibtop_proclist:: Process List.
|
||||
* glibtop_proc_state:: Process State.
|
||||
* glibtop_proc_uid:: Process UID and TTY Information.
|
||||
* glibtop_proc_mem:: Process Memory Information.
|
||||
* glibtop_proc_time:: Process Time Information.
|
||||
* glibtop_proc_signal:: Process Signal Information.
|
||||
* glibtop_proc_kernel:: Process Kernel Data Information.
|
||||
* glibtop_proc_segment:: Process Segment Information.
|
||||
* glibtop_proc_args:: Process Arguments.
|
||||
* glibtop_proc_map:: Process Memory Maps.
|
||||
* glibtop_netload:: Network Load.
|
||||
* glibtop_ppp:: PPP Usage.
|
||||
|
||||
Common Functions
|
||||
|
||||
* glibtop_mountlist:: Mount List.
|
||||
* glibtop_fsusage:: File System Usage.
|
||||
|
||||
Library Functions
|
||||
|
||||
* glibtop_init:: Server Initialization.
|
||||
* glibtop_sysdeps:: Server Sysdeps.
|
||||
* Library Parameters:: Library Parameters.
|
||||
@end menu
|
||||
|
||||
@include about.texi
|
||||
@include white-paper.texi
|
||||
@include reference.texi
|
||||
|
1846
doc/reference.texi
1846
doc/reference.texi
File diff suppressed because it is too large
Load Diff
@@ -1,59 +0,0 @@
|
||||
AUTOMAKE_OPTIONS = 1.6
|
||||
## Process this file with automake to produce Makefile.in
|
||||
# The name of the module, e.g. 'glib'.
|
||||
DOC_MODULE=libgtop
|
||||
|
||||
# The top-level SGML file. You can change this if you want to.
|
||||
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
|
||||
|
||||
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
|
||||
# SCANGOBJ_OPTIONS=
|
||||
|
||||
# Extra options to supply to gtkdoc-scan.
|
||||
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
|
||||
SCAN_OPTIONS=
|
||||
|
||||
# Extra options to supply to gtkdoc-mkdb.
|
||||
# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
|
||||
MKDB_OPTIONS=--sgml-mode --output-format=xml --source-dir=$(top_srcdir)/sysdeps/common
|
||||
|
||||
# The directory containing the source code. Relative to $(srcdir).
|
||||
# gtk-doc will search all .c & .h files beneath here for inline comments
|
||||
# documenting the functions and macros.
|
||||
# e.g. DOC_SOURCE_DIR=../../../gtk
|
||||
DOC_SOURCE_DIR=$(top_srcdir)/include/glibtop
|
||||
|
||||
# Used for dependencies. The docs will be rebuilt if any of these change.
|
||||
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
|
||||
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
|
||||
HFILE_GLOB=$(top_srcdir)/include/glibtop/*.h
|
||||
CFILE_GLOB=$(top_srcdir)/sysdeps/common/*.c
|
||||
|
||||
# Header files to ignore when scanning.
|
||||
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
|
||||
IGNORE_HFILES=error.h global.h gnuserv.h init_hooks.h write.h read.h read_data.h config.h libgtopconfig.h
|
||||
|
||||
EXTRA_HFILES=$(top_srcdir)/glibtop.h
|
||||
|
||||
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
|
||||
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
|
||||
content_files=version.xml
|
||||
|
||||
# Images to copy into HTML directory.
|
||||
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
|
||||
HTML_IMAGES=
|
||||
|
||||
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
|
||||
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
|
||||
# signals and properties.
|
||||
# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
|
||||
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
|
||||
INCLUDES=
|
||||
GTKDOC_LIBS=
|
||||
|
||||
# This includes the standard gtk-doc make rules, copied by gtkdocize.
|
||||
include $(top_srcdir)/gtk-doc.make
|
||||
|
||||
# Other files to distribute
|
||||
# e.g. EXTRA_DIST += version.xml.in
|
||||
EXTRA_DIST += version.xml.in
|
@@ -1,206 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
|
||||
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<bookinfo>
|
||||
<title>Libgtop Reference Manual</title>
|
||||
<releaseinfo>for libgtop <xi:include href="version.xml"/></releaseinfo>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Martin </firstname>
|
||||
<surname>Baulig</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>martin@home-of-linux.org</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<firstname>Germán</firstname>
|
||||
<surname>Poó-Caamaño</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>gpoo@ubiobio.cl</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
<legalnotice>
|
||||
<para>Permission is granted to copy, distribute and/or modify
|
||||
this document under the terms of the <citetitle>GNU Free
|
||||
Documentation License</citetitle>, Version 1.1 or any later
|
||||
version published by the Free Software Foundation with no
|
||||
Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||
Texts. You may obtain a copy of the <citetitle>GNU Free
|
||||
Documentation License</citetitle> from the Free Software
|
||||
Foundation by visiting <ulink type="http"
|
||||
url="http://www.fsf.org">their Web site</ulink> or by writing
|
||||
to: Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.</para>
|
||||
|
||||
<para>Many of the names used by companies to distinguish their
|
||||
products and services are claimed as trademarks. Where those
|
||||
names appear in any GNOME documentation, and those trademarks
|
||||
are made aware to the members of the GNOME Documentation
|
||||
Project, the names have been printed in caps or initial
|
||||
caps.</para>
|
||||
</legalnotice>
|
||||
|
||||
<abstract>
|
||||
<para>
|
||||
LibGTop is a library to get system specific data such as CPU and
|
||||
Memory Usage and information about running Processes.</para>
|
||||
|
||||
<para>On Systems like Solaris or Digital Unix where you need special
|
||||
privileges to get those data, it uses a setuid/setgid server to do
|
||||
so.</para>
|
||||
|
||||
<para>Even if LibGTop is a part of the GNOME desktop environment
|
||||
(@uref{http://www.gnome.org}), the main interface of LibGTop is totally
|
||||
independent from any particular desktop environment, so you can also
|
||||
use it as a standalone library in any piece of GPLed software.</para>
|
||||
|
||||
<para>This manual documents the interfaces of the libgtop
|
||||
library and has some short notes to help get you up to speed
|
||||
with using the library.</para>
|
||||
</abstract>
|
||||
</bookinfo>
|
||||
|
||||
<!--FIXME: It is missing the rest of about.texi -->
|
||||
|
||||
<chapter id="libgtop-white-paper">
|
||||
<title>White paper</title>
|
||||
|
||||
<sect1 id="libgtop-white-paper-introduction">
|
||||
<title>Introduction</title>
|
||||
<para>Many modern UNIX systems like Solaris, BSD or Digitial Unix
|
||||
only allow priviledged processes to read information like CPU and
|
||||
Memory Usage or information about running processes.</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
BSD, for instance, doesn't have any other way to get those data than reading
|
||||
directly from @file{/dev/kmem} and you need to be in the @code{kmem} group to
|
||||
be able to read this.</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
Other systems, like Digital Unix, allow all users to get things like CPU and
|
||||
Memory statistics, but only root may read information about any process other
|
||||
than the current one (you may not even get information about your own processes
|
||||
if you're not root).</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
Linux has a very nice @file{/proc} filesystem, but reading and parsing
|
||||
@file{/proc} is very slow and inefficient.</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
Solaris is a bit better, but you still need to be in the @code{sys} group or
|
||||
even root to get some data.</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
Because of this system utilities like @code{ps}, @code{uptime} or @code{top}
|
||||
often are setgid kmem or setuid root. Usually, they're also very specific to
|
||||
the system they're written for and not easily portable to other systems without
|
||||
a lot of work.</para>
|
||||
|
||||
<para>
|
||||
This, of cause, becomes a problem for graphical tools like @code{gtop} - making
|
||||
a GTK+ program setgid or even setuid would be a security hole as big as you can
|
||||
drive the entire X11 source code through. For the GNOME project, we also needed
|
||||
some kind of library which provides all the required information in a portable
|
||||
since there's more than just one single program that wants to use them - for
|
||||
instance @code{gtop} and the @code{multiload}, @code{cpumemusage} and
|
||||
@code{netload} panel applets.</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="libgtop-white-paper-overview">
|
||||
<title>Overview</title>
|
||||
<para>This section should give you a short overview on how LibGTop
|
||||
was developed, which things needed to be considered and how it
|
||||
works.</para>
|
||||
|
||||
<sect2 id="libgtop-white-paper-overview-design">
|
||||
<title>Interface Design: Things that need to be considered</title>
|
||||
<para>
|
||||
At the very beginning, it was necessary to collect all the data the library part
|
||||
should provide and put them into some C structures. This was not that easiy as it
|
||||
might sound since LibGTop should be portable to any modern UNIX system with a common
|
||||
library part on all those systems, but the data that should be returned vary from
|
||||
system to system. For instance some systems support shared memory, but some others
|
||||
may not.</para>
|
||||
|
||||
<para>
|
||||
The header files where we define these C structures (which are system-independent) are
|
||||
shared between client and server. This way we can call the system dependent code
|
||||
directly where we do not need any special privileges to do so.</para>
|
||||
|
||||
<para>
|
||||
All of those structures contain a @code{flags} member which is interpreted as a bit
|
||||
mask and tells the caller of the library functions which of the fields in the returned
|
||||
structure are valid and which are not.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="libgtop-white-paper-overview-server">
|
||||
<title>Server Implementation: The LibGTop "server"</title>
|
||||
<para>
|
||||
The LibGTop @dfn{server} is a setgid/setuid binary which contains all the system
|
||||
dependent code which needs special privileges. It is only build if it's required
|
||||
on the current system (for instance, the Linux kernel provides all the required
|
||||
data via its @file{/proc} filesystem so we do not need the server at all) and it
|
||||
only contains the @dfn{features} which need privileges.</para>
|
||||
|
||||
<para>
|
||||
Whenever we do not need any privileges to get all the data for some of the requested
|
||||
structures (here called @dfn{features}) the library calls the sysdeps code directly
|
||||
rather than using the server.</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<chapter id="libgtop-lib">
|
||||
<title>Libgtop Library Reference</title>
|
||||
|
||||
<para>This section contains the API reference for libgtop. All
|
||||
the public interfaces are documented here.</para>
|
||||
|
||||
<xi:include href="xml/glibtop.xml"/>
|
||||
<xi:include href="xml/close.xml"/>
|
||||
<xi:include href="xml/command.xml"/>
|
||||
<xi:include href="xml/glibtop-server.xml"/>
|
||||
<xi:include href="xml/netload.xml"/>
|
||||
<xi:include href="xml/ppp.xml"/>
|
||||
<xi:include href="xml/shm_limits.xml"/>
|
||||
<xi:include href="xml/uptime.xml"/>
|
||||
<xi:include href="xml/netlist.xml"/>
|
||||
<xi:include href="xml/open.xml"/>
|
||||
<xi:include href="xml/parameter.xml"/>
|
||||
<xi:include href="xml/procargs.xml"/>
|
||||
<xi:include href="xml/procmem.xml"/>
|
||||
<xi:include href="xml/procopenfiles.xml"/>
|
||||
<xi:include href="xml/procsegment.xml"/>
|
||||
<xi:include href="xml/procsignal.xml"/>
|
||||
<xi:include href="xml/sysdeps.xml"/>
|
||||
<xi:include href="xml/procstate.xml"/>
|
||||
<xi:include href="xml/procuid.xml"/>
|
||||
<xi:include href="xml/proctime.xml"/>
|
||||
<xi:include href="xml/signal.xml"/>
|
||||
<xi:include href="xml/procmap.xml"/>
|
||||
<xi:include href="xml/sysinfo.xml"/>
|
||||
<xi:include href="xml/union.xml"/>
|
||||
<xi:include href="xml/version.xml"/>
|
||||
<xi:include href="xml/proclist.xml"/>
|
||||
<xi:include href="xml/sem_limits.xml"/>
|
||||
<xi:include href="xml/prockernel.xml"/>
|
||||
<xi:include href="xml/fsusage.xml"/>
|
||||
<xi:include href="xml/loadavg.xml"/>
|
||||
<xi:include href="xml/mem.xml"/>
|
||||
<xi:include href="xml/mountlist.xml"/>
|
||||
<xi:include href="xml/msg_limits.xml"/>
|
||||
<xi:include href="xml/cpu.xml"/>
|
||||
<xi:include href="xml/swap.xml"/>
|
||||
</chapter>
|
||||
</book>
|
@@ -1,736 +0,0 @@
|
||||
<INCLUDE>glibtop.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>glibtop</FILE>
|
||||
<TITLE>GlibTop</TITLE>
|
||||
GLIBTOP_MOUNTENTRY_LEN
|
||||
LIBGTOP_CHECK_VERSION
|
||||
glibtop
|
||||
glibtop_global_server
|
||||
glibtop_init
|
||||
glibtop_init_r
|
||||
glibtop_init_s
|
||||
glibtop_server_features
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/close.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>close</FILE>
|
||||
<TITLE>Close</TITLE>
|
||||
glibtop_close
|
||||
glibtop_close_r
|
||||
glibtop_close_s
|
||||
glibtop_close_p
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/command.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>command</FILE>
|
||||
<TITLE>Command</TITLE>
|
||||
GLIBTOP_CMND_QUIT
|
||||
GLIBTOP_CMND_SYSDEPS
|
||||
GLIBTOP_CMND_CPU
|
||||
GLIBTOP_CMND_MEM
|
||||
GLIBTOP_CMND_SWAP
|
||||
GLIBTOP_CMND_UPTIME
|
||||
GLIBTOP_CMND_LOADAVG
|
||||
GLIBTOP_CMND_SHM_LIMITS
|
||||
GLIBTOP_CMND_MSG_LIMITS
|
||||
GLIBTOP_CMND_SEM_LIMITS
|
||||
GLIBTOP_CMND_PROCLIST
|
||||
GLIBTOP_CMND_PROC_STATE
|
||||
GLIBTOP_CMND_PROC_UID
|
||||
GLIBTOP_CMND_PROC_MEM
|
||||
GLIBTOP_CMND_PROC_TIME
|
||||
GLIBTOP_CMND_PROC_SIGNAL
|
||||
GLIBTOP_CMND_PROC_KERNEL
|
||||
GLIBTOP_CMND_PROC_SEGMENT
|
||||
GLIBTOP_CMND_PROC_ARGS
|
||||
GLIBTOP_CMND_PROC_MAP
|
||||
GLIBTOP_CMND_MOUNTLIST
|
||||
GLIBTOP_CMND_FSUSAGE
|
||||
GLIBTOP_CMND_NETLOAD
|
||||
GLIBTOP_CMND_PPP
|
||||
GLIBTOP_CMND_NETLIST
|
||||
GLIBTOP_CMND_PROC_OPEN_FILES
|
||||
GLIBTOP_MAX_CMND
|
||||
glibtop_command
|
||||
glibtop_response
|
||||
glibtop_response_union
|
||||
glibtop_call
|
||||
glibtop_call_l
|
||||
glibtop_call_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/glibtop-server.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>glibtop-server</FILE>
|
||||
<TITLE>GlibTop Server</TITLE>
|
||||
glibtop_server
|
||||
glibtop_server_info
|
||||
glibtop_closure
|
||||
glibtop_server_new
|
||||
glibtop_server_ref
|
||||
glibtop_server_unref
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/netload.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>netload</FILE>
|
||||
<TITLE>Net Load</TITLE>
|
||||
GLIBTOP_NETLOAD_IF_FLAGS
|
||||
GLIBTOP_NETLOAD_MTU
|
||||
GLIBTOP_NETLOAD_SUBNET
|
||||
GLIBTOP_NETLOAD_ADDRESS
|
||||
GLIBTOP_NETLOAD_PACKETS_IN
|
||||
GLIBTOP_NETLOAD_PACKETS_OUT
|
||||
GLIBTOP_NETLOAD_PACKETS_TOTAL
|
||||
GLIBTOP_NETLOAD_BYTES_IN
|
||||
GLIBTOP_NETLOAD_BYTES_OUT
|
||||
GLIBTOP_NETLOAD_BYTES_TOTAL
|
||||
GLIBTOP_NETLOAD_ERRORS_IN
|
||||
GLIBTOP_NETLOAD_ERRORS_OUT
|
||||
GLIBTOP_NETLOAD_ERRORS_TOTAL
|
||||
GLIBTOP_NETLOAD_COLLISIONS
|
||||
GLIBTOP_NETLOAD_ADDRESS6
|
||||
GLIBTOP_NETLOAD_PREFIX6
|
||||
GLIBTOP_NETLOAD_SCOPE6
|
||||
GLIBTOP_NETLOAD_HWADDRESS
|
||||
GLIBTOP_MAX_NETLOAD
|
||||
glibtop_netload
|
||||
glibtop_get_netload
|
||||
glibtop_get_netload_r
|
||||
glibtop_get_netload_l
|
||||
glibtop_init_netload_p
|
||||
glibtop_get_netload_p
|
||||
glibtop_init_netload_s
|
||||
glibtop_get_netload_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/ppp.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>ppp</FILE>
|
||||
<TITLE>PPP</TITLE>
|
||||
GLIBTOP_PPP_STATE
|
||||
GLIBTOP_PPP_BYTES_IN
|
||||
GLIBTOP_PPP_BYTES_OUT
|
||||
GLIBTOP_MAX_PPP
|
||||
glibtop_ppp
|
||||
glibtop_get_ppp
|
||||
glibtop_get_ppp_r
|
||||
glibtop_get_ppp_l
|
||||
glibtop_init_ppp_p
|
||||
glibtop_get_ppp_p
|
||||
glibtop_init_ppp_s
|
||||
glibtop_get_ppp_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/shm_limits.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>shm_limits</FILE>
|
||||
<TITLE>Shared Memory Limits</TITLE>
|
||||
GLIBTOP_IPC_SHMMAX
|
||||
GLIBTOP_IPC_SHMMIN
|
||||
GLIBTOP_IPC_SHMMNI
|
||||
GLIBTOP_IPC_SHMSEG
|
||||
GLIBTOP_IPC_SHMALL
|
||||
GLIBTOP_MAX_SHM_LIMITS
|
||||
glibtop_shm_limits
|
||||
glibtop_get_shm_limits
|
||||
glibtop_get_shm_limits_r
|
||||
glibtop_get_shm_limits_l
|
||||
glibtop_init_shm_limits_p
|
||||
glibtop_get_shm_limits_p
|
||||
glibtop_init_shm_limits_s
|
||||
glibtop_get_shm_limits_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/uptime.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>uptime</FILE>
|
||||
<TITLE>Uptime</TITLE>
|
||||
GLIBTOP_UPTIME_UPTIME
|
||||
GLIBTOP_UPTIME_IDLETIME
|
||||
GLIBTOP_UPTIME_BOOT_TIME
|
||||
GLIBTOP_MAX_UPTIME
|
||||
glibtop_uptime
|
||||
glibtop_get_uptime
|
||||
glibtop_get_uptime_r
|
||||
glibtop_get_uptime_l
|
||||
glibtop_init_uptime_p
|
||||
glibtop_get_uptime_p
|
||||
glibtop_init_uptime_s
|
||||
glibtop_get_uptime_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/netlist.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>netlist</FILE>
|
||||
<TITLE>Net List</TITLE>
|
||||
GLIBTOP_NETLIST_NUMBER
|
||||
GLIBTOP_MAX_NETLIST
|
||||
glibtop_netlist
|
||||
glibtop_get_netlist
|
||||
glibtop_get_netlist_r
|
||||
glibtop_get_netlist_l
|
||||
glibtop_init_netlist_p
|
||||
glibtop_get_netlist_p
|
||||
glibtop_init_netlist_s
|
||||
glibtop_get_netlist_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/open.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>open</FILE>
|
||||
GLIBTOP_INIT_NO_OPEN
|
||||
GLIBTOP_INIT_NO_INIT
|
||||
GLIBTOP_FEATURES_NO_SERVER
|
||||
GLIBTOP_FEATURES_EXCEPT
|
||||
GLIBTOP_METHOD_DIRECT
|
||||
GLIBTOP_METHOD_PIPE
|
||||
GLIBTOP_METHOD_INET
|
||||
GLIBTOP_METHOD_UNIX
|
||||
GLIBTOP_ERROR_METHOD_IGNORE
|
||||
GLIBTOP_ERROR_METHOD_WARN_ONCE
|
||||
GLIBTOP_ERROR_METHOD_WARN
|
||||
GLIBTOP_ERROR_METHOD_ABORT
|
||||
GLIBTOP_ERROR_METHOD_DEFAULT
|
||||
glibtop_open_l
|
||||
glibtop_init_p
|
||||
glibtop_open_p
|
||||
glibtop_open_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/parameter.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>parameter</FILE>
|
||||
GLIBTOP_PARAM_METHOD
|
||||
GLIBTOP_PARAM_FEATURES
|
||||
GLIBTOP_PARAM_COMMAND
|
||||
GLIBTOP_PARAM_HOST
|
||||
GLIBTOP_PARAM_PORT
|
||||
GLIBTOP_PARAM_ERROR_METHOD
|
||||
GLIBTOP_PARAM_REQUIRED
|
||||
glibtop_get_parameter
|
||||
glibtop_set_parameter
|
||||
glibtop_get_parameter_l
|
||||
glibtop_set_parameter_l
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/procargs.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>procargs</FILE>
|
||||
GLIBTOP_PROC_ARGS_SIZE
|
||||
GLIBTOP_MAX_PROC_ARGS
|
||||
glibtop_proc_args
|
||||
glibtop_get_proc_args_l
|
||||
glibtop_get_proc_args
|
||||
glibtop_get_proc_args_r
|
||||
glibtop_init_proc_args_p
|
||||
glibtop_get_proc_args_p
|
||||
glibtop_init_proc_args_s
|
||||
glibtop_get_proc_args_s
|
||||
glibtop_get_proc_argv_l
|
||||
glibtop_get_proc_argv
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/procmem.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>procmem</FILE>
|
||||
GLIBTOP_PROC_MEM_SIZE
|
||||
GLIBTOP_PROC_MEM_VSIZE
|
||||
GLIBTOP_PROC_MEM_RESIDENT
|
||||
GLIBTOP_PROC_MEM_SHARE
|
||||
GLIBTOP_PROC_MEM_RSS
|
||||
GLIBTOP_PROC_MEM_RSS_RLIM
|
||||
GLIBTOP_MAX_PROC_MEM
|
||||
glibtop_proc_mem
|
||||
glibtop_get_proc_mem
|
||||
glibtop_get_proc_mem_r
|
||||
glibtop_get_proc_mem_l
|
||||
glibtop_init_proc_mem_p
|
||||
glibtop_get_proc_mem_p
|
||||
glibtop_init_proc_mem_s
|
||||
glibtop_get_proc_mem_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/procopenfiles.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>procopenfiles</FILE>
|
||||
GLIBTOP_PROC_OPEN_FILES_NUMBER
|
||||
GLIBTOP_PROC_OPEN_FILES_TOTAL
|
||||
GLIBTOP_PROC_OPEN_FILES_SIZE
|
||||
GLIBTOP_MAX_PROC_OPEN_FILES
|
||||
GLIBTOP_FILE_ENTRY_FD
|
||||
GLIBTOP_FILE_ENTRY_NAME
|
||||
GLIBTOP_FILE_ENTRY_TYPE
|
||||
GLIBTOP_FILE_ENTRY_INETSOCKET_DST_HOST
|
||||
GLIBTOP_FILE_ENTRY_INETSOCKET_DST_PORT
|
||||
GLIBTOP_MAX_OPEN_FILE_ENTRY
|
||||
GLIBTOP_OPEN_FILENAME_LEN
|
||||
GLIBTOP_OPEN_DEST_HOST_LEN
|
||||
glibtop_open_files_entry
|
||||
glibtop_proc_open_files
|
||||
glibtop_get_proc_open_files
|
||||
glibtop_get_proc_open_files_r
|
||||
glibtop_get_proc_open_files_l
|
||||
glibtop_init_proc_open_files_p
|
||||
glibtop_get_proc_open_files_p
|
||||
glibtop_init_proc_open_files_s
|
||||
glibtop_get_proc_open_files_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/procsegment.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>procsegment</FILE>
|
||||
GLIBTOP_PROC_SEGMENT_TEXT_RSS
|
||||
GLIBTOP_PROC_SEGMENT_SHLIB_RSS
|
||||
GLIBTOP_PROC_SEGMENT_DATA_RSS
|
||||
GLIBTOP_PROC_SEGMENT_STACK_RSS
|
||||
GLIBTOP_PROC_SEGMENT_DIRTY_SIZE
|
||||
GLIBTOP_PROC_SEGMENT_START_CODE
|
||||
GLIBTOP_PROC_SEGMENT_END_CODE
|
||||
GLIBTOP_PROC_SEGMENT_START_STACK
|
||||
GLIBTOP_MAX_PROC_SEGMENT
|
||||
glibtop_proc_segment
|
||||
glibtop_get_proc_segment
|
||||
glibtop_get_proc_segment_r
|
||||
glibtop_get_proc_segment_l
|
||||
glibtop_init_proc_segment_p
|
||||
glibtop_get_proc_segment_p
|
||||
glibtop_init_proc_segment_s
|
||||
glibtop_get_proc_segment_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/procsignal.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>procsignal</FILE>
|
||||
GLIBTOP_PROC_SIGNAL_SIGNAL
|
||||
GLIBTOP_PROC_SIGNAL_BLOCKED
|
||||
GLIBTOP_PROC_SIGNAL_SIGIGNORE
|
||||
GLIBTOP_PROC_SIGNAL_SIGCATCH
|
||||
GLIBTOP_MAX_PROC_SIGNAL
|
||||
glibtop_proc_signal
|
||||
glibtop_get_proc_signal
|
||||
glibtop_get_proc_signal_r
|
||||
glibtop_get_proc_signal_l
|
||||
glibtop_init_proc_signal_p
|
||||
glibtop_get_proc_signal_p
|
||||
glibtop_init_proc_signal_s
|
||||
glibtop_get_proc_signal_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/sysdeps.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>sysdeps</FILE>
|
||||
GLIBTOP_SYSDEPS_FEATURES
|
||||
GLIBTOP_SYSDEPS_CPU
|
||||
GLIBTOP_SYSDEPS_MEM
|
||||
GLIBTOP_SYSDEPS_SWAP
|
||||
GLIBTOP_SYSDEPS_UPTIME
|
||||
GLIBTOP_SYSDEPS_LOADAVG
|
||||
GLIBTOP_SYSDEPS_SHM_LIMITS
|
||||
GLIBTOP_SYSDEPS_MSG_LIMITS
|
||||
GLIBTOP_SYSDEPS_SEM_LIMITS
|
||||
GLIBTOP_SYSDEPS_PROCLIST
|
||||
GLIBTOP_SYSDEPS_PROC_STATE
|
||||
GLIBTOP_SYSDEPS_PROC_UID
|
||||
GLIBTOP_SYSDEPS_PROC_MEM
|
||||
GLIBTOP_SYSDEPS_PROC_TIME
|
||||
GLIBTOP_SYSDEPS_PROC_SIGNAL
|
||||
GLIBTOP_SYSDEPS_PROC_KERNEL
|
||||
GLIBTOP_SYSDEPS_PROC_SEGMENT
|
||||
GLIBTOP_SYSDEPS_PROC_ARGS
|
||||
GLIBTOP_SYSDEPS_PROC_MAP
|
||||
GLIBTOP_SYSDEPS_MOUNTLIST
|
||||
GLIBTOP_SYSDEPS_FSUSAGE
|
||||
GLIBTOP_SYSDEPS_NETLOAD
|
||||
GLIBTOP_SYSDEPS_PPP
|
||||
GLIBTOP_SYSDEPS_NETLIST
|
||||
GLIBTOP_SYSDEPS_PROC_OPEN_FILES
|
||||
GLIBTOP_MAX_SYSDEPS
|
||||
GLIBTOP_SYSDEPS_ALL
|
||||
glibtop_sysdeps
|
||||
glibtop_get_sysdeps
|
||||
glibtop_get_sysdeps_r
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/procstate.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>procstate</FILE>
|
||||
GLIBTOP_PROC_STATE_CMD
|
||||
GLIBTOP_PROC_STATE_STATE
|
||||
GLIBTOP_PROC_STATE_UID
|
||||
GLIBTOP_PROC_STATE_GID
|
||||
GLIBTOP_PROC_STATE_RUID
|
||||
GLIBTOP_PROC_STATE_RGID
|
||||
GLIBTOP_PROC_STATE_HAS_CPU
|
||||
GLIBTOP_PROC_STATE_PROCESSOR
|
||||
GLIBTOP_PROC_STATE_LAST_PROCESSOR
|
||||
GLIBTOP_MAX_PROC_STATE
|
||||
GLIBTOP_PROCESS_RUNNING
|
||||
GLIBTOP_PROCESS_INTERRUPTIBLE
|
||||
GLIBTOP_PROCESS_UNINTERRUPTIBLE
|
||||
GLIBTOP_PROCESS_ZOMBIE
|
||||
GLIBTOP_PROCESS_STOPPED
|
||||
GLIBTOP_PROCESS_SWAPPING
|
||||
GLIBTOP_PROCESS_DEAD
|
||||
glibtop_proc_state
|
||||
glibtop_get_proc_state
|
||||
glibtop_get_proc_state_r
|
||||
glibtop_get_proc_state_l
|
||||
glibtop_init_proc_state_p
|
||||
glibtop_get_proc_state_p
|
||||
glibtop_init_proc_state_s
|
||||
glibtop_get_proc_state_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/procuid.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>procuid</FILE>
|
||||
GLIBTOP_PROC_UID_UID
|
||||
GLIBTOP_PROC_UID_EUID
|
||||
GLIBTOP_PROC_UID_GID
|
||||
GLIBTOP_PROC_UID_EGID
|
||||
GLIBTOP_PROC_UID_SUID
|
||||
GLIBTOP_PROC_UID_SGID
|
||||
GLIBTOP_PROC_UID_FSUID
|
||||
GLIBTOP_PROC_UID_FSGID
|
||||
GLIBTOP_PROC_UID_PID
|
||||
GLIBTOP_PROC_UID_PPID
|
||||
GLIBTOP_PROC_UID_PGRP
|
||||
GLIBTOP_PROC_UID_SESSION
|
||||
GLIBTOP_PROC_UID_TTY
|
||||
GLIBTOP_PROC_UID_TPGID
|
||||
GLIBTOP_PROC_UID_PRIORITY
|
||||
GLIBTOP_PROC_UID_NICE
|
||||
GLIBTOP_PROC_UID_NGROUPS
|
||||
GLIBTOP_PROC_UID_GROUPS
|
||||
GLIBTOP_MAX_PROC_UID
|
||||
glibtop_proc_uid
|
||||
GLIBTOP_MAX_GROUPS
|
||||
glibtop_get_proc_uid
|
||||
glibtop_get_proc_uid_r
|
||||
glibtop_get_proc_uid_l
|
||||
glibtop_init_proc_uid_p
|
||||
glibtop_get_proc_uid_p
|
||||
glibtop_init_proc_uid_s
|
||||
glibtop_get_proc_uid_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/proctime.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>proctime</FILE>
|
||||
GLIBTOP_PROC_TIME_START_TIME
|
||||
GLIBTOP_PROC_TIME_RTIME
|
||||
GLIBTOP_PROC_TIME_UTIME
|
||||
GLIBTOP_PROC_TIME_STIME
|
||||
GLIBTOP_PROC_TIME_CUTIME
|
||||
GLIBTOP_PROC_TIME_CSTIME
|
||||
GLIBTOP_PROC_TIME_TIMEOUT
|
||||
GLIBTOP_PROC_TIME_IT_REAL_VALUE
|
||||
GLIBTOP_PROC_TIME_FREQUENCY
|
||||
GLIBTOP_PROC_TIME_XCPU_UTIME
|
||||
GLIBTOP_PROC_TIME_XCPU_STIME
|
||||
GLIBTOP_MAX_PROC_TIME
|
||||
glibtop_proc_time
|
||||
glibtop_get_proc_time
|
||||
glibtop_get_proc_time_r
|
||||
glibtop_get_proc_time_l
|
||||
glibtop_init_proc_time_p
|
||||
glibtop_get_proc_time_p
|
||||
glibtop_init_proc_time_s
|
||||
glibtop_get_proc_time_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/signal.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>signal</FILE>
|
||||
glibtop_signame
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/procmap.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>procmap</FILE>
|
||||
GLIBTOP_PROC_MAP_NUMBER
|
||||
GLIBTOP_PROC_MAP_TOTAL
|
||||
GLIBTOP_PROC_MAP_SIZE
|
||||
GLIBTOP_MAX_PROC_MAP
|
||||
GLIBTOP_MAP_ENTRY_START
|
||||
GLIBTOP_MAP_ENTRY_END
|
||||
GLIBTOP_MAP_ENTRY_OFFSET
|
||||
GLIBTOP_MAP_ENTRY_PERM
|
||||
GLIBTOP_MAP_ENTRY_INODE
|
||||
GLIBTOP_MAP_ENTRY_DEVICE
|
||||
GLIBTOP_MAP_ENTRY_FILENAME
|
||||
GLIBTOP_MAP_ENTRY_SIZE
|
||||
GLIBTOP_MAP_ENTRY_RSS
|
||||
GLIBTOP_MAP_ENTRY_SHARED_CLEAN
|
||||
GLIBTOP_MAP_ENTRY_SHARED_DIRTY
|
||||
GLIBTOP_MAP_ENTRY_PRIVATE_CLEAN
|
||||
GLIBTOP_MAP_ENTRY_PRIVATE_DIRTY
|
||||
GLIBTOP_MAX_MAP_ENTRY
|
||||
GLIBTOP_MAP_FILENAME_LEN
|
||||
GLIBTOP_MAP_PERM_READ
|
||||
GLIBTOP_MAP_PERM_WRITE
|
||||
GLIBTOP_MAP_PERM_EXECUTE
|
||||
GLIBTOP_MAP_PERM_SHARED
|
||||
GLIBTOP_MAP_PERM_PRIVATE
|
||||
glibtop_map_entry
|
||||
glibtop_proc_map
|
||||
glibtop_get_proc_map
|
||||
glibtop_get_proc_map_r
|
||||
glibtop_get_proc_map_l
|
||||
glibtop_init_proc_map_p
|
||||
glibtop_get_proc_map_p
|
||||
glibtop_init_proc_map_s
|
||||
glibtop_get_proc_map_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/sysinfo.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>sysinfo</FILE>
|
||||
GLIBTOP_SYSINFO_NCPU
|
||||
GLIBTOP_SYSINFO_CPUINFO
|
||||
GLIBTOP_MAX_SYSINFO
|
||||
glibtop_sysinfo
|
||||
glibtop_entry
|
||||
glibtop_get_sysinfo_r
|
||||
glibtop_get_sysinfo_s
|
||||
glibtop_get_sysinfo
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/union.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>union</FILE>
|
||||
glibtop_union
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/version.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>version</FILE>
|
||||
LIBGTOP_VERSION_STRING
|
||||
glibtop_send_version
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/proclist.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>proclist</FILE>
|
||||
GLIBTOP_PROCLIST_NUMBER
|
||||
GLIBTOP_PROCLIST_TOTAL
|
||||
GLIBTOP_PROCLIST_SIZE
|
||||
GLIBTOP_MAX_PROCLIST
|
||||
GLIBTOP_KERN_PROC_ALL
|
||||
GLIBTOP_KERN_PROC_PID
|
||||
GLIBTOP_KERN_PROC_PGRP
|
||||
GLIBTOP_KERN_PROC_SESSION
|
||||
GLIBTOP_KERN_PROC_TTY
|
||||
GLIBTOP_KERN_PROC_UID
|
||||
GLIBTOP_KERN_PROC_RUID
|
||||
GLIBTOP_KERN_PROC_MASK
|
||||
GLIBTOP_EXCLUDE_IDLE
|
||||
GLIBTOP_EXCLUDE_SYSTEM
|
||||
GLIBTOP_EXCLUDE_NOTTY
|
||||
glibtop_proclist
|
||||
glibtop_get_proclist
|
||||
glibtop_get_proclist_r
|
||||
glibtop_get_proclist_l
|
||||
glibtop_init_proclist_p
|
||||
glibtop_get_proclist_p
|
||||
glibtop_init_proclist_s
|
||||
glibtop_get_proclist_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/sem_limits.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>sem_limits</FILE>
|
||||
GLIBTOP_IPC_SEMMAP
|
||||
GLIBTOP_IPC_SEMMNI
|
||||
GLIBTOP_IPC_SEMMNS
|
||||
GLIBTOP_IPC_SEMMNU
|
||||
GLIBTOP_IPC_SEMMSL
|
||||
GLIBTOP_IPC_SEMOPM
|
||||
GLIBTOP_IPC_SEMUME
|
||||
GLIBTOP_IPC_SEMUSZ
|
||||
GLIBTOP_IPC_SEMVMX
|
||||
GLIBTOP_IPC_SEMAEM
|
||||
GLIBTOP_MAX_SEM_LIMITS
|
||||
glibtop_sem_limits
|
||||
glibtop_get_sem_limits
|
||||
glibtop_get_sem_limits_r
|
||||
glibtop_get_sem_limits_l
|
||||
glibtop_init_sem_limits_p
|
||||
glibtop_get_sem_limits_p
|
||||
glibtop_init_sem_limits_s
|
||||
glibtop_get_sem_limits_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/prockernel.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>prockernel</FILE>
|
||||
GLIBTOP_PROC_KERNEL_K_FLAGS
|
||||
GLIBTOP_PROC_KERNEL_MIN_FLT
|
||||
GLIBTOP_PROC_KERNEL_MAJ_FLT
|
||||
GLIBTOP_PROC_KERNEL_CMIN_FLT
|
||||
GLIBTOP_PROC_KERNEL_CMAJ_FLT
|
||||
GLIBTOP_PROC_KERNEL_KSTK_ESP
|
||||
GLIBTOP_PROC_KERNEL_KSTK_EIP
|
||||
GLIBTOP_PROC_KERNEL_NWCHAN
|
||||
GLIBTOP_PROC_KERNEL_WCHAN
|
||||
GLIBTOP_MAX_PROC_KERNEL
|
||||
glibtop_proc_kernel
|
||||
glibtop_get_proc_kernel
|
||||
glibtop_get_proc_kernel_r
|
||||
glibtop_get_proc_kernel_l
|
||||
glibtop_init_proc_kernel_p
|
||||
glibtop_get_proc_kernel_p
|
||||
glibtop_init_proc_kernel_s
|
||||
glibtop_get_proc_kernel_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/fsusage.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>fsusage</FILE>
|
||||
GLIBTOP_FSUSAGE_BLOCKS
|
||||
GLIBTOP_FSUSAGE_BFREE
|
||||
GLIBTOP_FSUSAGE_BAVAIL
|
||||
GLIBTOP_FSUSAGE_FILES
|
||||
GLIBTOP_FSUSAGE_FFREE
|
||||
GLIBTOP_FSUSAGE_BLOCK_SIZE
|
||||
GLIBTOP_FSUSAGE_READ
|
||||
GLIBTOP_FSUSAGE_WRITE
|
||||
GLIBTOP_MAX_FSUSAGE
|
||||
glibtop_fsusage
|
||||
glibtop_get_fsusage
|
||||
glibtop_get_fsusage_r
|
||||
glibtop_get_fsusage_l
|
||||
glibtop_get_fsusage_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/loadavg.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>loadavg</FILE>
|
||||
GLIBTOP_LOADAVG_LOADAVG
|
||||
GLIBTOP_LOADAVG_NR_RUNNING
|
||||
GLIBTOP_LOADAVG_NR_TASKS
|
||||
GLIBTOP_LOADAVG_LAST_PID
|
||||
GLIBTOP_MAX_LOADAVG
|
||||
glibtop_loadavg
|
||||
glibtop_get_loadavg
|
||||
glibtop_get_loadavg_r
|
||||
glibtop_get_loadavg_l
|
||||
glibtop_init_loadavg_p
|
||||
glibtop_get_loadavg_p
|
||||
glibtop_init_loadavg_s
|
||||
glibtop_get_loadavg_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/mem.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>mem</FILE>
|
||||
GLIBTOP_MEM_TOTAL
|
||||
GLIBTOP_MEM_USED
|
||||
GLIBTOP_MEM_FREE
|
||||
GLIBTOP_MEM_SHARED
|
||||
GLIBTOP_MEM_BUFFER
|
||||
GLIBTOP_MEM_CACHED
|
||||
GLIBTOP_MEM_USER
|
||||
GLIBTOP_MEM_LOCKED
|
||||
GLIBTOP_MAX_MEM
|
||||
glibtop_mem
|
||||
glibtop_get_mem
|
||||
glibtop_get_mem_r
|
||||
glibtop_get_mem_l
|
||||
glibtop_init_mem_p
|
||||
glibtop_get_mem_p
|
||||
glibtop_init_mem_s
|
||||
glibtop_get_mem_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/mountlist.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>mountlist</FILE>
|
||||
GLIBTOP_MOUNTLIST_NUMBER
|
||||
GLIBTOP_MOUNTLIST_TOTAL
|
||||
GLIBTOP_MOUNTLIST_SIZE
|
||||
GLIBTOP_MAX_MOUNTLIST
|
||||
glibtop_mountentry
|
||||
glibtop_mountlist
|
||||
glibtop_get_mountlist
|
||||
glibtop_get_mountlist_r
|
||||
glibtop_get_mountlist_l
|
||||
glibtop_get_mountlist_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/msg_limits.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>msg_limits</FILE>
|
||||
GLIBTOP_IPC_MSGPOOL
|
||||
GLIBTOP_IPC_MSGMAP
|
||||
GLIBTOP_IPC_MSGMAX
|
||||
GLIBTOP_IPC_MSGMNB
|
||||
GLIBTOP_IPC_MSGMNI
|
||||
GLIBTOP_IPC_MSGSSZ
|
||||
GLIBTOP_IPC_MSGTQL
|
||||
GLIBTOP_MAX_MSG_LIMITS
|
||||
glibtop_msg_limits
|
||||
glibtop_get_msg_limits
|
||||
glibtop_get_msg_limits_r
|
||||
glibtop_get_msg_limits_l
|
||||
glibtop_init_msg_limits_p
|
||||
glibtop_get_msg_limits_p
|
||||
glibtop_init_msg_limits_s
|
||||
glibtop_get_msg_limits_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/cpu.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>cpu</FILE>
|
||||
GLIBTOP_CPU_TOTAL
|
||||
GLIBTOP_CPU_USER
|
||||
GLIBTOP_CPU_NICE
|
||||
GLIBTOP_CPU_SYS
|
||||
GLIBTOP_CPU_IDLE
|
||||
GLIBTOP_CPU_FREQUENCY
|
||||
GLIBTOP_XCPU_TOTAL
|
||||
GLIBTOP_XCPU_USER
|
||||
GLIBTOP_XCPU_NICE
|
||||
GLIBTOP_XCPU_SYS
|
||||
GLIBTOP_XCPU_IDLE
|
||||
GLIBTOP_XCPU_FLAGS
|
||||
GLIBTOP_CPU_IOWAIT
|
||||
GLIBTOP_CPU_IRQ
|
||||
GLIBTOP_CPU_SOFTIRQ
|
||||
GLIBTOP_XCPU_IOWAIT
|
||||
GLIBTOP_XCPU_IRQ
|
||||
GLIBTOP_XCPU_SOFTIRQ
|
||||
GLIBTOP_MAX_CPU
|
||||
GLIBTOP_NCPU
|
||||
glibtop_cpu
|
||||
glibtop_get_cpu
|
||||
glibtop_get_cpu_r
|
||||
glibtop_get_cpu_l
|
||||
glibtop_init_cpu_p
|
||||
glibtop_get_cpu_p
|
||||
glibtop_init_cpu_s
|
||||
glibtop_get_cpu_s
|
||||
</SECTION>
|
||||
|
||||
<INCLUDE>glibtop/swap.h</INCLUDE>
|
||||
<SECTION>
|
||||
<FILE>swap</FILE>
|
||||
GLIBTOP_SWAP_TOTAL
|
||||
GLIBTOP_SWAP_USED
|
||||
GLIBTOP_SWAP_FREE
|
||||
GLIBTOP_SWAP_PAGEIN
|
||||
GLIBTOP_SWAP_PAGEOUT
|
||||
GLIBTOP_MAX_SWAP
|
||||
glibtop_swap
|
||||
glibtop_get_swap
|
||||
glibtop_get_swap_r
|
||||
glibtop_get_swap_l
|
||||
glibtop_init_swap_p
|
||||
glibtop_get_swap_p
|
||||
glibtop_init_swap_s
|
||||
glibtop_get_swap_s
|
||||
</SECTION>
|
||||
|
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
|
||||
<phrase>@PACKAGE_VERSION@</phrase>
|
@@ -1,90 +0,0 @@
|
||||
@node White Paper, Reference Manual, About, Top
|
||||
@chapter LibGTop White Paper
|
||||
|
||||
@menu
|
||||
* Introduction:: Introduction
|
||||
* Overview:: Overview
|
||||
@end menu
|
||||
|
||||
@node Introduction, Overview, White Paper, White Paper
|
||||
@section Introduction
|
||||
|
||||
Many modern UNIX systems like Solaris, BSD or Digitial Unix only allow
|
||||
priviledged processes to read information like CPU and Memory Usage or
|
||||
information about running processes.
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
BSD, for instance, doesn't have any other way to get those data than reading
|
||||
directly from @file{/dev/kmem} and you need to be in the @code{kmem} group to
|
||||
be able to read this.
|
||||
|
||||
@item
|
||||
Other systems, like Digital Unix, allow all users to get things like CPU and
|
||||
Memory statistics, but only root may read information about any process other
|
||||
than the current one (you may not even get information about your own processes
|
||||
if you're not root).
|
||||
|
||||
@item
|
||||
Linux has a very nice @file{/proc} filesystem, but reading and parsing
|
||||
@file{/proc} is very slow and inefficient.
|
||||
|
||||
@item
|
||||
Solaris is a bit better, but you still need to be in the @code{sys} group or
|
||||
even root to get some data.
|
||||
@end itemize
|
||||
|
||||
Because of this system utilities like @code{ps}, @code{uptime} or @code{top}
|
||||
often are setgid kmem or setuid root. Usually, they're also very specific to
|
||||
the system they're written for and not easily portable to other systems without
|
||||
a lot of work.
|
||||
|
||||
This, of cause, becomes a problem for graphical tools like @code{gtop} - making
|
||||
a GTK+ program setgid or even setuid would be a security hole as big as you can
|
||||
drive the entire X11 source code through. For the GNOME project, we also needed
|
||||
some kind of library which provides all the required information in a portable
|
||||
since there's more than just one single program that wants to use them - for
|
||||
instance @code{gtop} and the @code{multiload}, @code{cpumemusage} and
|
||||
@code{netload} panel applets.
|
||||
|
||||
@node Overview, , Introduction, White Paper
|
||||
@section Overview
|
||||
|
||||
This section should give you a short overview on how LibGTop was developed, which
|
||||
things needed to be considered and how it works.
|
||||
|
||||
@menu
|
||||
* Interface Design:: Things that need to be considered
|
||||
* Server Implementation:: The LibGTop "server"
|
||||
@end menu
|
||||
|
||||
@node Interface Design, Server Implementation, Overview, Overview
|
||||
@subsection Interface Design
|
||||
|
||||
At the very beginning, it was necessary to collect all the data the library part
|
||||
should provide and put them into some C structures. This was not that easiy as it
|
||||
might sound since LibGTop should be portable to any modern UNIX system with a common
|
||||
library part on all those systems, but the data that should be returned vary from
|
||||
system to system. For instance some systems support shared memory, but some others
|
||||
may not.
|
||||
|
||||
The header files where we define these C structures (which are system-independent) are
|
||||
shared between client and server. This way we can call the system dependent code
|
||||
directly where we do not need any special privileges to do so.
|
||||
|
||||
All of those structures contain a @code{flags} member which is interpreted as a bit
|
||||
mask and tells the caller of the library functions which of the fields in the returned
|
||||
structure are valid and which are not.
|
||||
|
||||
@node Server Implementation, , Interface Design, Overview
|
||||
@subsection Server Implementation
|
||||
|
||||
The LibGTop @dfn{server} is a setgid/setuid binary which contains all the system
|
||||
dependent code which needs special privileges. It is only build if it's required
|
||||
on the current system (for instance, the Linux kernel provides all the required
|
||||
data via its @file{/proc} filesystem so we do not need the server at all) and it
|
||||
only contains the @dfn{features} which need privileges.
|
||||
|
||||
Whenever we do not need any privileges to get all the data for some of the requested
|
||||
structures (here called @dfn{features}) the library calls the sysdeps code directly
|
||||
rather than using the server.
|
13
examples/.cvsignore
Normal file
13
examples/.cvsignore
Normal file
@@ -0,0 +1,13 @@
|
||||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
first
|
||||
first_linux
|
||||
first_static
|
||||
second
|
||||
third
|
||||
third_linux
|
||||
third_static
|
||||
second_static
|
||||
second_linux
|
@@ -1,243 +0,0 @@
|
||||
2007-05-19 Benoît Dejean <benoit@placenet.org>
|
||||
|
||||
* Makefile.am:
|
||||
* mem.c: (main):
|
||||
* wd.c: (main):
|
||||
|
||||
Fixed wd and new simple mem example.
|
||||
|
||||
2006-02-27 Benoît Dejean <benoit@placenet.org>
|
||||
|
||||
* pprint.c: (pprint_get_proc_mem), (main):
|
||||
|
||||
Added proc_mem example.
|
||||
|
||||
2005-12-15 Benoît Dejean <benoit@placenet.org>
|
||||
|
||||
* proclist.c: (print_pids), (main):
|
||||
|
||||
Improved example.
|
||||
|
||||
2005-12-12 Benoît Dejean <benoit@placenet.org>
|
||||
|
||||
* .cvsignore:
|
||||
* Makefile.am:
|
||||
* proclist.c: (main):
|
||||
* procmap.c: (main):
|
||||
|
||||
Added quick example for glibtop_get_proclist()
|
||||
and updated procmap example to display smap.
|
||||
|
||||
2005-08-02 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* pprint.c: (pprint_get_cpu), (pprint_get_loadavg),
|
||||
(pprint_get_mem), (pprint_get_msg_limits), (pprint_get_netlist),
|
||||
(pprint_get_swap), (pprint_get_uptime), (pprint_get_proc_kernel),
|
||||
(main):
|
||||
|
||||
Added pprint_get_proc_kernel(pid).
|
||||
Fixed prototypes.
|
||||
|
||||
2005-01-22 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* openfiles.c: (show_open_files): Updated.
|
||||
|
||||
2004-12-23 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* netload.c: (main):
|
||||
* procmap.c: (main): s/glibtop_error/g_error/g
|
||||
|
||||
2004-11-15 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* netload.c: (hwaddress_format_for_display), (main): Updated.
|
||||
|
||||
2004-11-13 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* pprint.c: (pprint_get_fsusage), (pprint_get_mountlist),
|
||||
(pprint_get_netload), (pprint_get_netlist), (main): Updated.
|
||||
|
||||
2004-09-25 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* pprint.c: (main): Re-added pprint_get_msg_limits()
|
||||
|
||||
i2004-09-25 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* df.c: (main):
|
||||
* pprint.c: (main):
|
||||
* procargs.c: (main): Added missing call to glibgtop_init() / glibtop_close()
|
||||
|
||||
2004-09-24 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* .cvsignore:
|
||||
* Makefile.am:
|
||||
* ../configure.in
|
||||
* df.c: (print_fsusage), (main): Added new example, just like 'df'.
|
||||
|
||||
2004-09-22 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* pprint.c: (main): Disable pprint_get_msg_limits() because it can fail.
|
||||
|
||||
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* pprint.c: (pprint_get_swap), (main): Updated.
|
||||
|
||||
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* procargs.c: (show_args), (main): Updated.
|
||||
|
||||
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* pprint.c: (pprint_get_mountlist), (pprint_get_netload),
|
||||
(pprint_get_uptime), (main): Updated.
|
||||
|
||||
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* pprint.c: (pprint_get_mountlist): Updated.
|
||||
|
||||
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* procargs.c: (show_args), (main): Updated.
|
||||
|
||||
2004-09-20 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* .cvsignore:
|
||||
* Makefile.am:
|
||||
* pprint.c: (pprint_get_cpu), (pprint_get_fsusage),
|
||||
(pprint_get_loadavg), (pprint_get_mem), (pprint_get_mountlist),
|
||||
(pprint_get_msg_limits), (main): Added new example : pretty prints
|
||||
the result of glibtop_*. Work in progress.
|
||||
|
||||
Now builds procargs.
|
||||
|
||||
* ../configure.in: Added to static list.
|
||||
|
||||
2004-07-07 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* procargs.c: Added glibtop_get_proc_argv demo.
|
||||
|
||||
2003-12-27 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
* mountlist.c: Updated to display block size too.
|
||||
|
||||
2004-03-04 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* smp.c: use libgtop-i18n.h
|
||||
|
||||
2003-10-21 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* Makefile.am:
|
||||
* smp.c:
|
||||
* sysdeps.c: (main): install only one library, libgtop-2.0
|
||||
Fix build-time warnings due to the redefinition of guint64
|
||||
Fix building smp.c and sysdeps.c
|
||||
|
||||
2003-10-20 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* first.c:
|
||||
* mountlist.c:
|
||||
* netload.c:
|
||||
* procmap.c:
|
||||
* second.c:
|
||||
* smp.c:
|
||||
* sysdeps.c:
|
||||
* third.c:
|
||||
* timings.c: fixed compilation
|
||||
|
||||
2003-10-20 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* Makefile.am: removed traces of guile, intllibs and libgnomesupport
|
||||
|
||||
2001-01-14 Abel Cheung <maddog@linux.org.hk>
|
||||
|
||||
* \*.c: bindtextdomain and textdomain uses GETTEXT_PACKAGE.
|
||||
|
||||
* Makefile.am, first.c, second.c, sysdeps.c: Make them at least
|
||||
compile for now, by disabling chunks which should belong to
|
||||
HEAD branch.
|
||||
|
||||
1999-05-28 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* first.c, second.c, sysdeps.c: Use LibGTop version conditionals
|
||||
so we can more easily merge the code into LIBGTOP_STABLE_1_0.
|
||||
|
||||
1999-05-07 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* timings.c (timersub): Renamed this to `libgtop_timersub' and define
|
||||
it on all systems.
|
||||
|
||||
Fri Apr 9 00:14:52 1999 Timur Bakeyev <timur@gnu.org>
|
||||
|
||||
* timings.c: Added timersub defenition, to make code compilable on
|
||||
BSDI.
|
||||
|
||||
1999-03-24 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* timings.c: New example.
|
||||
|
||||
1999-03-17 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* first.c, second.c: Fixed a bug that caused a core dump when
|
||||
the sysdeps code does not return all data.
|
||||
|
||||
1998-11-22 Martin Baulig <baulig@taurus.uni-trier.de>
|
||||
|
||||
* netload.c: Call inet_ntoa () to get address and subnet
|
||||
in quatted dot notation (like 136.199.14.201) and not just
|
||||
as a number (like 0xc90ec788).
|
||||
|
||||
1998-11-02 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* sysdeps.c: New example.
|
||||
|
||||
1998-10-26 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* netload.c: New file. Gets network load for the interface
|
||||
given as command line argument.
|
||||
|
||||
1998-10-26 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* first.c (glibtop_get_proc_args): Get command line arguments.
|
||||
* second.c: Likewise.
|
||||
|
||||
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* first.c (glibtop_get_ppp): Get PPP/ISDN statistics.
|
||||
|
||||
1998-09-28 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* Makefile.am: Install everything in $(libexecdir)/libgtop.
|
||||
|
||||
1998-09-09 Martin Baulig <baulig@Stud.Informatik.uni-trier.de>
|
||||
|
||||
* smp.c: New file. Nice tool to show CPU statistics on SMP systems.
|
||||
|
||||
1998-08-25 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* first.c, second.c, procmap.c: Fixed some compiler warnings.
|
||||
|
||||
1998-08-18 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* procmap.c: We now display filenames when compiled
|
||||
`--with-libgtop-inodedb'.
|
||||
|
||||
1998-08-12 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* second.c: Works a little bit more like `ps' - you can
|
||||
give an optional command line argument to get information
|
||||
about a single process.
|
||||
|
||||
1998-07-22 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* mountlist.c: New file.
|
||||
|
||||
1998-06-12 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* test.scm: New file.
|
||||
|
||||
1998-06-07 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* Makefile.am (CFLAGS): Disable optimize.
|
||||
|
||||
* first.c (PROFILE_COUNT): Number of times each function
|
||||
should be called. Defaults to 1; to profile the code, you
|
||||
can increase this when compiling.
|
@@ -2,59 +2,70 @@
|
||||
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
INCLUDES = @INCLUDES@
|
||||
INCLUDES = -I$(top_builddir) -I$(top_srcdir) @machine_incs@ \
|
||||
-I$(top_srcdir)/include -I$(top_srcdir)/intl @GUILE_INCS@ \
|
||||
-DGTOPLOCALEDIR=\"$(datadir)/locale\" -D_GNU_SOURCE
|
||||
|
||||
CFLAGS = -Wall -W @CFLAGS@
|
||||
|
||||
DEFS = @DEFS@
|
||||
|
||||
noinst_PROGRAMS = first second pprint procargs df netlist \
|
||||
mountlist procmap netload sysdeps timings \
|
||||
openfiles smp proclist mem wd
|
||||
bin_PROGRAMS = first first_static first_linux \
|
||||
second second_static second_linux \
|
||||
@guile_examples@
|
||||
|
||||
EXTRA_PROGRAMS = third third_static third_linux
|
||||
|
||||
first_SOURCES = first.c
|
||||
first_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
first_LDADD = $(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/lib/libgtop.la \
|
||||
@INTLLIBS@ @LIBSUPPORT@
|
||||
|
||||
first_static_SOURCES = $(first_SOURCES)
|
||||
first_static_LDADD = $(first_LDADD)
|
||||
first_static_LDFLAGS = -static
|
||||
|
||||
first_linux_SOURCES = $(first_SOURCES)
|
||||
first_linux_LDADD = $(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
|
||||
@INTLLIBS@ @LIBSUPPORT@
|
||||
first_linux_LDFLAGS = -static
|
||||
|
||||
second_SOURCES = second.c
|
||||
second_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm
|
||||
second_LDADD = $(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/lib/libgtop.la \
|
||||
@INTLLIBS@ @LIBSUPPORT@
|
||||
|
||||
procmap_SOURCES = procmap.c
|
||||
procmap_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
second_static_SOURCES = $(second_SOURCES)
|
||||
second_static_LDADD = $(second_LDADD)
|
||||
second_static_LDFLAGS = -static
|
||||
|
||||
netload_SOURCES = netload.c
|
||||
netload_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
second_linux_SOURCES = $(second_SOURCES)
|
||||
second_linux_LDADD = $(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
|
||||
@INTLLIBS@ @LIBSUPPORT@
|
||||
second_linux_LDFLAGS = -static
|
||||
|
||||
sysdeps_SOURCES = sysdeps.c
|
||||
sysdeps_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
if GLIBTOP_NAMES
|
||||
third_guile_names_LIBS = $(top_builddir)/sysdeps/guile/names/libgtop_guile_names.la
|
||||
third_names_LIBS = $(top_builddir)/sysdeps/names/libgtop_names.la
|
||||
endif
|
||||
|
||||
mountlist_SOURCES = mountlist.c
|
||||
mountlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
third_SOURCES = third.c
|
||||
third_LDADD = $(top_builddir)/sysdeps/guile/libgtop_guile.la \
|
||||
$(third_guile_names_LIBS) $(third_names_LIBS) \
|
||||
$(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/lib/libgtop.la \
|
||||
@GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@
|
||||
|
||||
smp_SOURCES = smp.c
|
||||
smp_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm
|
||||
|
||||
timings_SOURCES = timings.c
|
||||
timings_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
pprint_SOURCES = pprint.c
|
||||
pprint_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
procargs_SOURCES = procargs.c
|
||||
procargs_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
df_SOURCES = df.c
|
||||
df_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
netlist_SOURCES = netlist.c
|
||||
netlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
openfiles_SOURCES = openfiles.c
|
||||
openfiles_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
proclist_SOURCES = proclist.c
|
||||
proclist_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
wd_SOURCES = wd.c
|
||||
wd_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
mem_SOURCE = mem.c
|
||||
mem_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
third_static_SOURCES = $(third_SOURCES)
|
||||
third_static_LDADD = $(third_LDADD)
|
||||
third_static_LDFLAGS = -static
|
||||
|
||||
third_linux_SOURCES = $(third_SOURCES)
|
||||
third_linux_LDADD = $(top_builddir)/sysdeps/guile/libgtop_guile.la \
|
||||
$(third_guile_names_LIBS) $(third_names_LIBS) \
|
||||
$(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
|
||||
@GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@
|
||||
third_linux_LDFLAGS = -static
|
||||
|
@@ -1,51 +0,0 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <glibtop.h>
|
||||
|
||||
#include <glibtop/fsusage.h>
|
||||
#include <glibtop/mountlist.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
static void print_fsusage(const char *mountpoint)
|
||||
{
|
||||
glibtop_fsusage buf;
|
||||
|
||||
glibtop_get_fsusage(&buf, mountpoint);
|
||||
|
||||
printf("%-20s %-10llu %-10llu %-10llu %.1f\n",
|
||||
mountpoint,
|
||||
buf.blocks * buf.block_size >> 20,
|
||||
(buf.blocks - buf.bavail) * buf.block_size >> 20,
|
||||
buf.bavail * buf.block_size >> 20,
|
||||
(buf.blocks - buf.bavail) * 100.0 / buf.blocks
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
glibtop_mountlist buf;
|
||||
glibtop_mountentry *entries;
|
||||
size_t i;
|
||||
|
||||
glibtop_init();
|
||||
|
||||
printf("%-20s %-10s %-10s %-10s %-10s\n",
|
||||
"Filesystem", "Size", "Used", "Avail", "Use%");
|
||||
|
||||
entries = glibtop_get_mountlist(&buf, FALSE);
|
||||
|
||||
for(i = 0; i < buf.number; ++i)
|
||||
{
|
||||
print_fsusage(entries[i].mountdir);
|
||||
}
|
||||
|
||||
g_free(entries);
|
||||
|
||||
glibtop_close();
|
||||
|
||||
return 0;
|
||||
}
|
640
examples/first.c
640
examples/first.c
@@ -1,578 +1,328 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
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. */
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.h>
|
||||
|
||||
#include <glibtop/parameter.h>
|
||||
#include <glibtop/xmalloc.h>
|
||||
|
||||
#include <glibtop/union.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
#include <sys/resource.h>
|
||||
|
||||
#ifndef PROFILE_COUNT
|
||||
#define PROFILE_COUNT 1
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_union data;
|
||||
glibtop_sysdeps sysdeps;
|
||||
unsigned c, method, count, port, i, *ptr;
|
||||
char buffer [BUFSIZ];
|
||||
unsigned i, *ptr;
|
||||
pid_t pid, ppid;
|
||||
char *args;
|
||||
|
||||
count = PROFILE_COUNT;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (GETTEXT_PACKAGE);
|
||||
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN);
|
||||
glibtop_init__r (&glibtop_global_server);
|
||||
|
||||
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);
|
||||
|
||||
glibtop_init_r (&glibtop_global_server, 0, 0);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_cpu (&data.cpu);
|
||||
|
||||
printf ("CPU (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
(unsigned long) data.cpu.flags,
|
||||
(unsigned long) data.cpu.total,
|
||||
(unsigned long) data.cpu.user,
|
||||
(unsigned long) data.cpu.nice,
|
||||
(unsigned long) data.cpu.sys,
|
||||
(unsigned long) data.cpu.idle,
|
||||
(unsigned long) data.cpu.frequency);
|
||||
fprintf (stderr, "CPU (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
data.cpu.flags, data.cpu.total, data.cpu.user, data.cpu.nice,
|
||||
data.cpu.sys, data.cpu.idle, data.cpu.frequency);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_mem (&data.mem);
|
||||
|
||||
printf ("Memory (0x%08lx): "
|
||||
"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
(unsigned long) data.mem.flags,
|
||||
(unsigned long) data.mem.total,
|
||||
(unsigned long) data.mem.used,
|
||||
(unsigned long) data.mem.free,
|
||||
(unsigned long) data.mem.shared,
|
||||
(unsigned long) data.mem.buffer,
|
||||
(unsigned long) data.mem.cached,
|
||||
(unsigned long) data.mem.user,
|
||||
(unsigned long) data.mem.locked);
|
||||
fprintf (stderr, "Memory (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
data.mem.flags, data.mem.total, data.mem.used, data.mem.free,
|
||||
data.mem.shared, data.mem.buffer, data.mem.cached,
|
||||
data.mem.user, data.mem.locked);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_swap (&data.swap);
|
||||
|
||||
printf ("Swap (0x%08lx): %lu, %lu, %lu, %lu, %lu\n",
|
||||
(unsigned long) data.swap.flags,
|
||||
(unsigned long) data.swap.total,
|
||||
(unsigned long) data.swap.used,
|
||||
(unsigned long) data.swap.free,
|
||||
(unsigned long) data.swap.pagein,
|
||||
(unsigned long) data.swap.pageout);
|
||||
fprintf (stderr, "Swap (0x%08lx): %lu, %lu, %lu\n", data.swap.flags,
|
||||
data.swap.total, data.swap.used, data.swap.free);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_uptime (&data.uptime);
|
||||
|
||||
printf ("Uptime (0x%08lx): %f, %f\n",
|
||||
(unsigned long) data.uptime.flags,
|
||||
fprintf (stderr, "Uptime (0x%08lx): %f, %f\n", data.uptime.flags,
|
||||
data.uptime.uptime, data.uptime.idletime);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_loadavg (&data.loadavg);
|
||||
|
||||
printf ("Loadavg (0x%08lx): %f, %f, %f - %lu, %lu, %lu\n",
|
||||
(unsigned long) data.loadavg.flags,
|
||||
(double) data.loadavg.loadavg [0],
|
||||
(double) data.loadavg.loadavg [1],
|
||||
(double) data.loadavg.loadavg [2],
|
||||
(unsigned long) data.loadavg.nr_running,
|
||||
(unsigned long) data.loadavg.nr_tasks,
|
||||
(unsigned long) data.loadavg.last_pid);
|
||||
fprintf (stderr, "Loadavg (0x%08lx): %f, %f, %f\n", data.loadavg.flags,
|
||||
data.loadavg.loadavg [0], data.loadavg.loadavg [1],
|
||||
data.loadavg.loadavg [2]);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_shm_limits (&data.shm_limits);
|
||||
|
||||
printf ("Shm Limits (0x%08lx): %lu, %lu, %lu, %lu, %lu\n",
|
||||
(unsigned long) data.shm_limits.flags,
|
||||
(unsigned long) data.shm_limits.shmmax,
|
||||
(unsigned long) data.shm_limits.shmmin,
|
||||
(unsigned long) data.shm_limits.shmmni,
|
||||
(unsigned long) data.shm_limits.shmseg,
|
||||
(unsigned long) data.shm_limits.shmall);
|
||||
fprintf (stderr, "Shm Limits (0x%08lx): %ld, %ld, %ld, %ld, %ld\n",
|
||||
data.shm_limits.flags, data.shm_limits.shmmax,
|
||||
data.shm_limits.shmmin, data.shm_limits.shmmni,
|
||||
data.shm_limits.shmseg, data.shm_limits.shmall);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_msg_limits (&data.msg_limits);
|
||||
|
||||
printf ("Msg Limits (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
(unsigned long) data.msg_limits.flags,
|
||||
(unsigned long) data.msg_limits.msgpool,
|
||||
(unsigned long) data.msg_limits.msgmap,
|
||||
(unsigned long) data.msg_limits.msgmax,
|
||||
(unsigned long) data.msg_limits.msgmnb,
|
||||
(unsigned long) data.msg_limits.msgmni,
|
||||
(unsigned long) data.msg_limits.msgssz,
|
||||
(unsigned long) data.msg_limits.msgtql);
|
||||
fprintf (stderr, "Msg Limits (0x%08lx): %ld, %ld, %ld, %ld, %ld, %ld, %ld\n",
|
||||
data.msg_limits.flags, data.msg_limits.msgpool,
|
||||
data.msg_limits.msgmap, data.msg_limits.msgmax,
|
||||
data.msg_limits.msgmnb, data.msg_limits.msgmni,
|
||||
data.msg_limits.msgssz, data.msg_limits.msgtql);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_sem_limits (&data.sem_limits);
|
||||
|
||||
printf ("Sem Limits (0x%08lx): "
|
||||
"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
(unsigned long) data.sem_limits.flags,
|
||||
(unsigned long) data.sem_limits.semmap,
|
||||
(unsigned long) data.sem_limits.semmni,
|
||||
(unsigned long) data.sem_limits.semmns,
|
||||
(unsigned long) data.sem_limits.semmnu,
|
||||
(unsigned long) data.sem_limits.semmsl,
|
||||
(unsigned long) data.sem_limits.semopm,
|
||||
(unsigned long) data.sem_limits.semume,
|
||||
(unsigned long) data.sem_limits.semusz,
|
||||
(unsigned long) data.sem_limits.semvmx,
|
||||
(unsigned long) data.sem_limits.semaem);
|
||||
fprintf (stderr, "Sem Limits (0x%08lx): "
|
||||
"%ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld\n",
|
||||
data.sem_limits.flags, data.sem_limits.semmap,
|
||||
data.sem_limits.semmni, data.sem_limits.semmns,
|
||||
data.sem_limits.semmnu, data.sem_limits.semmsl,
|
||||
data.sem_limits.semopm, data.sem_limits.semume,
|
||||
data.sem_limits.semusz, data.sem_limits.semvmx,
|
||||
data.sem_limits.semaem);
|
||||
|
||||
printf ("\n");
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_ppp (&data.ppp, 0);
|
||||
|
||||
printf ("PPP (0x%08lx): %lu, %lu, %lu\n",
|
||||
(unsigned long) data.ppp.flags,
|
||||
(unsigned long) data.ppp.state,
|
||||
(unsigned long) data.ppp.bytes_in,
|
||||
(unsigned long) data.ppp.bytes_out);
|
||||
|
||||
printf ("\n");
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
glibtop_get_sysdeps (&sysdeps);
|
||||
|
||||
printf ("Sysdeps (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
|
||||
"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, "
|
||||
"%lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
(unsigned long) sysdeps.flags,
|
||||
(unsigned long) sysdeps.cpu,
|
||||
(unsigned long) sysdeps.mem,
|
||||
(unsigned long) sysdeps.swap,
|
||||
(unsigned long) sysdeps.uptime,
|
||||
(unsigned long) sysdeps.loadavg,
|
||||
(unsigned long) sysdeps.shm_limits,
|
||||
(unsigned long) sysdeps.msg_limits,
|
||||
(unsigned long) sysdeps.sem_limits,
|
||||
(unsigned long) sysdeps.proclist,
|
||||
(unsigned long) sysdeps.proc_state,
|
||||
(unsigned long) sysdeps.proc_uid,
|
||||
(unsigned long) sysdeps.proc_mem,
|
||||
(unsigned long) sysdeps.proc_time,
|
||||
(unsigned long) sysdeps.proc_signal,
|
||||
(unsigned long) sysdeps.proc_kernel,
|
||||
(unsigned long) sysdeps.proc_segment,
|
||||
(unsigned long) sysdeps.proc_args,
|
||||
(unsigned long) sysdeps.proc_map,
|
||||
(unsigned long) sysdeps.mountlist,
|
||||
(unsigned long) sysdeps.fsusage,
|
||||
(unsigned long) sysdeps.netload,
|
||||
(unsigned long) sysdeps.ppp);
|
||||
fprintf (stderr, "Sysdeps (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
|
||||
"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
sysdeps.flags, sysdeps.cpu, sysdeps.mem, sysdeps.swap,
|
||||
sysdeps.uptime, sysdeps.loadavg, sysdeps.shm_limits,
|
||||
sysdeps.msg_limits, sysdeps.sem_limits,
|
||||
sysdeps.proclist, sysdeps.proc_state,
|
||||
sysdeps.proc_uid, sysdeps.proc_mem,
|
||||
sysdeps.proc_time, sysdeps.proc_signal,
|
||||
sysdeps.proc_kernel, sysdeps.proc_segment);
|
||||
|
||||
printf ("\n");
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
ptr = glibtop_get_proclist (&data.proclist, 0, 0);
|
||||
ptr = glibtop_get_proclist (&data.proclist);
|
||||
|
||||
printf ("Proclist (0x%08lx): %lu, %lu, %lu\n",
|
||||
(unsigned long) data.proclist.flags,
|
||||
(unsigned long) data.proclist.number,
|
||||
(unsigned long) data.proclist.size,
|
||||
(unsigned long) data.proclist.total);
|
||||
fprintf (stderr, "Proclist (0x%08lx): %ld, %ld, %ld\n",
|
||||
data.proclist.flags, data.proclist.number,
|
||||
data.proclist.size, data.proclist.total);
|
||||
|
||||
if (ptr) {
|
||||
printf ("\nProcess: ");
|
||||
fprintf (stderr, "\nProcess: ");
|
||||
for (i = 0; i < data.proclist.number; i++)
|
||||
printf ("%s%u", i ? ", " : "", ptr [i]);
|
||||
printf ("\n");
|
||||
fprintf (stderr, "%s%u", i ? ", " : "", ptr [i]);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
g_free (ptr);
|
||||
glibtop_free (ptr);
|
||||
|
||||
pid = getpid ();
|
||||
ppid = getppid ();
|
||||
|
||||
printf ("\n");
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_state (&data.proc_state, pid);
|
||||
|
||||
printf ("Proc_State PID %5d (0x%08lx): '%s', %c, %lu, %lu\n",
|
||||
(int) pid, (unsigned long) data.proc_state.flags,
|
||||
data.proc_state.cmd, data.proc_state.state,
|
||||
(unsigned long) data.proc_state.uid,
|
||||
(unsigned long) data.proc_state.gid);
|
||||
fprintf (stderr, "Proc_State PID %5u (0x%08lx): '%s', %c, %u, %u\n",
|
||||
pid, data.proc_state.flags, data.proc_state.cmd,
|
||||
data.proc_state.state, data.proc_state.uid,
|
||||
data.proc_state.gid);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_uid (&data.proc_uid, pid);
|
||||
|
||||
printf ("Proc_Uid PID %5d (0x%08lx): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
|
||||
(unsigned long) data.proc_uid.flags,
|
||||
data.proc_uid.uid, data.proc_uid.euid,
|
||||
data.proc_uid.gid, data.proc_uid.egid,
|
||||
data.proc_uid.pid, data.proc_uid.ppid,
|
||||
data.proc_uid.pgrp, data.proc_uid.session,
|
||||
data.proc_uid.tty, data.proc_uid.tpgid,
|
||||
data.proc_uid.priority, data.proc_uid.nice);
|
||||
fprintf (stderr, "Proc_Uid PID %5u (0x%08lx): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n",
|
||||
pid, data.proc_uid.flags, data.proc_uid.uid,
|
||||
data.proc_uid.euid, data.proc_uid.gid,
|
||||
data.proc_uid.egid, data.proc_uid.pid,
|
||||
data.proc_uid.ppid, data.proc_uid.pgrp,
|
||||
data.proc_uid.session, data.proc_uid.tty,
|
||||
data.proc_uid.tpgid, data.proc_uid.priority,
|
||||
data.proc_uid.nice);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_mem (&data.proc_mem, pid);
|
||||
|
||||
printf ("Proc_Mem PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu\n", (int) pid,
|
||||
(unsigned long) data.proc_mem.flags,
|
||||
(unsigned long) data.proc_mem.size,
|
||||
(unsigned long) data.proc_mem.vsize,
|
||||
(unsigned long) data.proc_mem.resident,
|
||||
(unsigned long) data.proc_mem.share,
|
||||
(unsigned long) data.proc_mem.rss,
|
||||
(unsigned long) data.proc_mem.rss_rlim);
|
||||
fprintf (stderr, "Proc_Mem PID %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %ld %ld\n", pid, data.proc_mem.flags,
|
||||
data.proc_mem.size, data.proc_mem.vsize,
|
||||
data.proc_mem.resident, data.proc_mem.share,
|
||||
data.proc_mem.rss, data.proc_mem.rss_rlim);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_segment (&data.proc_segment, pid);
|
||||
|
||||
printf ("Proc_Segment PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
|
||||
(unsigned long) data.proc_segment.flags,
|
||||
(unsigned long) data.proc_segment.text_rss,
|
||||
(unsigned long) data.proc_segment.shlib_rss,
|
||||
(unsigned long) data.proc_segment.data_rss,
|
||||
(unsigned long) data.proc_segment.stack_rss,
|
||||
(unsigned long) data.proc_segment.dirty_size,
|
||||
(unsigned long) data.proc_segment.start_code,
|
||||
(unsigned long) data.proc_segment.end_code,
|
||||
(unsigned long) data.proc_segment.start_stack);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_time (&data.proc_time, pid);
|
||||
|
||||
printf ("Proc_Time PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
|
||||
(unsigned long) data.proc_time.flags,
|
||||
(unsigned long) data.proc_time.start_time,
|
||||
(unsigned long) data.proc_time.rtime,
|
||||
(unsigned long) data.proc_time.utime,
|
||||
(unsigned long) data.proc_time.stime,
|
||||
(unsigned long) data.proc_time.cutime,
|
||||
(unsigned long) data.proc_time.cstime,
|
||||
(unsigned long) data.proc_time.timeout,
|
||||
(unsigned long) data.proc_time.it_real_value,
|
||||
(unsigned long) data.proc_time.frequency);
|
||||
fprintf (stderr, "Proc_Time PID %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %ld %ld %ld\n", pid, data.proc_time.flags,
|
||||
data.proc_time.start_time, data.proc_time.utime,
|
||||
data.proc_time.stime, data.proc_time.cutime,
|
||||
data.proc_time.cstime, data.proc_time.timeout,
|
||||
data.proc_time.it_real_value);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_signal (&data.proc_signal, pid);
|
||||
|
||||
printf ("Proc_Signal PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu\n", (int) pid,
|
||||
(unsigned long) data.proc_signal.flags,
|
||||
(unsigned long) data.proc_signal.signal,
|
||||
(unsigned long) data.proc_signal.blocked,
|
||||
(unsigned long) data.proc_signal.sigignore,
|
||||
(unsigned long) data.proc_signal.sigcatch);
|
||||
fprintf (stderr, "Proc_Signal PID %5u (0x%08lx): "
|
||||
"%d %d %d %d\n", pid, data.proc_signal.flags,
|
||||
data.proc_signal.signal, data.proc_signal.blocked,
|
||||
data.proc_signal.sigignore, data.proc_signal.sigcatch);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, pid);
|
||||
|
||||
printf ("Proc_Kernel PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) pid,
|
||||
(unsigned long) data.proc_kernel.flags,
|
||||
(unsigned long) data.proc_kernel.k_flags,
|
||||
(unsigned long) data.proc_kernel.min_flt,
|
||||
(unsigned long) data.proc_kernel.maj_flt,
|
||||
(unsigned long) data.proc_kernel.cmin_flt,
|
||||
(unsigned long) data.proc_kernel.cmaj_flt,
|
||||
(unsigned long) data.proc_kernel.kstk_esp,
|
||||
(unsigned long) data.proc_kernel.kstk_eip,
|
||||
(unsigned long) data.proc_kernel.nwchan,
|
||||
fprintf (stderr, "Proc_Kernel PID %5u (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
|
||||
data.proc_kernel.flags, data.proc_kernel.k_flags,
|
||||
data.proc_kernel.min_flt, data.proc_kernel.maj_flt,
|
||||
data.proc_kernel.cmin_flt, data.proc_kernel.cmaj_flt,
|
||||
data.proc_kernel.kstk_esp, data.proc_kernel.kstk_eip,
|
||||
data.proc_kernel.wchan);
|
||||
|
||||
printf ("\n");
|
||||
glibtop_get_proc_segment (&data.proc_segment, pid);
|
||||
|
||||
args = glibtop_get_proc_args (&data.proc_args, pid, 0);
|
||||
fprintf (stderr, "Proc_Segment PID %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %lu %lu %lu\n", pid, data.proc_segment.flags,
|
||||
data.proc_segment.trs, data.proc_segment.lrs,
|
||||
data.proc_segment.drs, data.proc_segment.dt,
|
||||
data.proc_segment.start_code, data.proc_segment.end_code,
|
||||
data.proc_segment.start_stack);
|
||||
|
||||
for (i = 0; i < data.proc_args.size; i++) {
|
||||
if (args [i]) continue;
|
||||
args [i] = '|';
|
||||
}
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid,
|
||||
(unsigned long) data.proc_args.flags,
|
||||
(unsigned long) data.proc_args.size,
|
||||
args ? args : "");
|
||||
|
||||
g_free (args);
|
||||
|
||||
printf ("\n");
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_state (&data.proc_state, ppid);
|
||||
|
||||
printf ("Proc_State PPID %5d (0x%08lx): '%s', %c, %lu, %lu\n",
|
||||
(int) ppid, (unsigned long) data.proc_state.flags,
|
||||
data.proc_state.cmd, data.proc_state.state,
|
||||
(unsigned long) data.proc_state.uid,
|
||||
(unsigned long) data.proc_state.gid);
|
||||
fprintf (stderr, "Proc_State PPID %5u (0x%08lx): '%s', %c, %u, %u\n",
|
||||
ppid, data.proc_state.flags, data.proc_state.cmd,
|
||||
data.proc_state.state, data.proc_state.uid,
|
||||
data.proc_state.gid);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_uid (&data.proc_uid, ppid);
|
||||
|
||||
printf ("Proc_Uid PPID %5d (0x%08lx): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) ppid,
|
||||
(unsigned long) data.proc_uid.flags,
|
||||
data.proc_uid.uid, data.proc_uid.euid,
|
||||
data.proc_uid.gid, data.proc_uid.egid,
|
||||
data.proc_uid.pid, data.proc_uid.ppid,
|
||||
data.proc_uid.pgrp, data.proc_uid.session,
|
||||
data.proc_uid.tty, data.proc_uid.tpgid,
|
||||
data.proc_uid.priority, data.proc_uid.nice);
|
||||
fprintf (stderr, "Proc_Uid PPID %5u (0x%08lx): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n",
|
||||
ppid, data.proc_uid.flags, data.proc_uid.uid,
|
||||
data.proc_uid.euid, data.proc_uid.gid,
|
||||
data.proc_uid.egid, data.proc_uid.pid,
|
||||
data.proc_uid.ppid, data.proc_uid.pgrp,
|
||||
data.proc_uid.session, data.proc_uid.tty,
|
||||
data.proc_uid.tpgid, data.proc_uid.priority,
|
||||
data.proc_uid.nice);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_mem (&data.proc_mem, ppid);
|
||||
|
||||
printf ("Proc_Mem PPID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu\n", (int) ppid,
|
||||
(unsigned long) data.proc_mem.flags,
|
||||
(unsigned long) data.proc_mem.size,
|
||||
(unsigned long) data.proc_mem.vsize,
|
||||
(unsigned long) data.proc_mem.resident,
|
||||
(unsigned long) data.proc_mem.share,
|
||||
(unsigned long) data.proc_mem.rss,
|
||||
(unsigned long) data.proc_mem.rss_rlim);
|
||||
fprintf (stderr, "Proc_Mem PPID %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %ld %ld\n", ppid, data.proc_mem.flags,
|
||||
data.proc_mem.size, data.proc_mem.vsize,
|
||||
data.proc_mem.resident, data.proc_mem.share,
|
||||
data.proc_mem.rss, data.proc_mem.rss_rlim);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_segment (&data.proc_segment, ppid);
|
||||
|
||||
printf ("Proc_Segment PPID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
|
||||
(unsigned long) data.proc_segment.flags,
|
||||
(unsigned long) data.proc_segment.text_rss,
|
||||
(unsigned long) data.proc_segment.shlib_rss,
|
||||
(unsigned long) data.proc_segment.data_rss,
|
||||
(unsigned long) data.proc_segment.stack_rss,
|
||||
(unsigned long) data.proc_segment.dirty_size,
|
||||
(unsigned long) data.proc_segment.start_code,
|
||||
(unsigned long) data.proc_segment.end_code,
|
||||
(unsigned long) data.proc_segment.start_stack);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_time (&data.proc_time, ppid);
|
||||
|
||||
printf ("Proc_Time PPID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
|
||||
(unsigned long) data.proc_time.flags,
|
||||
(unsigned long) data.proc_time.start_time,
|
||||
(unsigned long) data.proc_time.rtime,
|
||||
(unsigned long) data.proc_time.utime,
|
||||
(unsigned long) data.proc_time.stime,
|
||||
(unsigned long) data.proc_time.cutime,
|
||||
(unsigned long) data.proc_time.cstime,
|
||||
(unsigned long) data.proc_time.timeout,
|
||||
(unsigned long) data.proc_time.it_real_value,
|
||||
(unsigned long) data.proc_time.frequency);
|
||||
fprintf (stderr, "Proc_Time PPID %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %ld %ld %ld\n", ppid, data.proc_time.flags,
|
||||
data.proc_time.start_time, data.proc_time.utime,
|
||||
data.proc_time.stime, data.proc_time.cutime,
|
||||
data.proc_time.cstime, data.proc_time.timeout,
|
||||
data.proc_time.it_real_value);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_signal (&data.proc_signal, ppid);
|
||||
|
||||
printf ("Proc_Signal PPID %5d (0x%08lx): %lu %lu %lu %lu\n",
|
||||
(int) ppid, (unsigned long) data.proc_signal.flags,
|
||||
(unsigned long) data.proc_signal.signal,
|
||||
(unsigned long) data.proc_signal.blocked,
|
||||
(unsigned long) data.proc_signal.sigignore,
|
||||
(unsigned long) data.proc_signal.sigcatch);
|
||||
fprintf (stderr, "Proc_Signal PPID %5u (0x%08lx): "
|
||||
"%d %d %d %d\n", ppid, data.proc_signal.flags,
|
||||
data.proc_signal.signal, data.proc_signal.blocked,
|
||||
data.proc_signal.sigignore, data.proc_signal.sigcatch);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, ppid);
|
||||
|
||||
printf ("Proc_Kernel PPID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) ppid,
|
||||
(unsigned long) data.proc_kernel.flags,
|
||||
(unsigned long) data.proc_kernel.k_flags,
|
||||
(unsigned long) data.proc_kernel.min_flt,
|
||||
(unsigned long) data.proc_kernel.maj_flt,
|
||||
(unsigned long) data.proc_kernel.cmin_flt,
|
||||
(unsigned long) data.proc_kernel.cmaj_flt,
|
||||
(unsigned long) data.proc_kernel.kstk_esp,
|
||||
(unsigned long) data.proc_kernel.kstk_eip,
|
||||
(unsigned long) data.proc_kernel.nwchan,
|
||||
fprintf (stderr, "Proc_Kernel PPID %5u (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", ppid,
|
||||
data.proc_kernel.flags, data.proc_kernel.k_flags,
|
||||
data.proc_kernel.min_flt, data.proc_kernel.maj_flt,
|
||||
data.proc_kernel.cmin_flt, data.proc_kernel.cmaj_flt,
|
||||
data.proc_kernel.kstk_esp, data.proc_kernel.kstk_eip,
|
||||
data.proc_kernel.wchan);
|
||||
|
||||
printf ("\n");
|
||||
glibtop_get_proc_segment (&data.proc_segment, ppid);
|
||||
|
||||
args = glibtop_get_proc_args (&data.proc_args, ppid, 0);
|
||||
fprintf (stderr, "Proc_Segment PPID %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %lu %lu %lu\n", ppid, data.proc_segment.flags,
|
||||
data.proc_segment.trs, data.proc_segment.lrs,
|
||||
data.proc_segment.drs, data.proc_segment.dt,
|
||||
data.proc_segment.start_code, data.proc_segment.end_code,
|
||||
data.proc_segment.start_stack);
|
||||
|
||||
for (i = 0; i < data.proc_args.size; i++) {
|
||||
if (args [i]) continue;
|
||||
args [i] = '|';
|
||||
}
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) ppid,
|
||||
(unsigned long) data.proc_args.flags,
|
||||
(unsigned long) data.proc_args.size,
|
||||
args ? args : "");
|
||||
|
||||
g_free (args);
|
||||
|
||||
printf ("\n");
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_state (&data.proc_state, 1);
|
||||
|
||||
printf ("Proc_State INIT %5d (0x%08lx): '%s', %c, %lu, %lu\n", 1,
|
||||
(unsigned long) data.proc_state.flags,
|
||||
data.proc_state.cmd, data.proc_state.state,
|
||||
(unsigned long) data.proc_state.uid,
|
||||
(unsigned long) data.proc_state.gid);
|
||||
fprintf (stderr, "Proc_State INIT %5u (0x%08lx): '%s', %c, %u, %u\n",
|
||||
1, data.proc_state.flags, data.proc_state.cmd,
|
||||
data.proc_state.state, data.proc_state.uid,
|
||||
data.proc_state.gid);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_uid (&data.proc_uid, 1);
|
||||
|
||||
printf ("Proc_Uid INIT %5d (0x%08lx): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n", 1,
|
||||
(unsigned long) data.proc_uid.flags,
|
||||
data.proc_uid.uid, data.proc_uid.euid,
|
||||
data.proc_uid.gid, data.proc_uid.egid,
|
||||
data.proc_uid.pid, data.proc_uid.ppid,
|
||||
data.proc_uid.pgrp, data.proc_uid.session,
|
||||
data.proc_uid.tty, data.proc_uid.tpgid,
|
||||
data.proc_uid.priority, data.proc_uid.nice);
|
||||
fprintf (stderr, "Proc_Uid INIT %5u (0x%08lx): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n",
|
||||
1, data.proc_uid.flags, data.proc_uid.uid,
|
||||
data.proc_uid.euid, data.proc_uid.gid,
|
||||
data.proc_uid.egid, data.proc_uid.pid,
|
||||
data.proc_uid.ppid, data.proc_uid.pgrp,
|
||||
data.proc_uid.session, data.proc_uid.tty,
|
||||
data.proc_uid.tpgid, data.proc_uid.priority,
|
||||
data.proc_uid.nice);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_mem (&data.proc_mem, 1);
|
||||
|
||||
printf ("Proc_Mem INIT %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu\n", 1,
|
||||
(unsigned long) data.proc_mem.flags,
|
||||
(unsigned long) data.proc_mem.size,
|
||||
(unsigned long) data.proc_mem.vsize,
|
||||
(unsigned long) data.proc_mem.resident,
|
||||
(unsigned long) data.proc_mem.share,
|
||||
(unsigned long) data.proc_mem.rss,
|
||||
(unsigned long) data.proc_mem.rss_rlim);
|
||||
fprintf (stderr, "Proc_Mem INIT %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %ld %ld\n", 1, data.proc_mem.flags,
|
||||
data.proc_mem.size, data.proc_mem.vsize,
|
||||
data.proc_mem.resident, data.proc_mem.share,
|
||||
data.proc_mem.rss, data.proc_mem.rss_rlim);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_segment (&data.proc_segment, 1);
|
||||
|
||||
printf ("Proc_Segment INIT %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
|
||||
(unsigned long) data.proc_segment.flags,
|
||||
(unsigned long) data.proc_segment.text_rss,
|
||||
(unsigned long) data.proc_segment.shlib_rss,
|
||||
(unsigned long) data.proc_segment.data_rss,
|
||||
(unsigned long) data.proc_segment.stack_rss,
|
||||
(unsigned long) data.proc_segment.dirty_size,
|
||||
(unsigned long) data.proc_segment.start_code,
|
||||
(unsigned long) data.proc_segment.end_code,
|
||||
(unsigned long) data.proc_segment.start_stack);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_time (&data.proc_time, 1);
|
||||
|
||||
printf ("Proc_Time INIT %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
|
||||
(unsigned long) data.proc_time.flags,
|
||||
(unsigned long) data.proc_time.start_time,
|
||||
(unsigned long) data.proc_time.rtime,
|
||||
(unsigned long) data.proc_time.utime,
|
||||
(unsigned long) data.proc_time.stime,
|
||||
(unsigned long) data.proc_time.cutime,
|
||||
(unsigned long) data.proc_time.cstime,
|
||||
(unsigned long) data.proc_time.timeout,
|
||||
(unsigned long) data.proc_time.it_real_value,
|
||||
(unsigned long) data.proc_time.frequency);
|
||||
fprintf (stderr, "Proc_Time INIT %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %ld %ld %ld\n", 1, data.proc_time.flags,
|
||||
data.proc_time.start_time, data.proc_time.utime,
|
||||
data.proc_time.stime, data.proc_time.cutime,
|
||||
data.proc_time.cstime, data.proc_time.timeout,
|
||||
data.proc_time.it_real_value);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_signal (&data.proc_signal, 1);
|
||||
|
||||
printf ("Proc_Signal INIT %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu\n", 1,
|
||||
(unsigned long) data.proc_signal.flags,
|
||||
(unsigned long) data.proc_signal.signal,
|
||||
(unsigned long) data.proc_signal.blocked,
|
||||
(unsigned long) data.proc_signal.sigignore,
|
||||
(unsigned long) data.proc_signal.sigcatch);
|
||||
fprintf (stderr, "Proc_Signal INIT %5u (0x%08lx): "
|
||||
"%d %d %d %d\n", 1, data.proc_signal.flags,
|
||||
data.proc_signal.signal, data.proc_signal.blocked,
|
||||
data.proc_signal.sigignore, data.proc_signal.sigcatch);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, 1);
|
||||
|
||||
printf ("Proc_Kernel INIT %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", 1,
|
||||
(unsigned long) data.proc_kernel.flags,
|
||||
(unsigned long) data.proc_kernel.k_flags,
|
||||
(unsigned long) data.proc_kernel.min_flt,
|
||||
(unsigned long) data.proc_kernel.maj_flt,
|
||||
(unsigned long) data.proc_kernel.cmin_flt,
|
||||
(unsigned long) data.proc_kernel.cmaj_flt,
|
||||
(unsigned long) data.proc_kernel.kstk_esp,
|
||||
(unsigned long) data.proc_kernel.kstk_eip,
|
||||
(unsigned long) data.proc_kernel.nwchan,
|
||||
fprintf (stderr, "Proc_Kernel INIT %5u (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
|
||||
data.proc_kernel.flags, data.proc_kernel.k_flags,
|
||||
data.proc_kernel.min_flt, data.proc_kernel.maj_flt,
|
||||
data.proc_kernel.cmin_flt, data.proc_kernel.cmaj_flt,
|
||||
data.proc_kernel.kstk_esp, data.proc_kernel.kstk_eip,
|
||||
data.proc_kernel.wchan);
|
||||
|
||||
printf ("\n");
|
||||
glibtop_get_proc_segment (&data.proc_segment, 1);
|
||||
|
||||
args = glibtop_get_proc_args (&data.proc_args, 1, 0);
|
||||
|
||||
for (i = 0; i < data.proc_args.size; i++) {
|
||||
if (args [i]) continue;
|
||||
args [i] = '|';
|
||||
}
|
||||
|
||||
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", 1,
|
||||
(unsigned long) data.proc_args.flags,
|
||||
(unsigned long) data.proc_args.size,
|
||||
args ? args : "");
|
||||
|
||||
g_free (args);
|
||||
|
||||
glibtop_close ();
|
||||
fprintf (stderr, "Proc_Segment INIT %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %lu %lu %lu\n", 1, data.proc_segment.flags,
|
||||
data.proc_segment.trs, data.proc_segment.lrs,
|
||||
data.proc_segment.drs, data.proc_segment.dt,
|
||||
data.proc_segment.start_code, data.proc_segment.end_code,
|
||||
data.proc_segment.start_stack);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
@@ -1,21 +0,0 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/mem.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
glibtop_mem buf;
|
||||
|
||||
glibtop_init();
|
||||
|
||||
g_print("%lx\n", glibtop_global_server->features);
|
||||
|
||||
glibtop_get_mem(&buf);
|
||||
|
||||
glibtop_close();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,116 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.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 (GETTEXT_PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (GETTEXT_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);
|
||||
|
||||
g_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%-16s %9s %9s %9s %9s %9s %9s\n",
|
||||
"Mount", "Blocks", "Free", "Avail", "Files", "Free", "BlockSz");
|
||||
|
||||
for (index = 0; index < mount_list.number; index++) {
|
||||
glibtop_get_fsusage (&fsusage,
|
||||
mount_entries [index].mountdir);
|
||||
|
||||
printf ("%-16s %9Lu %9Lu %9Lu %9Lu %9Lu %9d\n",
|
||||
mount_entries [index].mountdir,
|
||||
fsusage.blocks, fsusage.bfree,
|
||||
fsusage.bavail, fsusage.files,
|
||||
fsusage.ffree, fsusage.block_size);
|
||||
}
|
||||
|
||||
g_free (mount_entries);
|
||||
|
||||
printf ("\nsbrk (0) = %p\n\n", sbrk (0));
|
||||
|
||||
glibtop_close ();
|
||||
|
||||
exit (0);
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/netlist.h>
|
||||
|
||||
|
||||
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;
|
||||
}
|
@@ -1,162 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.h>
|
||||
|
||||
#include <glibtop/parameter.h>
|
||||
|
||||
#include <glibtop/netload.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#ifndef PROFILE_COUNT
|
||||
#define PROFILE_COUNT 1
|
||||
#endif
|
||||
|
||||
|
||||
static char* hwaddress_format_for_display(glibtop_netload *buf)
|
||||
{
|
||||
unsigned i;
|
||||
GString *repr = g_string_new("");
|
||||
char *str;
|
||||
|
||||
for(i = 0; i < sizeof buf->hwaddress; ++i)
|
||||
g_string_append_printf(repr, "%02X:",
|
||||
(unsigned) ((char*)buf->hwaddress)[i]);
|
||||
|
||||
repr->str [ repr->len - 1] = ' ';
|
||||
str = g_string_free(repr, FALSE);
|
||||
g_strstrip(str);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_netload netload;
|
||||
unsigned method, count, port;
|
||||
struct in_addr addr, subnet;
|
||||
char *address_string, *subnet_string;
|
||||
char address6_string[INET6_ADDRSTRLEN], prefix6_string[INET6_ADDRSTRLEN];
|
||||
char *hwaddress_string;
|
||||
char buffer [BUFSIZ];
|
||||
|
||||
count = PROFILE_COUNT;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (GETTEXT_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);
|
||||
|
||||
glibtop_init_r (&glibtop_global_server, 0, 0);
|
||||
|
||||
if (argc != 2)
|
||||
g_error ("Usage: %s interface", argv [0]);
|
||||
|
||||
glibtop_get_netload (&netload, argv [1]);
|
||||
|
||||
addr.s_addr = netload.address;
|
||||
subnet.s_addr = netload.subnet;
|
||||
|
||||
address_string = g_strdup (inet_ntoa (addr));
|
||||
subnet_string = g_strdup (inet_ntoa (subnet));
|
||||
|
||||
inet_ntop (AF_INET6, netload.address6, address6_string, INET6_ADDRSTRLEN);
|
||||
inet_ntop (AF_INET6, netload.prefix6, prefix6_string, INET6_ADDRSTRLEN);
|
||||
|
||||
hwaddress_string = hwaddress_format_for_display(&netload);
|
||||
|
||||
printf ("Network Load (0x%016llx):\n\n"
|
||||
"\tInterface Flags:\t0x%016llx\n"
|
||||
"\tAddress:\t\t0x%08x - %s\n"
|
||||
"\tSubnet:\t\t\t0x%08x - %s\n\n"
|
||||
"\tMTU:\t\t\t%d\n"
|
||||
"\tCollisions:\t\t%llu\n\n"
|
||||
"\tPackets In:\t\t%llu\n"
|
||||
"\tPackets Out:\t\t%llu\n"
|
||||
"\tPackets Total:\t\t%llu\n\n"
|
||||
"\tBytes In:\t\t%llu\n"
|
||||
"\tBytes Out:\t\t%llu\n"
|
||||
"\tBytes Total:\t\t%llu\n\n"
|
||||
"\tErrors In:\t\t%llu\n"
|
||||
"\tErrors Out:\t\t%llu\n"
|
||||
"\tErrors Total:\t\t%llu\n\n"
|
||||
"\tAddress6:\t\t%s\n"
|
||||
"\tPrefix6:\t\t%s\n"
|
||||
"\tScope6:\t\t\t%#03x\n\n"
|
||||
"\tHarware Address:\t%s\n\n",
|
||||
netload.flags,
|
||||
netload.if_flags,
|
||||
(guint32) netload.address, address_string,
|
||||
(guint32) netload.subnet, subnet_string,
|
||||
netload.mtu,
|
||||
netload.collisions,
|
||||
netload.packets_in,
|
||||
netload.packets_out,
|
||||
netload.packets_total,
|
||||
netload.bytes_in,
|
||||
netload.bytes_out,
|
||||
netload.bytes_total,
|
||||
netload.errors_in,
|
||||
netload.errors_out,
|
||||
netload.errors_total,
|
||||
address6_string,
|
||||
prefix6_string,
|
||||
(int) netload.scope6,
|
||||
hwaddress_string);
|
||||
|
||||
|
||||
g_free (address_string);
|
||||
g_free (subnet_string);
|
||||
|
||||
glibtop_close ();
|
||||
|
||||
exit (0);
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/procopenfiles.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
static void show_open_files(pid_t pid)
|
||||
{
|
||||
glibtop_proc_open_files buf;
|
||||
glibtop_open_files_entry *files;
|
||||
unsigned i;
|
||||
|
||||
files = glibtop_get_proc_open_files(&buf, pid);
|
||||
|
||||
printf("<%ld>\n", (long)pid);
|
||||
|
||||
for(i = 0; i < buf.number; ++i)
|
||||
{
|
||||
printf("\tfd = %d\t", files[i].fd);
|
||||
|
||||
switch(files[i].type)
|
||||
{
|
||||
case GLIBTOP_FILE_TYPE_FILE:
|
||||
printf("file \"%s\"\n", files[i].info.file.name);
|
||||
break;
|
||||
|
||||
case GLIBTOP_FILE_TYPE_PIPE:
|
||||
printf("pipe\n");
|
||||
break;
|
||||
|
||||
case GLIBTOP_FILE_TYPE_INETSOCKET:
|
||||
printf("socket %s:%d\n", files[i].info.sock.dest_host, files[i].info.sock.dest_port);
|
||||
break;
|
||||
|
||||
case GLIBTOP_FILE_TYPE_LOCALSOCKET:
|
||||
printf("localsocket %s\n", files[i].info.localsock.name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
|
||||
g_free(files);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
glibtop_init();
|
||||
|
||||
show_open_files(getpid());
|
||||
|
||||
while(*++argv)
|
||||
{
|
||||
pid_t pid = strtol(*argv, NULL, 10);
|
||||
show_open_files(pid);
|
||||
}
|
||||
|
||||
glibtop_close();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,324 +0,0 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <glibtop.h>
|
||||
|
||||
#include <glibtop/union.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
#define buf_offsetof(MEMBER) ((ptrdiff_t)&(buf.MEMBER) - (ptrdiff_t)&buf)
|
||||
|
||||
#define HEADER_PPRINT(FUNC) printf("### " #FUNC " ###\nsizeof *buf = %lu B\n", \
|
||||
(unsigned long) sizeof buf)
|
||||
|
||||
#define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \
|
||||
(unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA)
|
||||
|
||||
#define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \
|
||||
size_t i; \
|
||||
printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \
|
||||
(unsigned long) sizeof buf.ARRAY, (unsigned long) buf_offsetof(ARRAY),\
|
||||
(unsigned long) G_N_ELEMENTS(buf.ARRAY)); \
|
||||
for(i = 0; i < (SIZE - 1); ++i) printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \
|
||||
printf(".%u = " FORMAT " }\n", SIZE - 1 , buf.ARRAY[SIZE - 1]); \
|
||||
} while(0)
|
||||
|
||||
#define FOOTER_PPRINT() putchar('\n');
|
||||
|
||||
|
||||
|
||||
static void pprint_get_cpu(void)
|
||||
{
|
||||
glibtop_cpu buf;
|
||||
|
||||
glibtop_get_cpu(&buf);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_cpu);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT(total, "%llu");
|
||||
PPRINT(user, "%llu");
|
||||
PPRINT(nice, "%llu");
|
||||
PPRINT(sys, "%llu");
|
||||
PPRINT(idle, "%llu");
|
||||
PPRINT(iowait, "%llu");
|
||||
PPRINT(irq, "%llu");
|
||||
PPRINT(softirq, "%llu");
|
||||
PPRINT(frequency, "%llu");
|
||||
PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT(xcpu_flags, "%llx");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void pprint_get_fsusage(const char *mountpoint)
|
||||
{
|
||||
glibtop_fsusage buf;
|
||||
|
||||
glibtop_get_fsusage(&buf, mountpoint);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_fsusage);
|
||||
printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT(blocks, "%llu");
|
||||
PPRINT(bfree, "%llu");
|
||||
PPRINT(bavail, "%llu");
|
||||
PPRINT(files, "%llu");
|
||||
PPRINT(ffree, "%llu");
|
||||
PPRINT(block_size, "%u");
|
||||
PPRINT(read, "%llu");
|
||||
PPRINT(write, "%llu");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void pprint_get_loadavg(void)
|
||||
{
|
||||
glibtop_loadavg buf;
|
||||
|
||||
glibtop_get_loadavg(&buf);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_loadavg);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT_ARRAY(loadavg, 3, "%f");
|
||||
PPRINT(nr_running, "%llu");
|
||||
PPRINT(nr_tasks, "%llu");
|
||||
PPRINT(last_pid, "%llu");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void pprint_get_mem(void)
|
||||
{
|
||||
glibtop_mem buf;
|
||||
|
||||
glibtop_get_mem(&buf);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_mem);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT(total, "%llu");
|
||||
PPRINT(used, "%llu");
|
||||
PPRINT(free, "%llu");
|
||||
PPRINT(shared, "%llu");
|
||||
PPRINT(buffer, "%llu");
|
||||
PPRINT(cached, "%llu");
|
||||
PPRINT(user, "%llu");
|
||||
PPRINT(locked, "%llu");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void pprint_get_mountlist(gboolean allfs)
|
||||
{
|
||||
glibtop_mountlist buf;
|
||||
glibtop_mountentry *entries;
|
||||
size_t i;
|
||||
|
||||
entries = glibtop_get_mountlist(&buf, allfs);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_mountlist);
|
||||
printf("glibtop_get_mountlist (allfs = %d)\n", allfs);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT(number, "%llu");
|
||||
PPRINT(total, "%llu");
|
||||
PPRINT(size, "%llu");
|
||||
|
||||
printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number);
|
||||
|
||||
for(i = 0; i < buf.number; ++i)
|
||||
{
|
||||
printf("\t\t .%lu = { .dev = %#llx,"
|
||||
" .devname = \"%s\","
|
||||
" .mountir = \"%s\","
|
||||
" .type = \"%s\" }\n",
|
||||
(unsigned long) i, entries[i].dev,
|
||||
entries[i].devname,
|
||||
entries[i].mountdir,
|
||||
entries[i].type);
|
||||
}
|
||||
|
||||
printf("\t\t}\n");
|
||||
FOOTER_PPRINT();
|
||||
|
||||
g_free(entries);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void pprint_get_msg_limits(void)
|
||||
{
|
||||
glibtop_msg_limits buf;
|
||||
|
||||
glibtop_get_msg_limits(&buf);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_msg_limits);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT(msgpool, "%llu");
|
||||
PPRINT(msgmap, "%llu");
|
||||
PPRINT(msgmax, "%llu");
|
||||
PPRINT(msgmnb, "%llu");
|
||||
PPRINT(msgmni, "%llu");
|
||||
PPRINT(msgssz, "%llu");
|
||||
PPRINT(msgtql, "%llu");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void pprint_get_netload(const char *iface)
|
||||
{
|
||||
glibtop_netload buf;
|
||||
|
||||
glibtop_get_netload(&buf, iface);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_netload);
|
||||
printf("glibtop_get_netload (iface = \"%s\")\n", iface);
|
||||
PPRINT(flags, "%#llx");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
static void pprint_get_netlist(void)
|
||||
{
|
||||
glibtop_netlist buf;
|
||||
char **devices;
|
||||
guint32 i;
|
||||
|
||||
devices = glibtop_get_netlist(&buf);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_netlist);
|
||||
|
||||
for(i = 0; i < buf.number; ++i)
|
||||
{
|
||||
printf("\t%s\n", devices[i]);
|
||||
}
|
||||
|
||||
FOOTER_PPRINT();
|
||||
|
||||
g_strfreev(devices);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void pprint_get_swap(void)
|
||||
{
|
||||
glibtop_swap buf;
|
||||
|
||||
glibtop_get_swap(&buf);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_swap);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT(total, "%llu");
|
||||
PPRINT(used, "%llu");
|
||||
PPRINT(free, "%llu");
|
||||
PPRINT(pagein, "%llu");
|
||||
PPRINT(pageout, "%llu");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void pprint_get_uptime(void)
|
||||
{
|
||||
glibtop_uptime buf;
|
||||
|
||||
glibtop_get_uptime(&buf);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_uptime);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT(uptime, "%f");
|
||||
PPRINT(idletime, "%f");
|
||||
PPRINT(boot_time, "%llu");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void pprint_get_proc_kernel(pid_t pid)
|
||||
{
|
||||
glibtop_proc_kernel buf;
|
||||
|
||||
glibtop_get_proc_kernel(&buf, pid);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_proc_kernel);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT(k_flags, "%llu");
|
||||
PPRINT(min_flt, "%llu");
|
||||
PPRINT(maj_flt, "%llu");
|
||||
PPRINT(cmin_flt, "%llu");
|
||||
PPRINT(cmaj_flt, "%llu");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
static void pprint_get_proc_mem(pid_t pid)
|
||||
{
|
||||
glibtop_proc_mem buf;
|
||||
|
||||
glibtop_get_proc_mem(&buf, pid);
|
||||
|
||||
HEADER_PPRINT(glibtop_get_proc_mem);
|
||||
PPRINT(flags, "%#llx");
|
||||
PPRINT(size, "%llu");
|
||||
PPRINT(vsize, "%llu");
|
||||
PPRINT(resident, "%llu");
|
||||
PPRINT(share, "%llu");
|
||||
PPRINT(rss, "%llu");
|
||||
PPRINT(rss_rlim, "%llu");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
glibtop_init();
|
||||
|
||||
pprint_get_cpu();
|
||||
|
||||
pprint_get_fsusage("/");
|
||||
|
||||
pprint_get_loadavg();
|
||||
|
||||
pprint_get_mem();
|
||||
|
||||
pprint_get_mountlist(TRUE);
|
||||
pprint_get_mountlist(FALSE);
|
||||
|
||||
pprint_get_msg_limits();
|
||||
|
||||
pprint_get_swap();
|
||||
|
||||
pprint_get_netlist();
|
||||
|
||||
pprint_get_netload("eth0");
|
||||
pprint_get_netload("ppp0");
|
||||
pprint_get_netload("<unknown>");
|
||||
/* pprint_get_sysinfo(); */
|
||||
|
||||
pprint_get_uptime();
|
||||
|
||||
pprint_get_proc_kernel(getpid());
|
||||
pprint_get_proc_mem(getpid());
|
||||
|
||||
glibtop_close();
|
||||
|
||||
return 0;
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/procargs.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
static void show_args(pid_t pid, unsigned max_len)
|
||||
{
|
||||
glibtop_proc_args buf;
|
||||
char ** const pargv = glibtop_get_proc_argv(&buf, pid, max_len);
|
||||
|
||||
char **parg = pargv;
|
||||
|
||||
printf("<%ld>\t", (long)pid);
|
||||
|
||||
while(*parg)
|
||||
{
|
||||
printf("\"%s\" ", *parg);
|
||||
parg++;
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
|
||||
g_strfreev(pargv);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
glibtop_init();
|
||||
|
||||
show_args(getpid(), 0);
|
||||
show_args(getpid(), 15);
|
||||
|
||||
while(*++argv)
|
||||
{
|
||||
pid_t pid = strtol(*argv, NULL, 10);
|
||||
show_args(pid, 0);
|
||||
show_args(pid, 15);
|
||||
}
|
||||
|
||||
glibtop_close();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,43 +0,0 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/proclist.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
static void print_pids(guint64 which, guint64 arg)
|
||||
{
|
||||
unsigned *pids;
|
||||
unsigned i;
|
||||
glibtop_proclist buf;
|
||||
|
||||
pids = glibtop_get_proclist(&buf, which, arg);
|
||||
|
||||
printf("glibtop_get_proclist(%#llx, %llu) -> %lu processes\n",
|
||||
which, arg, (unsigned long)buf.number);
|
||||
|
||||
for (i = 0; i < buf.number; ++i)
|
||||
printf("%u ", pids[i]);
|
||||
|
||||
putchar('\n');
|
||||
putchar('\n');
|
||||
|
||||
g_free(pids);
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
glibtop_init();
|
||||
|
||||
print_pids(GLIBTOP_KERN_PROC_ALL, 0);
|
||||
print_pids(GLIBTOP_KERN_PROC_UID, getuid());
|
||||
|
||||
glibtop_close();
|
||||
|
||||
return 0;
|
||||
}
|
@@ -1,163 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.h>
|
||||
|
||||
#include <glibtop/parameter.h>
|
||||
|
||||
#include <glibtop/procmap.h>
|
||||
|
||||
|
||||
#include <sys/resource.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#ifndef PROFILE_COUNT
|
||||
#define PROFILE_COUNT 1
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_proc_map procmap;
|
||||
glibtop_map_entry *maps;
|
||||
unsigned method, count, port, i;
|
||||
char buffer [BUFSIZ];
|
||||
pid_t pid;
|
||||
|
||||
count = PROFILE_COUNT;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (GETTEXT_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);
|
||||
|
||||
glibtop_init_r (&glibtop_global_server, 0, 0);
|
||||
|
||||
if ((argc != 2) || (sscanf (argv [1], "%d", (int *) &pid) != 1))
|
||||
g_error ("Usage: %s pid", argv [0]);
|
||||
|
||||
fprintf (stderr, "Getting memory maps for pid %d.\n\n", (int) pid);
|
||||
|
||||
maps = glibtop_get_proc_map (&procmap, pid);
|
||||
|
||||
for (i = 0; i < procmap.number; i++) {
|
||||
const char *filename = NULL;
|
||||
unsigned device, device_major, device_minor;
|
||||
char perm [5];
|
||||
|
||||
if (maps [i].flags & (1L << GLIBTOP_MAP_ENTRY_FILENAME))
|
||||
filename = maps [i].filename;
|
||||
|
||||
perm [0] = (maps [i].perm & GLIBTOP_MAP_PERM_READ) ? 'r' : '-';
|
||||
perm [1] = (maps [i].perm & GLIBTOP_MAP_PERM_WRITE) ? 'w' : '-';
|
||||
perm [2] = (maps [i].perm & GLIBTOP_MAP_PERM_EXECUTE) ? 'x' : '-';
|
||||
perm [3] = (maps [i].perm & GLIBTOP_MAP_PERM_SHARED) ? 's' : '-';
|
||||
perm [4] = (maps [i].perm & GLIBTOP_MAP_PERM_PRIVATE) ? 'p' : '-';
|
||||
|
||||
device = (unsigned long) maps [i].device;
|
||||
device_minor = (device & 255);
|
||||
device_major = ((device >> 8) & 255);
|
||||
|
||||
if (filename) {
|
||||
char *format;
|
||||
|
||||
if (sizeof (void*) == 8)
|
||||
format = "%016lx-%016lx %016lx - "
|
||||
"%02x:%02x %08lu - %4s - %s\n";
|
||||
else
|
||||
format = "%08lx-%08lx %08lx - "
|
||||
"%02x:%02x %08lu - %4s - %s\n";
|
||||
|
||||
fprintf (stderr, format,
|
||||
(unsigned long) maps [i].start,
|
||||
(unsigned long) maps [i].end,
|
||||
(unsigned long) maps [i].offset,
|
||||
device_major, device_minor,
|
||||
(unsigned long) maps [i].inode,
|
||||
perm, filename);
|
||||
} else {
|
||||
char * format;
|
||||
|
||||
if (sizeof (void*) == 8)
|
||||
format = "%016lx-%016lx %016lx - "
|
||||
"%02x:%02x %08lu - %4s\n";
|
||||
else
|
||||
format = "%08lx-%08lx %08lx - "
|
||||
"%02x:%02x %08lu - %4s\n";
|
||||
|
||||
fprintf (stderr, format,
|
||||
(unsigned long) maps [i].start,
|
||||
(unsigned long) maps [i].end,
|
||||
(unsigned long) maps [i].offset,
|
||||
device_major, device_minor,
|
||||
(unsigned long) maps [i].inode,
|
||||
perm);
|
||||
}
|
||||
|
||||
|
||||
g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB "
|
||||
"shared_clean:%lluKib shared_dirty:%lluKiB "
|
||||
"private_clean:%lluKiB private_dirty: %lluKiB\n",
|
||||
maps[i].flags,
|
||||
maps[i].size >> 10,
|
||||
maps[i].rss >> 10,
|
||||
maps[i].shared_clean >> 10,
|
||||
maps[i].shared_dirty >> 10,
|
||||
maps[i].private_clean >> 10,
|
||||
maps[i].private_dirty >> 10);
|
||||
|
||||
if (filename && (filename != maps [i].filename))
|
||||
g_free ((void*)filename);
|
||||
}
|
||||
|
||||
g_free (maps);
|
||||
|
||||
glibtop_close ();
|
||||
|
||||
exit (0);
|
||||
}
|
@@ -1,289 +1,67 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
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. */
|
||||
|
||||
#include <locale.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <libintl.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.h>
|
||||
#include <glibtop/xmalloc.h>
|
||||
|
||||
#include <glibtop/union.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
static void
|
||||
output (pid_t pid)
|
||||
{
|
||||
glibtop_union data;
|
||||
char *args;
|
||||
unsigned i;
|
||||
|
||||
#if HAVE_LIBGTOP_SMP
|
||||
unsigned long total;
|
||||
double p_total, p_utime, p_stime;
|
||||
double b_total, b_utime, b_stime;
|
||||
double s_total, s_utime, s_stime;
|
||||
double my_utime, my_stime;
|
||||
unsigned int ncpu;
|
||||
#endif
|
||||
|
||||
printf ("\n");
|
||||
|
||||
glibtop_get_proc_state (&data.proc_state, pid);
|
||||
|
||||
printf ("Proc_State PID %5d (0x%08lx): "
|
||||
"'%s', %c, %lu, %lu\n", (int) pid,
|
||||
(unsigned long) data.proc_state.flags,
|
||||
data.proc_state.cmd, data.proc_state.state,
|
||||
(unsigned long) data.proc_state.uid,
|
||||
(unsigned long) data.proc_state.gid);
|
||||
|
||||
glibtop_get_proc_uid (&data.proc_uid, pid);
|
||||
|
||||
printf ("Proc_Uid PID %5d (0x%08lx): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
|
||||
(unsigned long) data.proc_uid.flags,
|
||||
data.proc_uid.uid, data.proc_uid.euid,
|
||||
data.proc_uid.gid, data.proc_uid.egid,
|
||||
data.proc_uid.pid, data.proc_uid.ppid,
|
||||
data.proc_uid.pgrp, data.proc_uid.session,
|
||||
data.proc_uid.tty, data.proc_uid.tpgid,
|
||||
data.proc_uid.priority, data.proc_uid.nice);
|
||||
|
||||
glibtop_get_proc_mem (&data.proc_mem, pid);
|
||||
|
||||
printf ("Proc_Mem PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu\n", (int) pid,
|
||||
(unsigned long) data.proc_mem.flags,
|
||||
(unsigned long) data.proc_mem.size,
|
||||
(unsigned long) data.proc_mem.vsize,
|
||||
(unsigned long) data.proc_mem.resident,
|
||||
(unsigned long) data.proc_mem.share,
|
||||
(unsigned long) data.proc_mem.rss,
|
||||
(unsigned long) data.proc_mem.rss_rlim);
|
||||
|
||||
glibtop_get_proc_segment (&data.proc_segment, pid);
|
||||
|
||||
printf ("Proc_Segment PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
|
||||
(unsigned long) data.proc_segment.flags,
|
||||
(unsigned long) data.proc_segment.text_rss,
|
||||
(unsigned long) data.proc_segment.shlib_rss,
|
||||
(unsigned long) data.proc_segment.data_rss,
|
||||
(unsigned long) data.proc_segment.stack_rss,
|
||||
(unsigned long) data.proc_segment.dirty_size,
|
||||
(unsigned long) data.proc_segment.start_code,
|
||||
(unsigned long) data.proc_segment.end_code,
|
||||
(unsigned long) data.proc_segment.start_stack);
|
||||
|
||||
glibtop_get_proc_time (&data.proc_time, pid);
|
||||
|
||||
printf ("Proc_Time PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
|
||||
(unsigned long) data.proc_time.flags,
|
||||
(unsigned long) data.proc_time.start_time,
|
||||
(unsigned long) data.proc_time.rtime,
|
||||
(unsigned long) data.proc_time.utime,
|
||||
(unsigned long) data.proc_time.stime,
|
||||
(unsigned long) data.proc_time.cutime,
|
||||
(unsigned long) data.proc_time.cstime,
|
||||
(unsigned long) data.proc_time.timeout,
|
||||
(unsigned long) data.proc_time.it_real_value,
|
||||
(unsigned long) data.proc_time.frequency);
|
||||
|
||||
glibtop_get_proc_signal (&data.proc_signal, pid);
|
||||
|
||||
printf ("Proc_Signal PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu\n", (int) pid,
|
||||
(unsigned long) data.proc_signal.flags,
|
||||
(unsigned long) data.proc_signal.signal,
|
||||
(unsigned long) data.proc_signal.blocked,
|
||||
(unsigned long) data.proc_signal.sigignore,
|
||||
(unsigned long) data.proc_signal.sigcatch);
|
||||
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, pid);
|
||||
|
||||
printf ("Proc_Kernel PID %5d (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) pid,
|
||||
(unsigned long) data.proc_kernel.flags,
|
||||
(unsigned long) data.proc_kernel.k_flags,
|
||||
(unsigned long) data.proc_kernel.min_flt,
|
||||
(unsigned long) data.proc_kernel.maj_flt,
|
||||
(unsigned long) data.proc_kernel.cmin_flt,
|
||||
(unsigned long) data.proc_kernel.cmaj_flt,
|
||||
(unsigned long) data.proc_kernel.kstk_esp,
|
||||
(unsigned long) data.proc_kernel.kstk_eip,
|
||||
(unsigned long) data.proc_kernel.nwchan,
|
||||
data.proc_kernel.wchan);
|
||||
|
||||
printf ("\n");
|
||||
|
||||
args = glibtop_get_proc_args (&data.proc_args, pid, 0);
|
||||
|
||||
for (i = 0; i < data.proc_args.size; i++) {
|
||||
if (args [i]) continue;
|
||||
args [i] = '|';
|
||||
}
|
||||
|
||||
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid,
|
||||
(unsigned long) data.proc_args.flags,
|
||||
(unsigned long) data.proc_args.size,
|
||||
args ? args : "");
|
||||
|
||||
g_free (args);
|
||||
|
||||
printf ("\n");
|
||||
|
||||
#if HAVE_LIBGTOP_SMP
|
||||
ncpu = glibtop_global_server->ncpu;
|
||||
|
||||
glibtop_get_proc_time (&data.proc_time, pid);
|
||||
|
||||
total = (unsigned long) data.proc_time.utime +
|
||||
(unsigned long) data.proc_time.stime;
|
||||
|
||||
p_total = total ? (double) total : 1.0;
|
||||
|
||||
p_utime = (double) data.proc_time.utime * 100.0 / p_total;
|
||||
p_stime = (double) data.proc_time.stime * 100.0 / p_total;
|
||||
|
||||
b_total = p_total / ncpu;
|
||||
b_utime = (double) data.proc_time.utime / ncpu;
|
||||
b_stime = (double) data.proc_time.stime / ncpu;
|
||||
|
||||
s_total = 0.0; s_utime = 0.0; s_stime = 0.0;
|
||||
|
||||
printf ("Proc_Time PID %5d (0x%08lx): %12lu %12lu %12lu\n", (int) pid,
|
||||
(unsigned long) data.proc_time.flags, total,
|
||||
(unsigned long) data.proc_time.utime,
|
||||
(unsigned long) data.proc_time.stime);
|
||||
|
||||
for (i = 0; i < ncpu; i++) {
|
||||
unsigned long this_total;
|
||||
|
||||
this_total = (unsigned long) data.proc_time.xcpu_utime [i] +
|
||||
(unsigned long) data.proc_time.xcpu_stime [i];
|
||||
|
||||
printf ("CPU %3d PID %5d (0x%08lx): %12lu %12lu %12lu\n", i,
|
||||
(int) pid, (unsigned long) data.proc_time.flags, this_total,
|
||||
(unsigned long) data.proc_time.xcpu_utime [i],
|
||||
(unsigned long) data.proc_time.xcpu_stime [i]);
|
||||
|
||||
s_total += fabs (((double) this_total) - b_total);
|
||||
s_utime += fabs (((double) data.proc_time.xcpu_utime [i]) - b_utime);
|
||||
s_stime += fabs (((double) data.proc_time.xcpu_stime [i]) - b_stime);
|
||||
}
|
||||
|
||||
printf ("\n");
|
||||
|
||||
printf ("Proc_Time PID %5d (0x%08lx): %12.3f %12.3f %12.3f\n", (int) pid,
|
||||
(unsigned long) data.proc_time.flags, 100.0, p_utime, p_stime);
|
||||
|
||||
for (i = 0; i < ncpu; i++) {
|
||||
double this_p_total, this_p_utime, this_p_stime;
|
||||
unsigned long this_total;
|
||||
|
||||
this_total = (unsigned long) data.proc_time.xcpu_utime [i] +
|
||||
(unsigned long) data.proc_time.xcpu_stime [i];
|
||||
|
||||
this_p_total = (double) this_total * 100.0 / p_total;
|
||||
|
||||
this_p_utime = (double) data.proc_time.xcpu_utime [i] * 100.0 / p_total;
|
||||
this_p_stime = (double) data.proc_time.xcpu_stime [i] * 100.0 / p_total;
|
||||
|
||||
printf ("CPU %3d PID %5d (0x%08lx): %12.3f %12.3f %12.3f\n", i,
|
||||
(int) pid, (unsigned long) data.proc_time.flags,
|
||||
this_p_total, this_p_utime, this_p_stime);
|
||||
}
|
||||
|
||||
printf ("\n");
|
||||
|
||||
my_utime = (unsigned long) data.proc_time.utime ?
|
||||
(double) data.proc_time.utime : 1.0;
|
||||
my_stime = (unsigned long) data.proc_time.stime ?
|
||||
(double) data.proc_time.stime : 1.0;
|
||||
|
||||
printf ("SPIN: %31s %12.3f %12.3f %12.3f\n", "", s_total * 100.0 / p_total,
|
||||
s_utime * 100.0 / my_utime, s_stime * 100.0 / my_stime);
|
||||
|
||||
printf ("\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_union data;
|
||||
glibtop_proclist proclist;
|
||||
glibtop_sysdeps sysdeps;
|
||||
unsigned *ptr, pid, i;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (GETTEXT_PACKAGE);
|
||||
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
glibtop_init ();
|
||||
glibtop_init__r (&glibtop_global_server);
|
||||
|
||||
glibtop_get_sysdeps (&sysdeps);
|
||||
|
||||
printf ("Sysdeps (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
|
||||
fprintf (stderr, "Sysdeps (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
|
||||
"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
(unsigned long) sysdeps.flags,
|
||||
(unsigned long) sysdeps.cpu,
|
||||
(unsigned long) sysdeps.mem,
|
||||
(unsigned long) sysdeps.swap,
|
||||
(unsigned long) sysdeps.uptime,
|
||||
(unsigned long) sysdeps.loadavg,
|
||||
(unsigned long) sysdeps.shm_limits,
|
||||
(unsigned long) sysdeps.msg_limits,
|
||||
(unsigned long) sysdeps.sem_limits,
|
||||
(unsigned long) sysdeps.proclist,
|
||||
(unsigned long) sysdeps.proc_state,
|
||||
(unsigned long) sysdeps.proc_uid,
|
||||
(unsigned long) sysdeps.proc_mem,
|
||||
(unsigned long) sysdeps.proc_time,
|
||||
(unsigned long) sysdeps.proc_signal,
|
||||
(unsigned long) sysdeps.proc_kernel,
|
||||
(unsigned long) sysdeps.proc_segment);
|
||||
sysdeps.flags, sysdeps.cpu, sysdeps.mem, sysdeps.swap,
|
||||
sysdeps.uptime, sysdeps.loadavg, sysdeps.shm_limits,
|
||||
sysdeps.msg_limits, sysdeps.sem_limits,
|
||||
sysdeps.proclist, sysdeps.proc_state,
|
||||
sysdeps.proc_uid, sysdeps.proc_mem,
|
||||
sysdeps.proc_time, sysdeps.proc_signal,
|
||||
sysdeps.proc_kernel, sysdeps.proc_segment);
|
||||
|
||||
if ((argc == 2) && (sscanf (argv [1], "%d", &pid) == 1)) {
|
||||
output (pid);
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
exit (0);
|
||||
}
|
||||
ptr = glibtop_get_proclist (&proclist);
|
||||
|
||||
printf ("\n");
|
||||
|
||||
ptr = glibtop_get_proclist (&proclist, 0, 0);
|
||||
|
||||
printf ("Proclist (0x%08lx): %lu, %lu, %lu\n",
|
||||
(unsigned long) proclist.flags,
|
||||
(unsigned long) proclist.number,
|
||||
(unsigned long) proclist.size,
|
||||
(unsigned long) proclist.total);
|
||||
fprintf (stderr, "Proclist (0x%08lx): %ld, %ld, %ld\n",
|
||||
proclist.flags, proclist.number, proclist.size,
|
||||
proclist.total);
|
||||
|
||||
if (!ptr) exit (1);
|
||||
|
||||
@@ -291,13 +69,74 @@ main (int argc, char *argv [])
|
||||
|
||||
pid = ptr [i];
|
||||
|
||||
output (pid);
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
glibtop_get_proc_state (&data.proc_state, pid);
|
||||
|
||||
fprintf (stderr, "Proc_State PID %5u (0x%08lx): "
|
||||
"'%s', %c, %u, %u\n", pid, data.proc_state.flags,
|
||||
data.proc_state.cmd, data.proc_state.state,
|
||||
data.proc_state.uid, data.proc_state.gid);
|
||||
|
||||
glibtop_get_proc_uid (&data.proc_uid, pid);
|
||||
|
||||
fprintf (stderr, "Proc_Uid PID %5u (0x%08lx): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n",
|
||||
pid, data.proc_uid.flags, data.proc_uid.uid,
|
||||
data.proc_uid.euid, data.proc_uid.gid,
|
||||
data.proc_uid.egid, data.proc_uid.pid,
|
||||
data.proc_uid.ppid, data.proc_uid.pgrp,
|
||||
data.proc_uid.session, data.proc_uid.tty,
|
||||
data.proc_uid.tpgid, data.proc_uid.priority,
|
||||
data.proc_uid.nice);
|
||||
|
||||
glibtop_get_proc_mem (&data.proc_mem, pid);
|
||||
|
||||
fprintf (stderr, "Proc_Mem PID %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %ld %ld\n", pid, data.proc_mem.flags,
|
||||
data.proc_mem.size, data.proc_mem.vsize,
|
||||
data.proc_mem.resident, data.proc_mem.share,
|
||||
data.proc_mem.rss, data.proc_mem.rss_rlim);
|
||||
|
||||
glibtop_get_proc_time (&data.proc_time, pid);
|
||||
|
||||
fprintf (stderr, "Proc_Time PID %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %ld %ld %ld\n", pid, data.proc_time.flags,
|
||||
data.proc_time.start_time, data.proc_time.utime,
|
||||
data.proc_time.stime, data.proc_time.cutime,
|
||||
data.proc_time.cstime, data.proc_time.timeout,
|
||||
data.proc_time.it_real_value);
|
||||
|
||||
glibtop_get_proc_signal (&data.proc_signal, pid);
|
||||
|
||||
fprintf (stderr, "Proc_Signal PID %5u (0x%08lx): "
|
||||
"%d %d %d %d\n", pid, data.proc_signal.flags,
|
||||
data.proc_signal.signal, data.proc_signal.blocked,
|
||||
data.proc_signal.sigignore, data.proc_signal.sigcatch);
|
||||
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, pid);
|
||||
|
||||
fprintf (stderr, "Proc_Kernel PID %5u (0x%08lx): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
|
||||
data.proc_kernel.flags, data.proc_kernel.k_flags,
|
||||
data.proc_kernel.min_flt, data.proc_kernel.maj_flt,
|
||||
data.proc_kernel.cmin_flt, data.proc_kernel.cmaj_flt,
|
||||
data.proc_kernel.kstk_esp, data.proc_kernel.kstk_eip,
|
||||
data.proc_kernel.wchan);
|
||||
|
||||
glibtop_get_proc_segment (&data.proc_segment, pid);
|
||||
|
||||
fprintf (stderr, "Proc_Segment PID %5u (0x%08lx): "
|
||||
"%ld %ld %ld %ld %lu %lu %lu\n", pid, data.proc_segment.flags,
|
||||
data.proc_segment.trs, data.proc_segment.lrs,
|
||||
data.proc_segment.drs, data.proc_segment.dt,
|
||||
data.proc_segment.start_code, data.proc_segment.end_code,
|
||||
data.proc_segment.start_stack);
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
g_free (ptr);
|
||||
glibtop_free (ptr);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
124
examples/smp.c
124
examples/smp.c
@@ -1,124 +0,0 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, September 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 <config.h>
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/cpu.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_cpu cpu;
|
||||
unsigned long frequency;
|
||||
double total, user, nice, sys, idle;
|
||||
double b_total, b_user, b_nice, b_sys, b_idle;
|
||||
double s_total, s_user, s_nice, s_sys, s_idle;
|
||||
char separator [BUFSIZ], buffer [BUFSIZ];
|
||||
int ncpu, i;
|
||||
|
||||
glibtop_init();
|
||||
|
||||
glibtop_get_cpu (&cpu);
|
||||
|
||||
ncpu = glibtop_global_server->ncpu ? glibtop_global_server->ncpu : 1;
|
||||
|
||||
frequency = (unsigned long) cpu.frequency;
|
||||
|
||||
total = ((unsigned long) cpu.total) ? ((double) cpu.total) : 1.0;
|
||||
user = ((unsigned long) cpu.user) ? ((double) cpu.user) : 1.0;
|
||||
nice = ((unsigned long) cpu.nice) ? ((double) cpu.nice) : 1.0;
|
||||
sys = ((unsigned long) cpu.sys) ? ((double) cpu.sys) : 1.0;
|
||||
idle = ((unsigned long) cpu.idle) ? ((double) cpu.idle) : 1.0;
|
||||
|
||||
s_total = s_user = s_nice = s_sys = s_idle = 0.0;
|
||||
|
||||
b_total = total / ncpu;
|
||||
b_user = user / ncpu;
|
||||
b_nice = nice / ncpu;
|
||||
b_sys = sys / ncpu;
|
||||
b_idle = idle / ncpu;
|
||||
|
||||
memset (separator, '-', 91);
|
||||
separator [92] = '\0';
|
||||
|
||||
sprintf (buffer, "Ticks (%ld per second):", frequency);
|
||||
|
||||
printf ("\n\n%-26s %12s %12s %12s %12s %12s\n%s\n", buffer,
|
||||
"Total", "User", "Nice", "Sys", "Idle", separator);
|
||||
|
||||
printf ("CPU (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n\n",
|
||||
(unsigned long) cpu.flags, total, user, nice, sys, idle);
|
||||
|
||||
for (i = 0; i < glibtop_global_server->ncpu; i++) {
|
||||
printf ("CPU %3d (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n", i,
|
||||
(unsigned long) cpu.flags,
|
||||
(unsigned long) cpu.xcpu_total [i],
|
||||
(unsigned long) cpu.xcpu_user [i],
|
||||
(unsigned long) cpu.xcpu_nice [i],
|
||||
(unsigned long) cpu.xcpu_sys [i],
|
||||
(unsigned long) cpu.xcpu_idle [i]);
|
||||
|
||||
s_total += fabs (((double) cpu.xcpu_total [i]) - b_total);
|
||||
s_user += fabs (((double) cpu.xcpu_user [i]) - b_user);
|
||||
s_nice += fabs (((double) cpu.xcpu_nice [i]) - b_nice);
|
||||
s_sys += fabs (((double) cpu.xcpu_sys [i]) - b_sys);
|
||||
s_idle += fabs (((double) cpu.xcpu_idle [i]) - b_idle);
|
||||
}
|
||||
|
||||
printf ("%s\n\n\n", separator);
|
||||
|
||||
printf ("%-26s %12s %12s %12s %12s %12s\n%s\n", "Percent:",
|
||||
"Total (%)", "User (%)", "Nice (%)", "Sys (%)",
|
||||
"Idle (%)", separator);
|
||||
|
||||
printf ("CPU (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n\n",
|
||||
(unsigned long) cpu.flags, (double) total * 100.0 / total,
|
||||
(double) user * 100.0 / total,
|
||||
(double) nice * 100.0 / total,
|
||||
(double) sys * 100.0 / total,
|
||||
(double) idle * 100.0 / total);
|
||||
|
||||
for (i = 0; i < glibtop_global_server->ncpu; i++) {
|
||||
double p_total, p_user, p_nice, p_sys, p_idle;
|
||||
|
||||
p_total = ((double) cpu.xcpu_total [i]) * 100.0 / total;
|
||||
p_user = ((double) cpu.xcpu_user [i]) * 100.0 / user;
|
||||
p_nice = ((double) cpu.xcpu_nice [i]) * 100.0 / nice;
|
||||
p_sys = ((double) cpu.xcpu_sys [i]) * 100.0 / sys;
|
||||
p_idle = ((double) cpu.xcpu_idle [i]) * 100.0 / idle;
|
||||
|
||||
printf ("CPU %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n",
|
||||
i, (unsigned long) cpu.flags, p_total, p_user, p_nice,
|
||||
p_sys, p_idle);
|
||||
}
|
||||
|
||||
printf ("%s\n%-26s %12.3f %12.3f %12.3f %12.3f %12.3f\n\n", separator,
|
||||
"Spin:", s_total * 100.0 / total, s_user * 100.0 / user,
|
||||
s_nice * 100.0 / nice, s_sys * 100.0 / sys, s_idle * 100.0 / idle);
|
||||
|
||||
exit (0);
|
||||
}
|
@@ -1,152 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
#include <glibtop/parameter.h>
|
||||
|
||||
#ifndef PROFILE_COUNT
|
||||
#define PROFILE_COUNT 1
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_sysdeps sysdeps;
|
||||
unsigned method, count, port;
|
||||
char buffer [BUFSIZ];
|
||||
|
||||
count = PROFILE_COUNT;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (GETTEXT_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);
|
||||
|
||||
glibtop_init_r (&glibtop_global_server, 0, 0);
|
||||
|
||||
glibtop_get_sysdeps (&sysdeps);
|
||||
|
||||
#define FEATURE_CHECK(f) ((sysdeps.features & (1L << GLIBTOP_SYSDEPS_##f)) ? 1 : 0)
|
||||
|
||||
printf ("Sysdeps (0x%08lx):\n\n"
|
||||
"\tfeatures:\t\t0x%08lx\n\n"
|
||||
"\tcpu:\t\t%d\t0x%08lx\n"
|
||||
"\tmem:\t\t%d\t0x%08lx\n"
|
||||
"\tswap:\t\t%d\t0x%08lx\n\n"
|
||||
"\tuptime:\t\t%d\t0x%08lx\n"
|
||||
"\tloadavg:\t%d\t0x%08lx\n\n"
|
||||
"\tshm_limits:\t%d\t0x%08lx\n"
|
||||
"\tmsg_limits:\t%d\t0x%08lx\n"
|
||||
"\tsem_limits:\t%d\t0x%08lx\n\n"
|
||||
"\tproclist:\t%d\t0x%08lx\n\n"
|
||||
"\tproc_state:\t%d\t0x%08lx\n"
|
||||
"\tproc_uid:\t%d\t0x%08lx\n"
|
||||
"\tproc_mem:\t%d\t0x%08lx\n"
|
||||
"\tproc_time:\t%d\t0x%08lx\n"
|
||||
"\tproc_signal:\t%d\t0x%08lx\n"
|
||||
"\tproc_kernel:\t%d\t0x%08lx\n"
|
||||
"\tproc_segment:\t%d\t0x%08lx\n\n"
|
||||
"\tproc_args:\t%d\t0x%08lx\n"
|
||||
"\tproc_map:\t%d\t0x%08lx\n\n"
|
||||
"\tmountlist:\t%d\t0x%08lx\n"
|
||||
"\tfsusage:\t%d\t0x%08lx\n\n"
|
||||
"\tnetload:\t%d\t0x%08lx\n"
|
||||
"\tppp:\t\t%d\t0x%08lx\n\n",
|
||||
(unsigned long) sysdeps.flags,
|
||||
(unsigned long) sysdeps.features,
|
||||
FEATURE_CHECK(CPU),
|
||||
(unsigned long) sysdeps.cpu,
|
||||
FEATURE_CHECK(MEM),
|
||||
(unsigned long) sysdeps.mem,
|
||||
FEATURE_CHECK(SWAP),
|
||||
(unsigned long) sysdeps.swap,
|
||||
FEATURE_CHECK(UPTIME),
|
||||
(unsigned long) sysdeps.uptime,
|
||||
FEATURE_CHECK(LOADAVG),
|
||||
(unsigned long) sysdeps.loadavg,
|
||||
FEATURE_CHECK(SHM_LIMITS),
|
||||
(unsigned long) sysdeps.shm_limits,
|
||||
FEATURE_CHECK(MSG_LIMITS),
|
||||
(unsigned long) sysdeps.msg_limits,
|
||||
FEATURE_CHECK(SEM_LIMITS),
|
||||
(unsigned long) sysdeps.sem_limits,
|
||||
FEATURE_CHECK(PROCLIST),
|
||||
(unsigned long) sysdeps.proclist,
|
||||
FEATURE_CHECK(PROC_STATE),
|
||||
(unsigned long) sysdeps.proc_state,
|
||||
FEATURE_CHECK(PROC_UID),
|
||||
(unsigned long) sysdeps.proc_uid,
|
||||
FEATURE_CHECK(PROC_MEM),
|
||||
(unsigned long) sysdeps.proc_mem,
|
||||
FEATURE_CHECK(PROC_TIME),
|
||||
(unsigned long) sysdeps.proc_time,
|
||||
FEATURE_CHECK(PROC_SIGNAL),
|
||||
(unsigned long) sysdeps.proc_signal,
|
||||
FEATURE_CHECK(PROC_KERNEL),
|
||||
(unsigned long) sysdeps.proc_kernel,
|
||||
FEATURE_CHECK(PROC_SEGMENT),
|
||||
(unsigned long) sysdeps.proc_segment,
|
||||
FEATURE_CHECK(PROC_ARGS),
|
||||
(unsigned long) sysdeps.proc_args,
|
||||
FEATURE_CHECK(PROC_MAP),
|
||||
(unsigned long) sysdeps.proc_map,
|
||||
FEATURE_CHECK(MOUNTLIST),
|
||||
(unsigned long) sysdeps.mountlist,
|
||||
FEATURE_CHECK(FSUSAGE),
|
||||
(unsigned long) sysdeps.fsusage,
|
||||
FEATURE_CHECK(NETLOAD),
|
||||
(unsigned long) sysdeps.netload,
|
||||
FEATURE_CHECK(PPP),
|
||||
(unsigned long) sysdeps.ppp);
|
||||
|
||||
glibtop_close ();
|
||||
|
||||
exit (0);
|
||||
}
|
@@ -1,80 +0,0 @@
|
||||
(display (glibtop-names-sysdeps)) (newline)
|
||||
(display (glibtop-labels-sysdeps)) (newline)
|
||||
(display (glibtop-descriptions-sysdeps)) (newline)
|
||||
(display (glibtop-types-sysdeps)) (newline)
|
||||
|
||||
(newline)
|
||||
|
||||
(display (glibtop-names-cpu)) (newline)
|
||||
(display (glibtop-names-mem)) (newline)
|
||||
(display (glibtop-names-swap)) (newline)
|
||||
(display (glibtop-names-uptime)) (newline)
|
||||
(display (glibtop-names-loadavg)) (newline)
|
||||
(display (glibtop-names-shm_limits)) (newline)
|
||||
(display (glibtop-names-msg_limits)) (newline)
|
||||
(display (glibtop-names-sem_limits)) (newline)
|
||||
(display (glibtop-names-proclist)) (newline)
|
||||
(display (glibtop-names-proc_state)) (newline)
|
||||
(display (glibtop-names-proc_uid)) (newline)
|
||||
(display (glibtop-names-proc_mem)) (newline)
|
||||
(display (glibtop-names-proc_time)) (newline)
|
||||
(display (glibtop-names-proc_signal)) (newline)
|
||||
(display (glibtop-names-proc_kernel)) (newline)
|
||||
(display (glibtop-names-proc_segment)) (newline)
|
||||
|
||||
(newline)
|
||||
|
||||
(display (glibtop-labels-cpu)) (newline)
|
||||
(display (glibtop-labels-mem)) (newline)
|
||||
(display (glibtop-labels-swap)) (newline)
|
||||
(display (glibtop-labels-uptime)) (newline)
|
||||
(display (glibtop-labels-loadavg)) (newline)
|
||||
(display (glibtop-labels-shm_limits)) (newline)
|
||||
(display (glibtop-labels-msg_limits)) (newline)
|
||||
(display (glibtop-labels-sem_limits)) (newline)
|
||||
(display (glibtop-labels-proclist)) (newline)
|
||||
(display (glibtop-labels-proc_state)) (newline)
|
||||
(display (glibtop-labels-proc_uid)) (newline)
|
||||
(display (glibtop-labels-proc_mem)) (newline)
|
||||
(display (glibtop-labels-proc_time)) (newline)
|
||||
(display (glibtop-labels-proc_signal)) (newline)
|
||||
(display (glibtop-labels-proc_kernel)) (newline)
|
||||
(display (glibtop-labels-proc_segment)) (newline)
|
||||
|
||||
(newline)
|
||||
|
||||
(display (glibtop-descriptions-cpu)) (newline)
|
||||
(display (glibtop-descriptions-mem)) (newline)
|
||||
(display (glibtop-descriptions-swap)) (newline)
|
||||
(display (glibtop-descriptions-uptime)) (newline)
|
||||
(display (glibtop-descriptions-loadavg)) (newline)
|
||||
(display (glibtop-descriptions-shm_limits)) (newline)
|
||||
(display (glibtop-descriptions-msg_limits)) (newline)
|
||||
(display (glibtop-descriptions-sem_limits)) (newline)
|
||||
(display (glibtop-descriptions-proclist)) (newline)
|
||||
(display (glibtop-descriptions-proc_state)) (newline)
|
||||
(display (glibtop-descriptions-proc_uid)) (newline)
|
||||
(display (glibtop-descriptions-proc_mem)) (newline)
|
||||
(display (glibtop-descriptions-proc_time)) (newline)
|
||||
(display (glibtop-descriptions-proc_signal)) (newline)
|
||||
(display (glibtop-descriptions-proc_kernel)) (newline)
|
||||
(display (glibtop-descriptions-proc_segment)) (newline)
|
||||
|
||||
(newline)
|
||||
|
||||
(display (glibtop-types-cpu)) (newline)
|
||||
(display (glibtop-types-mem)) (newline)
|
||||
(display (glibtop-types-swap)) (newline)
|
||||
(display (glibtop-types-uptime)) (newline)
|
||||
(display (glibtop-types-loadavg)) (newline)
|
||||
(display (glibtop-types-shm_limits)) (newline)
|
||||
(display (glibtop-types-msg_limits)) (newline)
|
||||
(display (glibtop-types-sem_limits)) (newline)
|
||||
(display (glibtop-types-proclist)) (newline)
|
||||
(display (glibtop-types-proc_state)) (newline)
|
||||
(display (glibtop-types-proc_uid)) (newline)
|
||||
(display (glibtop-types-proc_mem)) (newline)
|
||||
(display (glibtop-types-proc_time)) (newline)
|
||||
(display (glibtop-types-proc_signal)) (newline)
|
||||
(display (glibtop-types-proc_kernel)) (newline)
|
||||
(display (glibtop-types-proc_segment)) (newline)
|
55
examples/third.c
Normal file
55
examples/third.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/* $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. */
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.h>
|
||||
#include <glibtop/xmalloc.h>
|
||||
|
||||
#include <glibtop/union.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
void main_prog(int argc, char *argv[]);
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
gh_enter (argc, argv, main_prog);
|
||||
exit (0);
|
||||
}
|
||||
|
||||
void
|
||||
main_prog (int argc, char *argv[])
|
||||
{
|
||||
glibtop_boot_guile ();
|
||||
#ifdef GLIBTOP_GUILE_NAMES
|
||||
glibtop_boot_guile_names ();
|
||||
#endif
|
||||
|
||||
gh_repl (argc, argv);
|
||||
}
|
@@ -1,360 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
#include <libintl.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.h>
|
||||
|
||||
#include <glibtop/parameter.h>
|
||||
|
||||
#include <glibtop/union.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
#include <sys/times.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#ifndef PROFILE_COUNT
|
||||
#define PROFILE_COUNT 100000L
|
||||
#endif
|
||||
|
||||
#ifndef PROFILE_COUNT_EXPENSIVE
|
||||
#define PROFILE_COUNT_EXPENSIVE 10000L
|
||||
#endif
|
||||
|
||||
#define ELAPSED_UTIME ((unsigned long) elapsed_utime.tv_sec * 1000000 + (unsigned long) elapsed_utime.tv_usec)
|
||||
#define ELAPSED_STIME ((unsigned long) elapsed_stime.tv_sec * 1000000 + (unsigned long) elapsed_stime.tv_usec)
|
||||
|
||||
#define libgtop_timeradd(tvp, uvp, vvp) \
|
||||
do { \
|
||||
(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
|
||||
(vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
|
||||
if ((vvp)->tv_usec >= 1000000) { \
|
||||
(vvp)->tv_sec++; \
|
||||
(vvp)->tv_usec -= 1000000; \
|
||||
} \
|
||||
} while (0)
|
||||
#define libgtop_timersub(tvp, uvp, vvp) \
|
||||
do { \
|
||||
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
|
||||
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
|
||||
if ((vvp)->tv_usec < 0) { \
|
||||
(vvp)->tv_sec--; \
|
||||
(vvp)->tv_usec += 1000000; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_union data;
|
||||
unsigned c, count, *ptr;
|
||||
struct rusage total_start, total_end;
|
||||
struct rusage rusage_start, rusage_end;
|
||||
struct timeval elapsed_utime, elapsed_stime;
|
||||
pid_t pid;
|
||||
|
||||
count = PROFILE_COUNT;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (GETTEXT_PACKAGE);
|
||||
|
||||
printf ("%-12s (%-10s): %7s - %9s - %9s\n",
|
||||
"Feature", "Flags", "Count", "utime", "stime");
|
||||
printf ("-------------------------------------------"
|
||||
"---------------\n");
|
||||
|
||||
glibtop_init_r (&glibtop_global_server, 0, 0);
|
||||
|
||||
getrusage (RUSAGE_SELF, &total_start);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_cpu (&data.cpu);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("CPU (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.cpu.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++)
|
||||
glibtop_get_mem (&data.mem);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Memory (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.mem.flags, PROFILE_COUNT_EXPENSIVE,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++)
|
||||
glibtop_get_swap (&data.swap);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Swap (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.swap.flags, PROFILE_COUNT_EXPENSIVE,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_uptime (&data.uptime);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Uptime (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.uptime.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_loadavg (&data.loadavg);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Loadavg (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.loadavg.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
printf ("\n");
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++) {
|
||||
ptr = glibtop_get_proclist (&data.proclist, 0, 0);
|
||||
g_free (ptr);
|
||||
}
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Proclist (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.proclist.flags,
|
||||
PROFILE_COUNT_EXPENSIVE,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE);
|
||||
|
||||
pid = getpid ();
|
||||
|
||||
printf ("\n");
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_state (&data.proc_state, pid);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Proc_State (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.proc_state.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_uid (&data.proc_uid, pid);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Proc_Uid (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.proc_uid.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_mem (&data.proc_mem, pid);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Proc_Mem (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.proc_mem.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_segment (&data.proc_segment, pid);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Proc_Segment (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.proc_segment.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_time (&data.proc_time, pid);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Proc_Time (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.proc_time.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_signal (&data.proc_signal, pid);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Proc_Signal (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.proc_signal.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_start);
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, pid);
|
||||
|
||||
getrusage (RUSAGE_SELF, &rusage_end);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("Proc_Kernel (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
|
||||
(unsigned long) data.proc_kernel.flags, PROFILE_COUNT,
|
||||
(long double) ELAPSED_UTIME / PROFILE_COUNT,
|
||||
(long double) ELAPSED_STIME / PROFILE_COUNT);
|
||||
|
||||
getrusage (RUSAGE_SELF, &total_end);
|
||||
|
||||
libgtop_timersub (&total_end.ru_utime, &total_start.ru_utime,
|
||||
&elapsed_utime);
|
||||
|
||||
libgtop_timersub (&total_end.ru_stime, &total_start.ru_stime,
|
||||
&elapsed_stime);
|
||||
|
||||
printf ("-------------------------------------------"
|
||||
"---------------\n");
|
||||
|
||||
printf ("%-36s %9lu - %9lu\n\n", "TOTAL",
|
||||
ELAPSED_UTIME, ELAPSED_STIME);
|
||||
|
||||
printf ("All timings are in clock ticks "
|
||||
"(1000000 ticks per second).\n\n");
|
||||
|
||||
glibtop_close ();
|
||||
|
||||
exit (0);
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/procwd.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
pid_t pid;
|
||||
glibtop_proc_wd buf;
|
||||
char **dirs, **dir;
|
||||
|
||||
if (argc < 2 || !(pid = strtoul(argv[1], NULL, 0)))
|
||||
pid = getpid();
|
||||
|
||||
glibtop_init();
|
||||
|
||||
dirs = glibtop_get_proc_wd(&buf, pid);
|
||||
|
||||
g_print("Process %u:\n"
|
||||
" - root: '%s'\n"
|
||||
" - exe: '%s'\n"
|
||||
" - working directories:\n",
|
||||
(unsigned)pid, buf.root, buf.exe);
|
||||
|
||||
for (dir = dirs; *dir; ++dir)
|
||||
g_print(" - '%s'\n", *dir);
|
||||
|
||||
g_strfreev(dirs);
|
||||
|
||||
glibtop_close();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
26
features.def
26
features.def
@@ -1,26 +0,0 @@
|
||||
void|cpu|ulong(total,user,nice,sys,idle,iowait,irq,softirq,frequency,xcpu_total[4],xcpu_user[4],xcpu_nice[4],xcpu_sys[4],xcpu_idle[4],xcpu_iowait[4],xcpu_irq[4],xcpu_softirq[4])
|
||||
void|mem|ulong(total,used,free,shared,buffer,cached,user,locked)
|
||||
void|swap|ulong(total,used,free,pagein,pageout)
|
||||
void|uptime|double(uptime,idletime)
|
||||
void|loadavg|double(loadavg[3]):ulong(nr_running,nr_tasks,last_pid)
|
||||
void|shm_limits|ulong(shmmax,shmmin,shmmni,shmseg,shmall)
|
||||
void|msg_limits|ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql)
|
||||
void|sem_limits|ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem)
|
||||
pid_t*|proclist|ulong(number,size,total)|long(which,arg)
|
||||
void|proc_state|str(cmd):char(state):ulong(uid,gid)|pid_t(pid)
|
||||
void|proc_uid|long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice)|pid_t(pid)
|
||||
void|proc_mem|long(size,vsize,resident,share,rss,rss_rlim)|pid_t(pid)
|
||||
void|proc_time|long(start_time,rtime,utime,stime,cutime,cstime,timeout,it_real_value,frequency,xcpu_utime[4],xcpu_stime[4])|pid_t(pid)
|
||||
void|proc_signal|ulong(signal[2],blocked[2],sigignore[2],sigcatch[2])|pid_t(pid)
|
||||
void|proc_kernel|ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,nwchan):str(wchan)|pid_t(pid)
|
||||
void|proc_segment|ulong(text_rss,shlib_rss,data_rss,stack_rss,dirty_size,start_code,end_code,start_stack)|pid_t(pid)
|
||||
char *|proc_args|ulong(size)|pid_t(pid):unsigned(max_len)
|
||||
glibtop_map_entry *|proc_map|ulong(number,size,total)|pid_t(pid)
|
||||
glibtop_open_files_entry *|proc_open_files|ulong(number)|pid_t(pid)
|
||||
glibtop_mountentry *|@mountlist|ulong(number,size,total)|int(all_fs)
|
||||
void|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|string|mount_dir
|
||||
void|netload|ulong(if_flags,mtu,subnet,address,packets_in,packets_out,packets_total,bytes_in,bytes_out,bytes_total,errors_in,errors_out,errors_total,collisions)|string|interface
|
||||
void|ppp|ulong(state,bytes_in,bytes_out)|ushort(device)
|
||||
char **|netlist|unsigned(number)
|
||||
char **|proc_wd|ulong(number),str(root),str(exe)|pid_t(pid)
|
||||
|
149
glibtop.h
149
glibtop.h
@@ -1,143 +1,72 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
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_H__
|
||||
#define __GLIBTOP_H__
|
||||
|
||||
#include <glib/gmacros.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _glibtop glibtop;
|
||||
|
||||
/**
|
||||
* LIBGTOP_CHECK_VERSION
|
||||
* @major: Major version number
|
||||
* @minor: Minor version number
|
||||
* @micro: Micro version number
|
||||
*
|
||||
* Checks if the version given is compatable with this version of the
|
||||
* library. For example, LIBGTOP_CHECK_VERSION(1.2.3) would return TRUE
|
||||
* if the version is 1.2.5, and FALSE if 1.1.0. This can be used in
|
||||
* build tests.
|
||||
*
|
||||
**/
|
||||
|
||||
#include <libgtopconfig.h>
|
||||
|
||||
#define LIBGTOP_CHECK_VERSION(major, minor, micro) \
|
||||
(LIBGTOP_MAJOR_VERSION > (major) || \
|
||||
(LIBGTOP_MAJOR_VERSION == (major) && LIBGTOP_MINOR_VERSION > (minor)) || \
|
||||
(LIBGTOP_MAJOR_VERSION == (major) && LIBGTOP_MINOR_VERSION == (minor) && \
|
||||
LIBGTOP_MICRO_VERSION >= (micro)))
|
||||
|
||||
|
||||
#include <glibtop/global.h>
|
||||
|
||||
#include <glibtop_server.h>
|
||||
|
||||
#ifdef HAVE_GLIBTOP_MACHINE_H
|
||||
#include <glibtop_machine.h>
|
||||
#endif
|
||||
|
||||
#ifndef GLIBTOP_MOUNTENTRY_LEN
|
||||
#define GLIBTOP_MOUNTENTRY_LEN 79
|
||||
#endif
|
||||
|
||||
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
#include <glibtop/close.h>
|
||||
|
||||
typedef struct _glibtop glibtop;
|
||||
|
||||
struct _glibtop
|
||||
{
|
||||
int fd; /* Server file descriptor */
|
||||
#ifdef HAVE_GLIBTOP_MACHINE_H
|
||||
|
||||
struct _glibtop
|
||||
{
|
||||
unsigned flags;
|
||||
unsigned method; /* Server Method */
|
||||
unsigned error_method; /* Error Method */
|
||||
glibtop_machine machine; /* Machine dependent data */
|
||||
#endif
|
||||
int input [2]; /* Pipe client <- server */
|
||||
int output [2]; /* Pipe client -> server */
|
||||
int socket; /* Accepted connection of a socket */
|
||||
int ncpu; /* Number of CPUs, zero if single-processor */
|
||||
int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */
|
||||
unsigned long os_version_code; /* Version code of the operating system */
|
||||
const char *name; /* Program name for error messages */
|
||||
const char *server_command; /* Command used to invoke server */
|
||||
const char *server_host; /* Host the server should run on */
|
||||
const char *server_user; /* Name of the user on the target host */
|
||||
const char *server_rsh; /* Command used to connect to the target host */
|
||||
unsigned long features; /* Server is required for this features */
|
||||
unsigned long server_port; /* Port on which daemon is listening */
|
||||
glibtop_sysdeps sysdeps; /* Detailed feature list */
|
||||
glibtop_sysdeps required; /* Required feature list */
|
||||
pid_t pid; /* PID of the server */
|
||||
};
|
||||
|
||||
#else /* !HAVE_GLIBTOP_MACHINE_H */
|
||||
|
||||
struct _glibtop
|
||||
{
|
||||
unsigned flags;
|
||||
unsigned method; /* Server Method */
|
||||
unsigned error_method; /* Error Method */
|
||||
int input [2]; /* Pipe client <- server */
|
||||
int output [2]; /* Pipe client -> server */
|
||||
int socket; /* Accepted connection of a socket */
|
||||
int ncpu; /* Number of CPUs, zero if single-processor */
|
||||
int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */
|
||||
unsigned long os_version_code; /* Version code of the operating system */
|
||||
const char *name; /* Program name for error messages */
|
||||
const char *server_command; /* Command used to invoke server */
|
||||
const char *server_host; /* Host the server should run on */
|
||||
const char *server_user; /* Name of the user on the target host */
|
||||
const char *server_rsh; /* Command used to connect to the target host */
|
||||
unsigned long features; /* Server is required for this features */
|
||||
unsigned long server_port; /* Port on which daemon is listening */
|
||||
glibtop_sysdeps sysdeps; /* Detailed feature list */
|
||||
glibtop_sysdeps required; /* Required feature list */
|
||||
pid_t pid; /* PID of the server */
|
||||
};
|
||||
|
||||
#endif /* HAVE_GLIBTOP_MACHINE_H */
|
||||
|
||||
extern glibtop *glibtop_global_server;
|
||||
|
||||
extern const unsigned long glibtop_server_features;
|
||||
#define glibtop_init() glibtop_init__r(&glibtop_global_server);
|
||||
|
||||
glibtop *
|
||||
glibtop_init (void);
|
||||
extern glibtop *glibtop_init__r __P((glibtop **));
|
||||
|
||||
glibtop *
|
||||
glibtop_init_r (glibtop **server_ptr,
|
||||
unsigned long features,
|
||||
unsigned flags);
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
glibtop *
|
||||
glibtop_init_s (glibtop **server_ptr,
|
||||
unsigned long features,
|
||||
unsigned flags);
|
||||
/* You need to link with -lgtop_guile to get this stuff here. */
|
||||
|
||||
G_END_DECLS
|
||||
extern void glibtop_boot_guile __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_GUILE_NAMES
|
||||
|
||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
|
||||
|
||||
extern void glibtop_boot_guile_names __P((void));
|
||||
|
||||
#ifndef GLIBTOP_NAMES
|
||||
#define GLIBTOP_NAMES
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
1
guile/.cvsignore
Normal file
1
guile/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
reference.sgml
|
440
guile/header.scm
Normal file
440
guile/header.scm
Normal file
@@ -0,0 +1,440 @@
|
||||
;; $Id$
|
||||
|
||||
(define cpu-type '(("name" . "cpu")
|
||||
("label" . "CPU Usage")
|
||||
("fields" . (list
|
||||
(("name" . "total")
|
||||
("label" . "Total CPU Usage")
|
||||
("type" . "unsigned long"))
|
||||
(("name" . "user")
|
||||
("type" . "unsigned long"))
|
||||
(("name" . "nice")
|
||||
("type" . "unsigned long"))
|
||||
(("name" . "sys")
|
||||
("type" . "unsigned long"))
|
||||
(("name" . "idle")
|
||||
("type" . "unsigned long"))
|
||||
(("name" . "name")
|
||||
("type" . "const char")
|
||||
("pointer" . #t))
|
||||
(("name" . "test"))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(define main-function
|
||||
(lambda (definition)
|
||||
(letrec ((default-type "unsigned long")
|
||||
(struct-label-comments #t)
|
||||
(struct-name-comments #f)
|
||||
(default-name-tabs-first 3)
|
||||
(default-name-tabs 4)
|
||||
(default-type-tabs 2)
|
||||
(default-comment-tabs 5)
|
||||
(default-definition-tabs 3)
|
||||
(default-definition-value-tabs 2)
|
||||
(default-max-line-length 60)
|
||||
;; set default values for unspecified fields
|
||||
(check-field-definition
|
||||
(lambda (fields)
|
||||
(let ((newlist (list)))
|
||||
(for-each
|
||||
(lambda (field)
|
||||
(if (not (assoc-ref field "type"))
|
||||
(set! field (assoc-set! field "type" default-type)))
|
||||
(if (assoc-ref field "label")
|
||||
(set! field (assoc-set! field "has-label" #t))
|
||||
(begin
|
||||
(set! field (assoc-set! field "label" (assoc-ref field "name")))
|
||||
(set! field (assoc-set! field "has-label" #f))
|
||||
)
|
||||
)
|
||||
(set! newlist (append newlist (list field)))
|
||||
)
|
||||
(cdr fields))
|
||||
(set-cdr! fields newlist)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; number fields sequentially
|
||||
(make-field-numbers
|
||||
(lambda (fields)
|
||||
(let ((pos 0) (newlist (list)))
|
||||
(for-each
|
||||
(lambda (field)
|
||||
(set! field (assoc-set! field "number" pos))
|
||||
(set! newlist (append newlist (list field)))
|
||||
(set! pos (+ pos 1))
|
||||
)
|
||||
(cdr fields))
|
||||
(set-cdr! fields newlist)
|
||||
(set! definition (assoc-set! definition "max-fields" pos))
|
||||
)
|
||||
)
|
||||
)
|
||||
;; pad string with up to 'tabs' tabs
|
||||
(tabify-string
|
||||
(lambda (string tabs)
|
||||
(let ((length (string-length string))
|
||||
(tlength (* tabs 8)))
|
||||
(if (> tlength length)
|
||||
(let* ((diff (- tlength length))
|
||||
(count (quotient (+ diff 7) 8)))
|
||||
(string-append string
|
||||
(make-string count #\tab))
|
||||
)
|
||||
(string-append string
|
||||
#\space)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; pad string with spaces
|
||||
(spacify-string
|
||||
(lambda (string tabs)
|
||||
(let ((length (string-length string))
|
||||
(tlength (* tabs 8)))
|
||||
(if (> tlength length)
|
||||
(string-append string
|
||||
(make-string (- tlength length) #\space))
|
||||
(string-append string
|
||||
#\space)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; creates comment string
|
||||
(make-comment-string
|
||||
(lambda (comment)
|
||||
(if comment
|
||||
(string "/* "
|
||||
(spacify-string comment
|
||||
default-comment-tabs)
|
||||
" */")
|
||||
(string)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; create constant for entry (eg. GLIBTOP_CPU_TOTAL)
|
||||
(entry-constant-name
|
||||
(lambda (name)
|
||||
(string-upcase! (string "GLIBTOP_"
|
||||
(assoc-ref definition "name")
|
||||
"_"
|
||||
name
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; create text that is displayed as comment along with entry
|
||||
(entry-comment-text
|
||||
(lambda (name label)
|
||||
(if label
|
||||
(if struct-label-comments label #f)
|
||||
(if struct-name-comments (entry-constant-name name) #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; starts struct definition
|
||||
(make-struct-definition-head
|
||||
(lambda ()
|
||||
(let* ((class (assoc-ref definition "name"))
|
||||
)
|
||||
(string "struct _glibtop_" class "\n"
|
||||
"{\n"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; terminates struct definition
|
||||
(make-struct-definition-tail
|
||||
(lambda ()
|
||||
(string "};\n\n")
|
||||
)
|
||||
)
|
||||
;; generate struct definition body
|
||||
(make-struct-definition-body
|
||||
(lambda (fields)
|
||||
(letrec ((output (string))
|
||||
(is-first-entry #t)
|
||||
(current-type #f)
|
||||
(current-name #f)
|
||||
(current-label #f)
|
||||
(current-pointer #f)
|
||||
;; close entry (other = next entry is of other type)
|
||||
(entry-end
|
||||
(lambda (other)
|
||||
(let ((old-first is-first-entry))
|
||||
(set! is-first-entry other)
|
||||
(if current-type
|
||||
(string (tabify-string (string (string (if current-pointer "*" ""))
|
||||
current-name
|
||||
(string (if other ";" ","))
|
||||
)
|
||||
(if old-first
|
||||
default-name-tabs-first
|
||||
default-name-tabs
|
||||
)
|
||||
)
|
||||
(make-comment-string (entry-comment-text
|
||||
current-name current-label))
|
||||
"\n")
|
||||
(string)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; start new entry
|
||||
(entry-start
|
||||
(lambda (name type)
|
||||
(if current-type
|
||||
(if (equal? current-type type)
|
||||
(string (entry-end #f) "\t\t")
|
||||
(string (entry-end #t) "\t"
|
||||
(tabify-string type default-type-tabs)
|
||||
)
|
||||
)
|
||||
(string "\t"
|
||||
(tabify-string type default-type-tabs)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; main function
|
||||
(for-each
|
||||
(lambda (field)
|
||||
(let ((name (assoc-ref field "name"))
|
||||
(type (assoc-ref field "type"))
|
||||
(pointer (assoc-ref field "pointer"))
|
||||
(label (if (assoc-ref field "has-label")
|
||||
(assoc-ref field "label")
|
||||
#f)
|
||||
)
|
||||
)
|
||||
(set! output (string-append output
|
||||
(string (entry-start name type))
|
||||
)
|
||||
)
|
||||
;; save current data
|
||||
(set! current-type type)
|
||||
(set! current-name name)
|
||||
(set! current-label label)
|
||||
(set! current-pointer pointer)
|
||||
)
|
||||
)
|
||||
(cdr fields))
|
||||
;; close last entry
|
||||
(string-append output (entry-end #t))
|
||||
)
|
||||
)
|
||||
)
|
||||
;; display complete struct definition
|
||||
(make-struct-definition
|
||||
(lambda (fields)
|
||||
(string-append (make-struct-definition-head)
|
||||
(make-struct-definition-body fields)
|
||||
(make-struct-definition-tail)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; make constant definition
|
||||
(make-const-definition
|
||||
(lambda (name value comment)
|
||||
(let* ((nstring (string-upcase! (string "GLIBTOP_" name)))
|
||||
(tabname (tabify-string nstring default-definition-tabs))
|
||||
(tabvalue (if comment
|
||||
(tabify-string (string value) default-definition-value-tabs)
|
||||
(string value))
|
||||
)
|
||||
(ctext (make-comment-string comment))
|
||||
(line (string "#define " tabname tabvalue ctext "\n"))
|
||||
)
|
||||
line)
|
||||
)
|
||||
)
|
||||
;; creates constant definitions
|
||||
(make-struct-constants
|
||||
(lambda (fields)
|
||||
(let ((class (assoc-ref definition "name"))
|
||||
(output (string))
|
||||
)
|
||||
(for-each
|
||||
(lambda (field)
|
||||
(let* ((name (assoc-ref field "name"))
|
||||
(number (assoc-ref field "number"))
|
||||
(key (string class "_" name))
|
||||
(value (number->string number))
|
||||
(label (if (assoc-ref field "has-label")
|
||||
(assoc-ref field "label")
|
||||
#f)
|
||||
)
|
||||
(line (make-const-definition key
|
||||
value
|
||||
(entry-comment-text name label)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! output (string-append output line))
|
||||
)
|
||||
)
|
||||
(cdr fields))
|
||||
output)
|
||||
)
|
||||
)
|
||||
;; creates definition of maximum constant
|
||||
(make-struct-max-constant
|
||||
(lambda ()
|
||||
(let* ((class (assoc-ref definition "name"))
|
||||
(max (assoc-ref definition "max-fields"))
|
||||
)
|
||||
(make-const-definition (string "MAX_" class)
|
||||
(number->string max)
|
||||
#f)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; adds new list element to string, inserting newline if necessary
|
||||
(add-to-string
|
||||
(lambda (output line element separator indent max-length)
|
||||
(let* ((slen (string-length line))
|
||||
(elen (string-length element))
|
||||
(tlen (+ slen elen))
|
||||
(bsep (if separator
|
||||
(string separator " ")
|
||||
(string)
|
||||
)
|
||||
)
|
||||
(nsep (string (if separator separator "") "\n"))
|
||||
)
|
||||
(if (and (> slen 0) (> tlen max-length))
|
||||
(begin
|
||||
(set! output (string-append output line nsep))
|
||||
(set! line (string indent element))
|
||||
)
|
||||
(set! line (string-append line bsep element))
|
||||
)
|
||||
(list output line)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; create general list definition
|
||||
(make-general-list-definition
|
||||
(lambda (fields name symbol line-length make-element-string)
|
||||
(letrec ((class (assoc-ref definition "name"))
|
||||
(make-general-list-definition-head
|
||||
(lambda ()
|
||||
(string "const char *"
|
||||
"glibtop_"
|
||||
symbol
|
||||
"_"
|
||||
class
|
||||
" "
|
||||
"[GLIBTOP_MAX_"
|
||||
(string-upcase! (string class))
|
||||
"] = \n{ "
|
||||
)
|
||||
)
|
||||
)
|
||||
(make-general-list-definition-tail
|
||||
(lambda ()
|
||||
(string "\n};\n")
|
||||
)
|
||||
)
|
||||
(make-general-list-definition-body
|
||||
(lambda ()
|
||||
(let* ((first #t) (output (string)) (line (string)))
|
||||
(for-each
|
||||
(lambda (field)
|
||||
(let* ((element (assoc-ref field name))
|
||||
(olist (add-to-string output line
|
||||
(make-element-string element)
|
||||
(if first #f ",")
|
||||
" "
|
||||
line-length))
|
||||
)
|
||||
(set! output (car olist))
|
||||
(set! line (car (cdr olist)))
|
||||
(set! first #f)
|
||||
)
|
||||
)
|
||||
(cdr fields))
|
||||
(set! output (string-append output line))
|
||||
output)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; main function
|
||||
(string-append (make-general-list-definition-head)
|
||||
(make-general-list-definition-body)
|
||||
(make-general-list-definition-tail)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; create name list definition
|
||||
(make-name-list-definition
|
||||
(lambda (fields)
|
||||
(make-general-list-definition fields
|
||||
"name"
|
||||
"names"
|
||||
default-max-line-length
|
||||
(lambda (x)
|
||||
(string #\" x #\")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; create label list definition
|
||||
(make-label-list-definition
|
||||
(lambda (fields)
|
||||
(make-general-list-definition fields
|
||||
"label"
|
||||
"labels"
|
||||
0
|
||||
(lambda (x)
|
||||
(string "gettext_noop (" #\" x #\" ")")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; create description list definition
|
||||
(make-description-list-definition
|
||||
(lambda (fields)
|
||||
(make-general-list-definition fields
|
||||
"description"
|
||||
"descriptions"
|
||||
default-max-line-length
|
||||
(lambda (x)
|
||||
(if x
|
||||
(string "gettext_noop (" #\" x #\" ")")
|
||||
(string "NULL")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; start of main function
|
||||
(let ((fielddef (assoc-ref definition "fields")))
|
||||
(display fielddef) (newline) (newline)
|
||||
(check-field-definition fielddef)
|
||||
(make-field-numbers fielddef)
|
||||
(display fielddef) (newline) (newline)
|
||||
(display (make-struct-definition fielddef))
|
||||
(display (make-struct-constants fielddef)) (newline)
|
||||
(display (make-struct-max-constant)) (newline) (newline)
|
||||
(display (make-name-list-definition fielddef)) (newline)
|
||||
(display (make-label-list-definition fielddef)) (newline)
|
||||
(display (make-description-list-definition fielddef)) (newline)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(begin
|
||||
(main-function cpu-type)
|
||||
(newline)
|
||||
)
|
||||
|
311
guile/make-docbook.scm
Normal file
311
guile/make-docbook.scm
Normal file
@@ -0,0 +1,311 @@
|
||||
;; $Id$
|
||||
|
||||
(define sysdeps-list '())
|
||||
|
||||
(define make-sysdeps-list
|
||||
(lambda ()
|
||||
(letrec ((names (glibtop-names-sysdeps))
|
||||
(labels (glibtop-labels-sysdeps))
|
||||
(descriptions (glibtop-descriptions-sysdeps))
|
||||
)
|
||||
(for-each (lambda (feature)
|
||||
(let* ((label (car labels))
|
||||
(description (car descriptions))
|
||||
(list '())
|
||||
)
|
||||
(set! labels (cdr labels))
|
||||
(set! descriptions (cdr descriptions))
|
||||
(set! list (assoc-set! list 'name feature))
|
||||
(set! list (assoc-set! list 'label label))
|
||||
(set! list (assoc-set! list 'description description))
|
||||
(set! sysdeps-list (assoc-set! sysdeps-list feature list))
|
||||
)
|
||||
)
|
||||
names)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(define make-function-reference
|
||||
(lambda (feature)
|
||||
(let* ((names (eval-string (string "(glibtop-names-" feature ")")))
|
||||
(types (eval-string (string "(glibtop-types-" feature ")")))
|
||||
(labels (eval-string (string "(glibtop-labels-" feature ")")))
|
||||
(sysdeps (assoc-ref sysdeps-list feature)) (retval "void")
|
||||
(name (assoc-ref sysdeps 'name))
|
||||
(label (assoc-ref sysdeps 'label))
|
||||
(description (assoc-ref sysdeps 'description))
|
||||
(descriptions (eval-string (string "(glibtop-descriptions-" feature ")")))
|
||||
(decl-list '()) (field-list '())
|
||||
|
||||
(synopsis-start-string
|
||||
(string "<para>Automatically generated function synopsis:\n\n"))
|
||||
|
||||
(section-string
|
||||
(string "<sect1>\n"
|
||||
"<title><function>glibtop_get_" feature "()</function> - "
|
||||
label "</title>\n\n")
|
||||
)
|
||||
|
||||
(description-string
|
||||
(string "<para>\nAutomatically generated description:\n\n"
|
||||
"<blockquote>\n<literallayout>\n"
|
||||
description "\n"
|
||||
"</literallayout>\n</blockquote>\n\n")
|
||||
)
|
||||
|
||||
(definition-start-string
|
||||
(string "<para>Automatically generated declaration of "
|
||||
"<structname>_glibtop_" feature "</structname>:\n\n")
|
||||
)
|
||||
|
||||
(param-description-start-string
|
||||
(string "<para>Automatically generated descriptions of "
|
||||
"<structname>_glibtop_" feature "</structname>:\n\n")
|
||||
)
|
||||
|
||||
(funcsynopsisinfo-string
|
||||
(string "<funcsynopsisinfo>\n"
|
||||
"#include <glibtop.h>\n"
|
||||
"#include <glibtop/" feature ".h>"
|
||||
"</funcsynopsisinfo>")
|
||||
)
|
||||
|
||||
(funcdef-string
|
||||
(string "<funcdef>" retval " "
|
||||
"<function>glibtop_get_" feature "__r</function>"
|
||||
"</funcdef>\n")
|
||||
)
|
||||
|
||||
(paramdef-string
|
||||
(string "<paramdef>glibtop *<parameter>server</parameter>, "
|
||||
"glibtop_" feature " *<parameter>" feature "</parameter>\n"
|
||||
"</paramdef>")
|
||||
)
|
||||
|
||||
(funcdef-noserver-string
|
||||
(string "<funcdef>" retval " "
|
||||
"<function>glibtop_get_" feature "</function>"
|
||||
"</funcdef>\n")
|
||||
)
|
||||
|
||||
(paramdef-noserver-string
|
||||
(string "<paramdef>glibtop_" feature " *"
|
||||
"<parameter>" feature "</parameter>\n"
|
||||
"</paramdef>")
|
||||
)
|
||||
|
||||
(field-name-constant
|
||||
(lambda (name field)
|
||||
(string "GLIBTOP_"
|
||||
(string-upcase! (string name))
|
||||
"_"
|
||||
(string-upcase! (string field)))
|
||||
)
|
||||
)
|
||||
|
||||
(make-struct-name
|
||||
(lambda (type)
|
||||
(string "glibtop_" (assoc-ref type "name"))
|
||||
)
|
||||
)
|
||||
|
||||
(tab-pad-string
|
||||
(lambda (string tabs)
|
||||
(let* ((slength (string-length string))
|
||||
(tlength (* tabs 8)))
|
||||
(string-append string
|
||||
(make-string
|
||||
(if (> tlength slength)
|
||||
(- tlength slength)
|
||||
1
|
||||
)
|
||||
#\space))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(make-field-list
|
||||
(lambda (name type fields)
|
||||
(let* ((output (string)) (pos 1))
|
||||
(map
|
||||
(lambda (x)
|
||||
(let* ((sep (if (= pos (length fields)) ";" ","))
|
||||
(start (if (= pos 1)
|
||||
(string "\t"
|
||||
(tab-pad-string (string type) 2))
|
||||
(string "\t\t"))
|
||||
)
|
||||
(comment (string (if (= pos 1) "" "\t") "/* "
|
||||
(tab-pad-string
|
||||
(field-name-constant name (car x)) 4)
|
||||
" */"))
|
||||
(field (tab-pad-string
|
||||
(string-append (string (car x)) sep) 2))
|
||||
)
|
||||
(set! pos (+ pos 1))
|
||||
(string-append start field comment "\n")
|
||||
)
|
||||
)
|
||||
fields)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(init-field-list
|
||||
(lambda ()
|
||||
(let* ((old-type #f)
|
||||
(type-list types)
|
||||
(new-type #f)
|
||||
(fields (list))
|
||||
)
|
||||
(for-each
|
||||
(lambda (x)
|
||||
(set! new-type (car type-list))
|
||||
(set! type-list (cdr type-list))
|
||||
(if (equal? old-type new-type)
|
||||
(set-car! fields
|
||||
(append (list new-type)
|
||||
(cdr (car fields))
|
||||
(list (list x))
|
||||
)
|
||||
)
|
||||
(if (equal? old-type #f)
|
||||
(set! fields (list (list new-type (list x))))
|
||||
(set! fields (append (list (list new-type (list x))) fields))
|
||||
)
|
||||
)
|
||||
(set! old-type new-type)
|
||||
)
|
||||
names)
|
||||
fields)
|
||||
)
|
||||
)
|
||||
|
||||
(make-struct-body
|
||||
(lambda (type)
|
||||
(let* ((name (assoc-ref type "name"))
|
||||
(data (assoc-ref type "fields"))
|
||||
(output (string))
|
||||
)
|
||||
(for-each
|
||||
(lambda (y)
|
||||
(for-each
|
||||
(lambda (z)
|
||||
(set! output (string-append output z))
|
||||
)
|
||||
y)
|
||||
)
|
||||
(map
|
||||
(lambda (x) (make-field-list name (car x) (cdr x)))
|
||||
data)
|
||||
)
|
||||
output)
|
||||
)
|
||||
)
|
||||
|
||||
(make-struct
|
||||
(lambda (type)
|
||||
(let* ((name (assoc-ref type "name"))
|
||||
(data (assoc-ref type "fields"))
|
||||
(output (string-append
|
||||
(tab-pad-string
|
||||
(string "typedef struct _glibtop_" name)
|
||||
5)
|
||||
(string "glibtop_" name ";\n\n"
|
||||
"struct glibtop_" name "\n{\n\t"
|
||||
"unsigned long\tflags;\n")
|
||||
)
|
||||
)
|
||||
)
|
||||
(string-append output (make-struct-body type) "};\n")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(make-param-description
|
||||
(lambda ()
|
||||
(let* ((label-list labels)
|
||||
(description-list descriptions)
|
||||
(output (string))
|
||||
)
|
||||
(for-each
|
||||
(lambda (name)
|
||||
(let* ((label (car label-list))
|
||||
(description (car description-list))
|
||||
)
|
||||
(set! label-list (cdr label-list))
|
||||
(set! description-list (cdr description-list))
|
||||
(set! output
|
||||
(string-append output
|
||||
(string "<varlistentry>\n"
|
||||
"<term><parameter>"
|
||||
name
|
||||
"</parameter></term>\n\n"
|
||||
"<listitem>\n<para>\n"
|
||||
description "\n\n")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
names)
|
||||
output)
|
||||
)
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
(set! decl-list (assoc-set! decl-list "name" name))
|
||||
(set! decl-list (assoc-set! decl-list "label" label))
|
||||
(set! decl-list (assoc-set! decl-list "fields" (init-field-list)))
|
||||
|
||||
(string-append section-string
|
||||
description-string
|
||||
synopsis-start-string
|
||||
(string "<blockquote>\n<funcsynopsis>\n")
|
||||
funcsynopsisinfo-string
|
||||
funcdef-noserver-string
|
||||
paramdef-noserver-string
|
||||
(string "</funcsynopsis>\n")
|
||||
(string "<funcsynopsis>\n")
|
||||
funcdef-string
|
||||
paramdef-string
|
||||
(string "</funcsynopsis>\n</blockquote>\n")
|
||||
definition-start-string
|
||||
(string "<blockquote>\n<literallayout>\n")
|
||||
(make-struct decl-list)
|
||||
(string "</literallayout>\n</blockquote>\n")
|
||||
param-description-start-string
|
||||
"<variablelist>\n\n"
|
||||
(make-param-description)
|
||||
"</variablelist>\n\n"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; <sect2 id="glibtop-get-cpu">
|
||||
;; <title><function>glibtop_get_cpu()</function> - get CPU usage</title>
|
||||
;;
|
||||
;; <funcsynopsis>
|
||||
;; <funcsynopsisinfo>
|
||||
;; #include <glibtop.h>
|
||||
;; #include <glibtop/cpu.h></funcsynopsisinfo>
|
||||
;; <funcdef>void <function>glibtop_get_cpu</function></funcdef>
|
||||
;; <paramdef>glibtop *<parameter>server</parameter>, glibtop_cpu *<parameter>cpu_usage</parameter>
|
||||
;; </paramdef></funcsynopsis>
|
||||
|
||||
|
||||
|
||||
(begin
|
||||
(make-sysdeps-list)
|
||||
|
||||
(display (string "<chapter id=\"functions\">\n"
|
||||
"<title>Function Reference List</title>\n\n")
|
||||
)
|
||||
|
||||
(for-each (lambda (x)
|
||||
(display (make-function-reference x))
|
||||
)
|
||||
(glibtop-names-sysdeps))
|
||||
)
|
195
guile/make-header.scm
Normal file
195
guile/make-header.scm
Normal file
@@ -0,0 +1,195 @@
|
||||
(define cpu-type '(("name" . "cpu")
|
||||
("label" . "CPU Usage")
|
||||
("fields" . (("unsigned long" ("total" "Total CPU Usage")
|
||||
("user") ("nice") ("sys") ("idle"))
|
||||
("const char" ("name"))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; computes constant for struct field (eg. GLIBTOP_CPU_TOTAL)
|
||||
|
||||
(define field-name-constant
|
||||
(lambda (name field)
|
||||
(string "GLIBTOP_"
|
||||
(string-upcase! (string name))
|
||||
"_"
|
||||
(string-upcase! (string field)))
|
||||
)
|
||||
)
|
||||
|
||||
;; computes structure name (eg. glibtop_cpu)
|
||||
|
||||
(define make-struct-name
|
||||
(lambda (type)
|
||||
(string "glibtop_" (assoc-ref type "name"))
|
||||
)
|
||||
)
|
||||
|
||||
(define tab-pad-string
|
||||
(lambda (string tabs)
|
||||
(string-append string (make-string (- (* tabs 8) (string-length string)) #\space))
|
||||
)
|
||||
)
|
||||
|
||||
(define make-field-list
|
||||
(lambda (name type fields)
|
||||
(let* ((output (string)) (pos 1))
|
||||
(map
|
||||
(lambda (x)
|
||||
(let* ((sep (if (= pos (length fields)) ";" ","))
|
||||
(start (if (= pos 1)
|
||||
(string "\t"
|
||||
(tab-pad-string (string type) 2))
|
||||
(string "\t\t"))
|
||||
)
|
||||
(comment (string (if (= pos 1) "" "\t") "/* "
|
||||
(tab-pad-string (field-name-constant name (car x)) 3)
|
||||
" */"))
|
||||
(field (tab-pad-string (string-append (string (car x)) sep) 2))
|
||||
)
|
||||
(set! pos (+ pos 1))
|
||||
(string-append start field comment "\n")
|
||||
)
|
||||
)
|
||||
fields)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(define make-struct-body
|
||||
(lambda (type)
|
||||
(let* ((name (assoc-ref type "name"))
|
||||
(data (assoc-ref type "fields"))
|
||||
(output (string))
|
||||
)
|
||||
(for-each
|
||||
(lambda (y)
|
||||
(for-each
|
||||
(lambda (z)
|
||||
(set! output (string-append output z))
|
||||
)
|
||||
y)
|
||||
)
|
||||
(map
|
||||
(lambda (x) (make-field-list name (car x) (cdr x)))
|
||||
data)
|
||||
)
|
||||
output)
|
||||
)
|
||||
)
|
||||
|
||||
(define make-struct
|
||||
(lambda (type)
|
||||
(let* ((name (assoc-ref type "name"))
|
||||
(data (assoc-ref type "fields"))
|
||||
(output (string-append
|
||||
(tab-pad-string
|
||||
(string "typedef struct _glibtop_" name)
|
||||
5)
|
||||
(string "glibtop_" name ";\n\n"
|
||||
"struct glibtop_" name "\n{\n\t"
|
||||
"unsigned long\tflags;\n")
|
||||
)
|
||||
)
|
||||
)
|
||||
(string-append output (make-struct-body type) "};\n")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(define make-field-name-list
|
||||
(lambda (type)
|
||||
(let* ((name (assoc-ref type "name"))
|
||||
(data (assoc-ref type "fields"))
|
||||
(return (list))
|
||||
)
|
||||
(map
|
||||
(lambda (x)
|
||||
(map
|
||||
(lambda (y) (set! return (append return (list (car y)))))
|
||||
(cdr x)
|
||||
)
|
||||
)
|
||||
data)
|
||||
return)
|
||||
)
|
||||
)
|
||||
|
||||
(define make-field-constants
|
||||
(lambda (type)
|
||||
(let* ((name (assoc-ref type "name"))
|
||||
(data (make-field-name-list type))
|
||||
(output (string
|
||||
(tab-pad-string
|
||||
(string "#define GLIBTOP_MAX_"
|
||||
(string-upcase! (string name))
|
||||
) 5)
|
||||
(number->string (length data))
|
||||
"\n\n"
|
||||
)
|
||||
)
|
||||
(pos 0)
|
||||
)
|
||||
(for-each
|
||||
(lambda (x)
|
||||
(set! output (string-append output (string
|
||||
(tab-pad-string
|
||||
(string "#define GLIBTOP_"
|
||||
(string-upcase! (string name))
|
||||
"_"
|
||||
(string-upcase! (string x))
|
||||
) 5)
|
||||
(number->string pos)
|
||||
"\n"
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! pos (+ pos 1))
|
||||
)
|
||||
data)
|
||||
output)
|
||||
)
|
||||
)
|
||||
|
||||
(define make-extern-defs
|
||||
(lambda (type)
|
||||
(let* ((name (assoc-ref type "name"))
|
||||
)
|
||||
(string
|
||||
(tab-pad-string (string "extern void glibtop_get_" name) 6)
|
||||
"__P(glibtop *, glibtop_" name " *);\n\n"
|
||||
"#ifdef HAVE_GUILE\n\n"
|
||||
"/* You need to link with -lgtop_guile to get this stuff here. */\n\n"
|
||||
(tab-pad-string (string "extern SCM glibtop_get_" name) 6)
|
||||
"__P(void);\n\n"
|
||||
"#endif /* HAVE_GUILE */\n\n"
|
||||
"#ifdef GLIBTOP_GUILE_NAMES\n\n"
|
||||
"/* You need to link with -lgtop_guile_names to get this stuff here. */\n\n"
|
||||
(tab-pad-string (string "extern SCM glibtop_guile_names_" name) 6)
|
||||
"__P(void);\n"
|
||||
(tab-pad-string (string "extern SCM glibtop_guile_labels_" name) 6)
|
||||
"__P(void);\n"
|
||||
(tab-pad-string (string "extern SCM glibtop_guile_descriptions_" name) 6)
|
||||
"__P(void);\n\n"
|
||||
"#endif /* GLIBTOP_GUILE_NAMES */\n\n"
|
||||
"#ifdef GLIBTOP_NAMES\n\n"
|
||||
"/* You need to link with -lgtop_names to get this stuff here. */\n\n"
|
||||
(tab-pad-string (string "extern const char *glibtop_names_" name) 6)
|
||||
"[];\n"
|
||||
(tab-pad-string (string "extern const char *glibtop_labels_" name) 6)
|
||||
"[];\n"
|
||||
(tab-pad-string (string "extern const char *glibtop_descriptions_" name) 6)
|
||||
"[];\n\n"
|
||||
"#endif /* GLIBTOP_NAMES */\n\n")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(begin
|
||||
(display (make-field-constants cpu-type)) (newline)
|
||||
(display (make-struct cpu-type)) (newline)
|
||||
(display (make-extern-defs cpu-type)) (newline)
|
||||
)
|
||||
|
2
include/.cvsignore
Normal file
2
include/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
2
include/glibtop/.cvsignore
Normal file
2
include/glibtop/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
@@ -1,14 +1,8 @@
|
||||
glibtopdir = $(includedir)/libgtop-2.0/glibtop
|
||||
glibtopdir = $(includedir)/glibtop
|
||||
|
||||
glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
|
||||
sem_limits.h uptime.h command.h mem.h proclist.h \
|
||||
proctime.h shm_limits.h version.h cpu.h msg_limits.h \
|
||||
procmem.h procuid.h swap.h \
|
||||
procsegment.h sysdeps.h global.h \
|
||||
procsignal.h union.h gnuserv.h \
|
||||
parameter.h mountlist.h fsusage.h procmap.h signal.h \
|
||||
sysinfo.h ppp.h procargs.h netload.h \
|
||||
procwd.h \
|
||||
netlist.h procopenfiles.h open.h
|
||||
|
||||
noinst_HEADERS = error.h write.h read_data.h read.h init_hooks.h
|
||||
procmem.h procuid.h swap.h write.h error.h open.h \
|
||||
procsegment.h read.h sysdeps.h xmalloc.h global.h \
|
||||
output.h procsignal.h read_data.h union.h
|
||||
|
@@ -1,41 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||
|
||||
@@AUTOGEN_COMMENT@@
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GLIBTOP_CALL_VECTOR_H__
|
||||
#define __GLIBTOP_CALL_VECTOR_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/union.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
struct _glibtop_call_vector
|
||||
{
|
||||
@@GLIBTOP_CALL_VECTOR@@
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
@@ -1,116 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
require 'c_types.pl';
|
||||
|
||||
die "Usage: $0 features.def call-vector.h.in" unless $#ARGV == 1;
|
||||
|
||||
$[ = 1; # set array base to 1
|
||||
$, = ' '; # set output field separator
|
||||
$\ = "\n"; # set output record separator
|
||||
|
||||
sub toupper {
|
||||
local($_) = @_;
|
||||
tr/a-z/A-Z/;
|
||||
return $_;
|
||||
}
|
||||
|
||||
sub tolower {
|
||||
local($_) = @_;
|
||||
tr/A-Z/a-z/;
|
||||
return $_;
|
||||
}
|
||||
|
||||
$func_decl_code = '';
|
||||
|
||||
open FEATURESDEF, $ARGV[1] or
|
||||
die "open ($ARGV[1]): $!";
|
||||
|
||||
while (<FEATURESDEF>) {
|
||||
chop; # strip record separator
|
||||
|
||||
if (/^[^\#]/) {
|
||||
&parse_features_def ($_);
|
||||
}
|
||||
}
|
||||
|
||||
close FEATURESDEF;
|
||||
|
||||
sub parse_features_def {
|
||||
local($line) = @_;
|
||||
@line_fields = split(/\|/, $line, 9999);
|
||||
$retval = $line_fields[1];
|
||||
$element_def = $line_fields[3];
|
||||
$feature = $line_fields[2];
|
||||
$param_def = $line_fields[4];
|
||||
|
||||
$orig = $feature;
|
||||
$feature =~ s/^@//;
|
||||
$space = $feature;
|
||||
$space =~ s/./ /g;
|
||||
|
||||
if ($retval eq 'retval') {
|
||||
$retval_param = '&retval';
|
||||
$retval = 'int';
|
||||
}
|
||||
elsif ($retval !~ /^void$/) {
|
||||
$retval_param = 'NULL';
|
||||
}
|
||||
else {
|
||||
$retval_param = 'NULL';
|
||||
}
|
||||
|
||||
if ($retval =~ /^(array|pointer)\((.*)\)$/) {
|
||||
$retval = ($2 eq 'string') ? 'char **' : "$2 *";
|
||||
}
|
||||
|
||||
$param_decl = '';
|
||||
$nr_params = (@params = split(/:/, $param_def, 9999));
|
||||
for ($param = 1; $param <= $nr_params; $param++) {
|
||||
$list = $params[$param];
|
||||
$type = $params[$param];
|
||||
$type =~ s/\(.*//;
|
||||
$list =~ s/^.*\(//;
|
||||
$list =~ s/\)$//;
|
||||
$count = (@fields = split(/,/, $list, 9999));
|
||||
for ($field = 1; $field <= $count; $field++) {
|
||||
my $c_type = $typeinfo->{$type}->[1];
|
||||
|
||||
$param_decl = $param_decl . ', ';
|
||||
$param_decl = $param_decl . $c_type;
|
||||
}
|
||||
}
|
||||
|
||||
if ($line_fields[3] eq '') {
|
||||
$func_decl_code .= sprintf
|
||||
(qq[\t%s (*%s) (glibtop_server *, glibtop_closure *%s);\n], $retval, $feature, $param_decl);
|
||||
} elsif ($line_fields[3] eq 'array') {
|
||||
$func_decl_code .= sprintf
|
||||
(qq[\t%s (*%s) (glibtop_server *, glibtop_closure *, glibtop_array *%s);\n], $retval, $feature, $param_decl);
|
||||
} elsif ($line_fields[3] =~ /^array/) {
|
||||
$func_decl_code .= sprintf
|
||||
(qq[\t%s (*%s) (glibtop_server *, glibtop_closure *, glibtop_array *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
|
||||
} else {
|
||||
$func_decl_code .= sprintf
|
||||
(qq[\t%s (*%s) (glibtop_server *, glibtop_closure *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
|
||||
}
|
||||
}
|
||||
|
||||
chop $func_decl_code;
|
||||
|
||||
$auto_gen_comment = sprintf
|
||||
(qq[/*\n * This file is automatically generated.\n * Please modify `call-vector.pl' and `call-vector.h.in'.\n */]);
|
||||
|
||||
open CALLVECTOR, $ARGV[2] or
|
||||
die "open ($ARGV[2]): $!";
|
||||
|
||||
while (<CALLVECTOR>) {
|
||||
chop;
|
||||
|
||||
s/^\s*\@\@GLIBTOP_CALL_VECTOR\@\@\s*$/$func_decl_code/;
|
||||
|
||||
s/^\s*\@\@AUTOGEN_COMMENT\@\@\s*$/$auto_gen_comment/;
|
||||
} continue {
|
||||
print $_;
|
||||
}
|
||||
|
||||
close CALLVECTOR;
|
@@ -1,38 +1,33 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
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_CLOSE_H__
|
||||
#define __GLIBTOP_CLOSE_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
__BEGIN_DECLS
|
||||
|
||||
void glibtop_close (void);
|
||||
extern void glibtop_close __P((glibtop *));
|
||||
|
||||
void glibtop_close_r (glibtop *server);
|
||||
|
||||
void glibtop_close_s (glibtop *server);
|
||||
void glibtop_close_p (glibtop *server);
|
||||
|
||||
G_END_DECLS
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
@@ -1,36 +1,34 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
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_COMMAND_H__
|
||||
#define __GLIBTOP_COMMAND_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
#include <glibtop/union.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define GLIBTOP_CMND_QUIT 0
|
||||
#define GLIBTOP_CMND_SYSDEPS 1
|
||||
|
||||
#define GLIBTOP_CMND_CPU 2
|
||||
#define GLIBTOP_CMND_MEM 3
|
||||
#define GLIBTOP_CMND_SWAP 4
|
||||
@@ -48,56 +46,22 @@ G_BEGIN_DECLS
|
||||
#define GLIBTOP_CMND_PROC_SIGNAL 15
|
||||
#define GLIBTOP_CMND_PROC_KERNEL 16
|
||||
#define GLIBTOP_CMND_PROC_SEGMENT 17
|
||||
#define GLIBTOP_CMND_PROC_ARGS 18
|
||||
#define GLIBTOP_CMND_PROC_MAP 19
|
||||
|
||||
#define GLIBTOP_CMND_MOUNTLIST 20
|
||||
#define GLIBTOP_CMND_FSUSAGE 21
|
||||
#define GLIBTOP_CMND_NETLOAD 22
|
||||
#define GLIBTOP_CMND_PPP 23
|
||||
#define GLIBTOP_CMND_NETLIST 24
|
||||
#define GLIBTOP_CMND_PROC_OPEN_FILES 25
|
||||
#define GLIBTOP_CMND_PROC_WD 26
|
||||
|
||||
#define GLIBTOP_MAX_CMND 27
|
||||
|
||||
#define _GLIBTOP_PARAM_SIZE 16
|
||||
#define GLIBTOP_MAX_CMND 18
|
||||
|
||||
typedef struct _glibtop_command glibtop_command;
|
||||
|
||||
typedef struct _glibtop_response glibtop_response;
|
||||
typedef union _glibtop_response_union glibtop_response_union;
|
||||
|
||||
struct _glibtop_command
|
||||
{
|
||||
guint64 command;
|
||||
guint64 size, data_size;
|
||||
char parameter [_GLIBTOP_PARAM_SIZE];
|
||||
glibtop server;
|
||||
unsigned command;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
union _glibtop_response_union
|
||||
{
|
||||
glibtop_union data;
|
||||
glibtop_sysdeps sysdeps;
|
||||
};
|
||||
#define glibtop_call(p1, p2, p3, p4) glibtop_call__r(glibtop_global_server, p1, p2, p3, p4)
|
||||
|
||||
struct _glibtop_response
|
||||
{
|
||||
gint64 offset;
|
||||
guint64 size, data_size;
|
||||
glibtop_response_union u;
|
||||
};
|
||||
extern void *glibtop_call__r __P((glibtop *, unsigned, size_t, void *, size_t, void *));
|
||||
|
||||
#define glibtop_call(p1, p2, p3, p4) glibtop_call_r(glibtop_global_server, p1, p2, p3, p4)
|
||||
|
||||
void *
|
||||
glibtop_call_l (glibtop *server, unsigned command, size_t send_size,
|
||||
const void *send_buf, size_t recv_size, void *recv_buf);
|
||||
|
||||
void *
|
||||
glibtop_call_s (glibtop *server, unsigned command, size_t send_size,
|
||||
const void *send_buf, size_t recv_size, void *recv_buf);
|
||||
|
||||
G_END_DECLS
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
@@ -1,23 +1,23 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
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_CPU_H__
|
||||
#define __GLIBTOP_CPU_H__
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/global.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define GLIBTOP_CPU_TOTAL 0
|
||||
#define GLIBTOP_CPU_USER 1
|
||||
@@ -34,72 +34,55 @@ G_BEGIN_DECLS
|
||||
#define GLIBTOP_CPU_IDLE 4
|
||||
#define GLIBTOP_CPU_FREQUENCY 5
|
||||
|
||||
#define GLIBTOP_XCPU_TOTAL 6
|
||||
#define GLIBTOP_XCPU_USER 7
|
||||
#define GLIBTOP_XCPU_NICE 8
|
||||
#define GLIBTOP_XCPU_SYS 9
|
||||
#define GLIBTOP_XCPU_IDLE 10
|
||||
#define GLIBTOP_XCPU_FLAGS 11
|
||||
|
||||
#define GLIBTOP_CPU_IOWAIT 12
|
||||
#define GLIBTOP_CPU_IRQ 13
|
||||
#define GLIBTOP_CPU_SOFTIRQ 14
|
||||
#define GLIBTOP_XCPU_IOWAIT 15
|
||||
#define GLIBTOP_XCPU_IRQ 16
|
||||
#define GLIBTOP_XCPU_SOFTIRQ 17
|
||||
|
||||
#define GLIBTOP_MAX_CPU 18
|
||||
|
||||
/* Nobody should really be using more than 4 processors.
|
||||
Yes we are :)
|
||||
Nobody should really be using more than 32 processors.
|
||||
*/
|
||||
#define GLIBTOP_NCPU 32
|
||||
#define GLIBTOP_MAX_CPU 6
|
||||
|
||||
typedef struct _glibtop_cpu glibtop_cpu;
|
||||
|
||||
struct _glibtop_cpu
|
||||
{
|
||||
guint64 flags;
|
||||
guint64 total; /* GLIBTOP_CPU_TOTAL */
|
||||
guint64 user; /* GLIBTOP_CPU_USER */
|
||||
guint64 nice; /* GLIBTOP_CPU_NICE */
|
||||
guint64 sys; /* GLIBTOP_CPU_SYS */
|
||||
guint64 idle; /* GLIBTOP_CPU_IDLE */
|
||||
guint64 iowait; /* GLIBTOP_CPU_IOWAIT */
|
||||
guint64 irq; /* GLIBTOP_CPU_IRQ */
|
||||
guint64 softirq; /* GLIBTOP_CPU_SOFTIRQ */
|
||||
guint64 frequency; /* GLIBTOP_CPU_FREQUENCY */
|
||||
guint64 xcpu_total [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_TOTAL */
|
||||
guint64 xcpu_user [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_USER */
|
||||
guint64 xcpu_nice [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_NICE */
|
||||
guint64 xcpu_sys [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_SYS */
|
||||
guint64 xcpu_idle [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_IDLE */
|
||||
guint64 xcpu_iowait [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_IOWAIT */
|
||||
guint64 xcpu_irq [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_IRQ */
|
||||
guint64 xcpu_softirq [GLIBTOP_NCPU]; /* GLIBTOP_XCPU_SOFTIRQ */
|
||||
guint64 xcpu_flags; /* GLIBTOP_XCPU_IDLE */
|
||||
unsigned long flags,
|
||||
total, /* GLIBTOP_CPU_TOTAL */
|
||||
user, /* GLIBTOP_CPU_USER */
|
||||
nice, /* GLIBTOP_CPU_NICE */
|
||||
sys, /* GLIBTOP_CPU_SYS */
|
||||
idle, /* GLIBTOP_CPU_IDLE */
|
||||
frequency; /* GLIBTOP_CPU_FREQUENCY */
|
||||
};
|
||||
|
||||
void glibtop_get_cpu(glibtop_cpu *buf);
|
||||
#define glibtop_get_cpu(cpu) glibtop_get_cpu__r(glibtop_global_server, cpu)
|
||||
|
||||
#if GLIBTOP_SUID_CPU
|
||||
#define glibtop_get_cpu_r glibtop_get_cpu_p
|
||||
#else
|
||||
#define glibtop_get_cpu_r glibtop_get_cpu_s
|
||||
#endif
|
||||
extern void glibtop_get_cpu__r __P((glibtop *, glibtop_cpu *));
|
||||
|
||||
void glibtop_get_cpu_l (glibtop *server, glibtop_cpu *buf);
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
#if GLIBTOP_SUID_CPU
|
||||
void _glibtop_init_cpu_p (glibtop *server);
|
||||
void glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf);
|
||||
#else
|
||||
void _glibtop_init_cpu_s (glibtop *server);
|
||||
void glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf);
|
||||
#endif
|
||||
/* You need to link with -lgtop_guile to get this stuff here. */
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
extern SCM glibtop_guile_get_cpu __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_GUILE_NAMES
|
||||
|
||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
|
||||
|
||||
extern SCM glibtop_guile_names_cpu __P((void));
|
||||
extern SCM glibtop_guile_types_cpu __P((void));
|
||||
extern SCM glibtop_guile_labels_cpu __P((void));
|
||||
extern SCM glibtop_guile_descriptions_cpu __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_cpu [];
|
||||
extern const char *glibtop_types_cpu [];
|
||||
extern const char *glibtop_labels_cpu [];
|
||||
extern const char *glibtop_descriptions_cpu [];
|
||||
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
@@ -1,51 +1,35 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* This is private API
|
||||
*/
|
||||
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_ERROR_H__
|
||||
#define __GLIBTOP_ERROR_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
__BEGIN_DECLS
|
||||
|
||||
void glibtop_error_vr (glibtop *server, const char *format, va_list args) G_GNUC_NORETURN;
|
||||
void glibtop_warn_vr (glibtop *server, const char *format, va_list args);
|
||||
void glibtop_error_io_vr (glibtop *server, const char *format, int, va_list args) G_GNUC_NORETURN;
|
||||
void glibtop_warn_io_vr (glibtop *server, const char *format, int, va_list args);
|
||||
#define glibtop_error(p1, args...) glibtop_error__r(glibtop_global_server , p1 , ## args)
|
||||
|
||||
void glibtop_error_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN;
|
||||
void glibtop_warn_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
void glibtop_error_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN;
|
||||
void glibtop_warn_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
extern void glibtop_error__r __P((glibtop *, char *, ...));
|
||||
|
||||
void glibtop_error (const char *format, ...) G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN;
|
||||
void glibtop_warn (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
void glibtop_error_io (const char *format, ...) G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN;
|
||||
void glibtop_warn_io (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
|
||||
G_END_DECLS
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
@@ -1,64 +0,0 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifndef __GLIBTOP_FSUSAGE_H__
|
||||
#define __GLIBTOP_FSUSAGE_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/global.h>
|
||||
|
||||
G_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_FSUSAGE_BLOCK_SIZE 5
|
||||
#define GLIBTOP_FSUSAGE_READ 6
|
||||
#define GLIBTOP_FSUSAGE_WRITE 7
|
||||
#define GLIBTOP_MAX_FSUSAGE 8
|
||||
|
||||
|
||||
typedef struct _glibtop_fsusage glibtop_fsusage;
|
||||
|
||||
struct _glibtop_fsusage
|
||||
{
|
||||
guint64 flags;
|
||||
guint64 blocks; /* Total number of blocks. */
|
||||
guint64 bfree; /* Free blocks available to superuser. */
|
||||
guint64 bavail; /* Free blocks available to non-superuser. */
|
||||
guint64 files; /* Total file nodes. */
|
||||
guint64 ffree; /* Free file nodes. */
|
||||
guint32 block_size; /* Size of a block in bytes. */
|
||||
guint64 read, write; /* Total blocks read and written */
|
||||
};
|
||||
|
||||
void glibtop_get_fsusage(glibtop_fsusage *buf, const char *mount_dir);
|
||||
|
||||
#define glibtop_get_fsusage_r glibtop_get_fsusage_s
|
||||
|
||||
void glibtop_get_fsusage_l (glibtop *server, glibtop_fsusage *buf, const char *mount_dir);
|
||||
void glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf, const char *mount_dir);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
@@ -1,68 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 2.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.
|
||||
*/
|
||||
|
||||
#ifndef __GLIBTOP_SERVER_H__
|
||||
#define __GLIBTOP_SERVER_H__
|
||||
|
||||
#include <glibtop/global.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _glibtop_server glibtop_server;
|
||||
typedef struct _glibtop_server_info glibtop_server_info;
|
||||
|
||||
typedef struct _glibtop_closure glibtop_closure;
|
||||
|
||||
struct _glibtop_server_info
|
||||
{
|
||||
int ncpu; /* Number of CPUs, zero if single-processor */
|
||||
unsigned long features; /* Server is required for this features */
|
||||
glibtop_sysdeps sysdeps; /* Detailed feature list */
|
||||
glibtop_sysdeps required; /* Required feature list */
|
||||
glibtop_sysdeps wanted; /* We only want this features */
|
||||
};
|
||||
|
||||
struct _glibtop_server
|
||||
{
|
||||
glibtop_server_info *info;
|
||||
|
||||
int refcount;
|
||||
unsigned flags;
|
||||
const char *name;
|
||||
|
||||
void *_priv;
|
||||
};
|
||||
|
||||
glibtop_server *
|
||||
glibtop_server_new (void);
|
||||
|
||||
void
|
||||
glibtop_server_ref (glibtop_server *server);
|
||||
|
||||
void
|
||||
glibtop_server_unref (glibtop_server *server);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
@@ -1,81 +1,95 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
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_GLOBAL_H__
|
||||
#define __GLIBTOP_GLOBAL_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <config.h>
|
||||
|
||||
/* __BEGIN_DECLS should be used at the beginning of your declarations,
|
||||
so that C++ compilers don't mangle their names. Use __END_DECLS at
|
||||
the end of C declarations. */
|
||||
|
||||
#undef __BEGIN_DECLS
|
||||
#undef __END_DECLS
|
||||
#ifdef __cplusplus
|
||||
# define __BEGIN_DECLS extern "C" {
|
||||
# define __END_DECLS }
|
||||
#else
|
||||
# define __BEGIN_DECLS /* empty */
|
||||
# define __END_DECLS /* empty */
|
||||
#endif
|
||||
|
||||
/* __P is a macro used to wrap function prototypes, so that compilers
|
||||
that don't understand ANSI C prototypes still work, and ANSI C
|
||||
compilers can issue warnings about type mismatches. */
|
||||
|
||||
#undef __P
|
||||
#if defined (__STDC__) || defined (_AIX) \
|
||||
|| (defined (__mips) && defined (_SYSTYPE_SVR4)) \
|
||||
|| defined(WIN32) || defined(__cplusplus)
|
||||
# define __P(protos) protos
|
||||
#else
|
||||
# define __P(protos) ()
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
#include <guile/gh.h>
|
||||
#endif
|
||||
|
||||
#ifdef _IN_LIBGTOP
|
||||
|
||||
#endif /* _IN_LIBGTOP */
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#if (defined HAVE_LIBINTL_H) || (defined HAVE_GETTEXT)
|
||||
#include <libintl.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#include <libgettext.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMORY_H
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _IN_LIBGTOP
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#endif /* _IN_LIBGTOP */
|
||||
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _IN_LIBGTOP
|
||||
__BEGIN_DECLS
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#ifndef _
|
||||
#define _(String) gettext (String)
|
||||
#define N_(String) (String)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
char *strerror (int errno);
|
||||
extern char *strerror __P((int));
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _IN_LIBGTOP */
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
@@ -1,160 +0,0 @@
|
||||
/* -*-C-*-
|
||||
|
||||
Header file for the GNU Emacs server and client C code.
|
||||
|
||||
This file is part of GNU Emacs.
|
||||
|
||||
Copying is permitted under those conditions described by the GNU
|
||||
General Public License.
|
||||
|
||||
Copyright (C) 1989 Free Software Foundation, Inc.
|
||||
|
||||
Author: Andy Norman (ange@hplb.hpl.hp.com), based on
|
||||
'etc/server.c' and 'etc/emacsclient.c' from the 18.52 GNU
|
||||
Emacs distribution.
|
||||
|
||||
Please mail bugs and suggestions to the author at the above address.
|
||||
*/
|
||||
|
||||
/* HISTORY
|
||||
* 11-Nov-1990 bristor@simba
|
||||
* Added EOT stuff.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file incorporates new features added by Bob Weiner <weiner@mot.com>,
|
||||
* Darrell Kindred <dkindred@cmu.edu> and Arup Mukherjee <arup@cmu.edu>.
|
||||
* Please see the note at the end of the README file for details.
|
||||
*
|
||||
* (If gnuserv came bundled with your emacs, the README file is probably
|
||||
* ../etc/gnuserv.README relative to the directory containing this file)
|
||||
*/
|
||||
|
||||
#if 0
|
||||
static char header_rcsid [] = "!Header: gnuserv.h,v 2.4 95/02/16 11:58:11 arup alpha !";
|
||||
#endif
|
||||
|
||||
#define NO_SHORTNAMES
|
||||
|
||||
#define PATCHLEVEL 2
|
||||
|
||||
#define NO_SHORTNAMES
|
||||
/* gnuserv should not be compiled using SOCKS */
|
||||
#define DO_NOT_SOCKSIFY
|
||||
#include <glibtop.h>
|
||||
#undef read
|
||||
#undef write
|
||||
#undef open
|
||||
#undef close
|
||||
#undef signal
|
||||
|
||||
/* Define the communication method between server and clients:
|
||||
* You can have either or both kinds of sockets, but you can't mix
|
||||
* sockets with sysv ipc
|
||||
*/
|
||||
|
||||
#define INTERNET_DOMAIN_SOCKETS
|
||||
#define UNIX_DOMAIN_SOCKETS
|
||||
|
||||
/*
|
||||
* Define additional authentication protocols to be used. These methods will
|
||||
* be tried before falling back to the default gnuserv protocol (based on
|
||||
* the GNU_SECURE environment variable). Currently, only MIT-MAGIC-COOKIE-1
|
||||
* is also supported.
|
||||
*
|
||||
* Comment out the next line(s) if you don't want to enable the
|
||||
* appropriate authentication protocol.
|
||||
*/
|
||||
|
||||
#if defined (HAVE_XAUTH)
|
||||
#define AUTH_MAGIC_COOKIE
|
||||
#endif /* HAVE_XAUTH */
|
||||
|
||||
/*
|
||||
* stuff related to supporting MIT-MAGIC-COOKIE-1
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#define MCOOKIE_SCREEN "42980" /* screen # to use as the gnuserv cookie */
|
||||
#endif
|
||||
#define MCOOKIE_NAME "MAGIC-1" /* authentication protocol name */
|
||||
#define MCOOKIE_X_NAME "MIT-MAGIC-COOKIE-1" /* as needed by X */
|
||||
|
||||
|
||||
#define DEFAUTH_NAME "GNU-SECURE" /* name of default auth protocol */
|
||||
#define AUTH_TIMEOUT 15 /* # seconds to wait for auth data */
|
||||
#define AUTH_NAMESZ 15 /* max allows auth protocol name size */
|
||||
|
||||
|
||||
/*
|
||||
* Pick a default communication scheme, if none was specified.
|
||||
*/
|
||||
|
||||
#if !defined(UNIX_DOMAIN_SOCKETS) && !defined(INTERNET_DOMAIN_SOCKETS)
|
||||
|
||||
/* BSD systems use Unix Domain sockets by default */
|
||||
|
||||
#ifdef BSD
|
||||
#define UNIX_DOMAIN_SOCKETS
|
||||
#endif
|
||||
|
||||
#endif /* No communication method pre-defined */
|
||||
|
||||
/*
|
||||
* If you are using SYSV_IPC, you might want to make the buffer size bigger
|
||||
* since it limits the size of requests and responses. Don't make it bigger
|
||||
* than your system's max message size though (usually a couple of k) or else
|
||||
* msgsend will start failing. For sockets, using the system BUFSIZ is usually
|
||||
* what you want.
|
||||
*/
|
||||
|
||||
#if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS)
|
||||
#include <sys/socket.h>
|
||||
#endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */
|
||||
|
||||
#ifdef INTERNET_DOMAIN_SOCKETS
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#define TABLE_SIZE 101 /* The number of entries in the hash table */
|
||||
#define HASH(host) host /* Rather simplistic hash function */
|
||||
#define DEFAULT_PORT 21490 /* default port number to use is
|
||||
* DEFAULT_PORT + uid */
|
||||
#endif /* INTERNET_DOMAIN_SOCKETS */
|
||||
|
||||
#ifdef UNIX_DOMAIN_SOCKETS
|
||||
#include <sys/un.h>
|
||||
#define HIDE_UNIX_SOCKET /* put the unix socket in a protected dir */
|
||||
#endif /* UNIX_DOMAIN_SOCKETS */
|
||||
|
||||
#define HOSTNAMSZ 255 /* max size of a hostname */
|
||||
#define REPLYSIZ 300 /* max size of reply from server to client */
|
||||
#undef FALSE
|
||||
#define FALSE 0
|
||||
#undef TRUE
|
||||
#define TRUE 1
|
||||
|
||||
/* The casts shut Sun's compiler up and are safe in the context these
|
||||
are actually used. */
|
||||
#define max2(x,y) (((int) (x) > (int) (y)) ? (x) : (y))
|
||||
#define min2(x,y) (((int) (x) < (int) (y)) ? (x) : (y))
|
||||
|
||||
#ifndef _NFILE /* rough guess at maximum number of open files */
|
||||
#define _NFILE 20
|
||||
#endif
|
||||
|
||||
#define EOT_STR "\004"
|
||||
#define EOT_CHR '\004'
|
||||
|
||||
/* connection types */
|
||||
#define CONN_UNIX 0
|
||||
#define CONN_INTERNET 1
|
||||
#define CONN_IPC 2
|
||||
|
||||
/* function declarations */
|
||||
int glibtop_make_connection (const char *hostarg, int portarg, int *s);
|
||||
|
||||
#ifdef INTERNET_DOMAIN_SOCKETS
|
||||
long glibtop_internet_addr (const char *host);
|
||||
#endif
|
||||
|
@@ -1,15 +0,0 @@
|
||||
#ifndef H_LIBGTOP_INIT_HOOKS_1122955666
|
||||
#define H_LIBGTOP_INIT_HOOKS_1122955666
|
||||
|
||||
#include <glibtop.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef void (*_glibtop_init_func_t)(glibtop *);
|
||||
|
||||
extern const _glibtop_init_func_t _glibtop_init_hook_s[];
|
||||
extern const _glibtop_init_func_t _glibtop_init_hook_p[];
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* H_LIBGTOP_INIT_HOOKS_1122955666 */
|
@@ -1,23 +1,23 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
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_LOADAVG_H__
|
||||
#define __GLIBTOP_LOADAVG_H__
|
||||
@@ -25,45 +25,54 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/global.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define GLIBTOP_LOADAVG_LOADAVG 0
|
||||
#define GLIBTOP_LOADAVG_NR_RUNNING 1
|
||||
#define GLIBTOP_LOADAVG_NR_TASKS 2
|
||||
#define GLIBTOP_LOADAVG_LAST_PID 3
|
||||
|
||||
#define GLIBTOP_MAX_LOADAVG 4
|
||||
#define GLIBTOP_MAX_LOADAVG 1
|
||||
|
||||
typedef struct _glibtop_loadavg glibtop_loadavg;
|
||||
|
||||
struct _glibtop_loadavg
|
||||
{
|
||||
guint64 flags;
|
||||
unsigned long flags;
|
||||
double loadavg [3]; /* GLIBTOP_LOADAVG_LOADAVG */
|
||||
guint64 nr_running; /* GLIBTOP_LOADAVG_NR_RUNNING */
|
||||
guint64 nr_tasks; /* GLIBTOP_LOADAVG_NR_TASKS */
|
||||
guint64 last_pid; /* GLIBTOP_LOADAVG_LAST_PID */
|
||||
};
|
||||
|
||||
void glibtop_get_loadavg(glibtop_loadavg *buf);
|
||||
#define glibtop_get_loadavg(loadavg) glibtop_get_loadavg__r(glibtop_global_server, loadavg)
|
||||
|
||||
#if GLIBTOP_SUID_LOADAVG
|
||||
#define glibtop_get_loadavg_r glibtop_get_loadavg_p
|
||||
#else
|
||||
#define glibtop_get_loadavg_r glibtop_get_loadavg_s
|
||||
#endif
|
||||
extern void glibtop_get_loadavg__r __P((glibtop *, glibtop_loadavg *));
|
||||
|
||||
void glibtop_get_loadavg_l (glibtop *server, glibtop_loadavg *buf);
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
#if GLIBTOP_SUID_LOADAVG
|
||||
void _glibtop_init_loadavg_p (glibtop *server);
|
||||
void glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf);
|
||||
#else
|
||||
void _glibtop_init_loadavg_s (glibtop *server);
|
||||
void glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf);
|
||||
#endif
|
||||
/* You need to link with -lgtop_guile to get this stuff here. */
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
extern SCM glibtop_guile_get_loadavg __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_GUILE_NAMES
|
||||
|
||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
|
||||
|
||||
extern SCM glibtop_guile_names_loadavg __P((void));
|
||||
extern SCM glibtop_guile_types_loadavg __P((void));
|
||||
extern SCM glibtop_guile_labels_loadavg __P((void));
|
||||
extern SCM glibtop_guile_descriptions_loadavg __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_loadavg [];
|
||||
extern const char *glibtop_types_loadavg [];
|
||||
extern const char *glibtop_labels_loadavg [];
|
||||
extern const char *glibtop_descriptions_loadavg [];
|
||||
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
@@ -1,23 +1,23 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
/* $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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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 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.
|
||||
*/
|
||||
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_MEM_H__
|
||||
#define __GLIBTOP_MEM_H__
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/global.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define GLIBTOP_MEM_TOTAL 0
|
||||
#define GLIBTOP_MEM_USED 1
|
||||
@@ -42,36 +42,51 @@ typedef struct _glibtop_mem glibtop_mem;
|
||||
|
||||
struct _glibtop_mem
|
||||
{
|
||||
guint64 flags;
|
||||
guint64 total; /* GLIBTOP_MEM_TOTAL */
|
||||
guint64 used; /* GLIBTOP_MEM_USED */
|
||||
guint64 free; /* GLIBTOP_MEM_FREE */
|
||||
guint64 shared; /* GLIBTOP_MEM_SHARED */
|
||||
guint64 buffer; /* GLIBTOP_MEM_BUFFER */
|
||||
guint64 cached; /* GLIBTOP_MEM_CACHED */
|
||||
guint64 user; /* GLIBTOP_MEM_USER */
|
||||
guint64 locked; /* GLIBTOP_MEM_LOCKED */
|
||||
unsigned long flags,
|
||||
total, /* GLIBTOP_MEM_TOTAL */
|
||||
used, /* GLIBTOP_MEM_USED */
|
||||
free, /* GLIBTOP_MEM_FREE */
|
||||
shared, /* GLIBTOP_MEM_SHARED */
|
||||
buffer, /* GLIBTOP_MEM_BUFFER */
|
||||
cached, /* GLIBTOP_MEM_CACHED */
|
||||
user, /* GLIBTOP_MEM_USER */
|
||||
locked; /* GLIBTOP_MEM_LOCKED */
|
||||
};
|
||||
|
||||
void glibtop_get_mem(glibtop_mem *buf);
|
||||
#define glibtop_get_mem(mem) glibtop_get_mem__r(glibtop_global_server, mem)
|
||||
|
||||
#if GLIBTOP_SUID_MEM
|
||||
#define glibtop_get_mem_r glibtop_get_mem_p
|
||||
#else
|
||||
#define glibtop_get_mem_r glibtop_get_mem_s
|
||||
#endif
|
||||
extern void glibtop_get_mem__r __P((glibtop *, glibtop_mem *));
|
||||
|
||||
void glibtop_get_mem_l (glibtop *server, glibtop_mem *buf);
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
#if GLIBTOP_SUID_MEM
|
||||
void _glibtop_init_mem_p (glibtop *server);
|
||||
void glibtop_get_mem_p (glibtop *server, glibtop_mem *buf);
|
||||
#else
|
||||
void _glibtop_init_mem_s (glibtop *server);
|
||||
void glibtop_get_mem_s (glibtop *server, glibtop_mem *buf);
|
||||
#endif
|
||||
/* You need to link with -lgtop_guile to get this stuff here. */
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
extern SCM glibtop_guile_get_mem __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_GUILE_NAMES
|
||||
|
||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
|
||||
|
||||
extern SCM glibtop_guile_names_mem __P((void));
|
||||
extern SCM glibtop_guile_types_mem __P((void));
|
||||
extern SCM glibtop_guile_labels_mem __P((void));
|
||||
extern SCM glibtop_guile_descriptions_mem __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_mem [];
|
||||
extern const char *glibtop_types_mem [];
|
||||
extern const char *glibtop_labels_mem [];
|
||||
extern const char *glibtop_descriptions_mem [];
|
||||
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user