Compare commits
160 Commits
GNOME_LIBG
...
fileutils_
Author | SHA1 | Date | |
---|---|---|---|
|
1d7491be0d | ||
|
15cc0113a9 | ||
|
9532dadc2e | ||
|
94715ef718 | ||
|
44bb75cf6e | ||
|
4d2072ce65 | ||
|
eb36f97c50 | ||
|
a76522a990 | ||
|
71187a5e51 | ||
|
b54a5d2dfd | ||
|
134ec106b3 | ||
|
1b90ed4fcc | ||
|
3fcc477b25 | ||
|
81c75477f4 | ||
|
8b025ff2c2 | ||
|
2de9ea5c7d | ||
|
d9e6288b7a | ||
|
8d78559597 | ||
|
2a281d0a53 | ||
|
28dfff5752 | ||
|
7d0d3db11c | ||
|
63c475d400 | ||
|
d334a77447 | ||
|
1b7d7976b1 | ||
|
d7770a12c6 | ||
|
5fef6560bf | ||
|
75605116d0 | ||
|
35943ea8fc | ||
|
e166f54328 | ||
|
c1cc35ac17 | ||
|
0acb497216 | ||
|
58707dac42 | ||
|
8f14d30d11 | ||
|
bde0d74282 | ||
|
026e93121e | ||
|
f87722233a | ||
|
03c5a235ef | ||
|
215ab9f17b | ||
|
794a8efaed | ||
|
b56c327ccc | ||
|
8f43551d68 | ||
|
23cccaf87f | ||
|
c75b77affc | ||
|
7ffc53f45e | ||
|
6ea7e47194 | ||
|
6130f0a4f9 | ||
|
44dcb69c41 | ||
|
13148c632f | ||
|
6fd3c113ec | ||
|
9661c4becc | ||
|
c60d1d5449 | ||
|
eedc64096c | ||
|
cf8068049f | ||
|
5e3d6bdf18 | ||
|
aff6786e71 | ||
|
2408a0731c | ||
|
a3c345e79e | ||
|
b2950457ce | ||
|
9ce768bc4b | ||
|
c9e7e3a862 | ||
|
33eefd46c7 | ||
|
be91463190 | ||
|
28324c38cc | ||
|
4cb95e1477 | ||
|
691cd81192 | ||
|
9c9ad03d60 | ||
|
c84923132a | ||
|
85f31a1707 | ||
|
92ec7c6d33 | ||
|
0a323e5080 | ||
|
222df2c7d6 | ||
|
f92d7f9ee7 | ||
|
de5cf356c9 | ||
|
d3f9cb80d7 | ||
|
fb61de47a0 | ||
|
0727d0911c | ||
|
fbb3070abe | ||
|
402c96e473 | ||
|
44f28a486b | ||
|
4aeb33b2b9 | ||
|
3728e4c34e | ||
|
e71eb0e75b | ||
|
f233a1673f | ||
|
b96843a960 | ||
|
eb69a5547f | ||
|
7f39d62371 | ||
|
6f179a3141 | ||
|
cad4b8f2f5 | ||
|
beb68e2fc4 | ||
|
b4a16ccd89 | ||
|
15e73d9b7d | ||
|
344bdd330f | ||
|
2546fa37eb | ||
|
080dd0850b | ||
|
b7be9a7141 | ||
|
67798e0d7d | ||
|
6de9ad750b | ||
|
68162783dc | ||
|
95b9d824ea | ||
|
7dd0c2eac3 | ||
|
62dda3b782 | ||
|
4e1e1ccb9f | ||
|
dd0258acf9 | ||
|
15caaaf34f | ||
|
ff3aced01e | ||
|
b281735ba7 | ||
|
109f8dc608 | ||
|
37e161bcec | ||
|
00176cd6e8 | ||
|
40b6a23c63 | ||
|
e5ad7e782f | ||
|
977a3695f6 | ||
|
39be9f45bb | ||
|
7cd525974a | ||
|
29ba1a484b | ||
|
cd9d6bbb39 | ||
|
1e541ba56c | ||
|
c67ba32006 | ||
|
26628a6214 | ||
|
33f52f01b8 | ||
|
bee25bc218 | ||
|
022369f08a | ||
|
1d47b76ea1 | ||
|
37efa42ec6 | ||
|
f0f9b51b47 | ||
|
7e13eec9f6 | ||
|
6241c3c65f | ||
|
10a7ef87b9 | ||
|
dc88112433 | ||
|
998392ec05 | ||
|
604c7dc48e | ||
|
0a5e9d5c24 | ||
|
15d96eb9a1 | ||
|
066c74d11d | ||
|
d7e1c5d56a | ||
|
eb42a9e0cc | ||
|
436bef3790 | ||
|
5e70e5fa9f | ||
|
033f27430c | ||
|
50e59e9a85 | ||
|
8425bb7c04 | ||
|
afb564b63d | ||
|
a83ab971d0 | ||
|
57a44598b9 | ||
|
dec10a8221 | ||
|
f39948ae54 | ||
|
bb959df4b2 | ||
|
a6f0f33112 | ||
|
8bd9f46d1a | ||
|
6d3b740a2c | ||
|
e1cdfc78c1 | ||
|
d863bc7130 | ||
|
56a0d62358 | ||
|
2ece5e5f8e | ||
|
92dc0c9a34 | ||
|
258732b8a1 | ||
|
f171a2a5ca | ||
|
bf7eb7af5e | ||
|
ab9c7e593d | ||
|
d74eaeb6c8 |
@@ -13,12 +13,14 @@ 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
|
||||
ltmain.sh
|
||||
macros
|
||||
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.
|
||||
|
477
ChangeLog
477
ChangeLog
@@ -1,3 +1,480 @@
|
||||
1998-07-03 Martin baulig <martin@home-of-linux.org>
|
||||
|
||||
* macros/gnome-libgtop-sysdeps.m4: No longer use
|
||||
`glibtop_machine.h' for Linux.
|
||||
|
||||
* sysdeps/linux/glibtop_machine.h: Removed.
|
||||
|
||||
* sysdeps/guile/guile.awk: Using `scm_append'
|
||||
instead of `gh_append'.
|
||||
|
||||
* sysdeps/guile/names/guile-names.awk: dito.
|
||||
|
||||
* sysdeps/linux/*.c: Using code from stable branch again.
|
||||
|
||||
* include/glibtop/parameter.h: New file.
|
||||
|
||||
* lib/parameter.c: New file.
|
||||
|
||||
* lib/{open, init}.c: Done some more work on server
|
||||
initialization
|
||||
|
||||
1998-06-21 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* perl/*: Added perl interface.
|
||||
|
||||
* sysdeps/linux/cpu.c: Bug fix.
|
||||
|
||||
* include/glibtop/global.h: Only including guile header files
|
||||
within libgtop.
|
||||
|
||||
* configure.in (LIGBTOP_LIBS): Added `-lgtop'.
|
||||
|
||||
* Makefile.am: Creating `perl/Makefile.PL' from `perl/Makefile.PL.in'
|
||||
and `perl/Libgtop.xs' using `perl/perl.awk'.
|
||||
|
||||
1998-06-18 Martin Baulig <baulig@taurus.uni-trier.de>
|
||||
|
||||
* sysdeps/linux/*.c: Reverted some stuff from 06-07-1998
|
||||
since it was too buggy.
|
||||
|
||||
* glibtop.h (_glibtop): New field `server_port'.
|
||||
|
||||
* lib/xmalloc.c (glibtop_strdup_r): New function.
|
||||
|
||||
* lib/gnuclient.c: Removed.
|
||||
|
||||
* lib/{command, write, read}.c: Changed client <-> server
|
||||
interface to make less system calls.
|
||||
|
||||
* src/daemon/main.c: Changed server side of interface.
|
||||
|
||||
* include/glibtop/command.h (struct _glibtop_response): New
|
||||
structure to return data from the server to the client.
|
||||
|
||||
1998-06-14 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* glibtop.h (struct _glibtop): Added `socket' field.
|
||||
|
||||
* include/glibtop/gnuserv.h: New file. Imported from xemacs 20.3.
|
||||
|
||||
* sysdeps/common/gnuslib.c: New file. Imported from xemacs 20.3
|
||||
|
||||
* lib/gnuclient.c: New file. Imported from xemacs 20.3
|
||||
|
||||
* sysdeps/daemon/gnuserv.c: New file. Imported from xemacs 20.3
|
||||
|
||||
* sysdeps/daemon: New directory.
|
||||
|
||||
* configure.in (LIBGTOP_LIBS, LIBGTOP_GUILE_LIBS): Added
|
||||
`$X_LIBS -lXau' when we have xauth.
|
||||
|
||||
* acconfig.h (HAVE_XAUTH): New tag.
|
||||
|
||||
* configure.in: Added check for `HAVE_XAUTH'.
|
||||
|
||||
* sysdeps/common/error.c (glibtop_warn_r): New function -
|
||||
same as `glibtop_error_r', but doesn't call `exit'.
|
||||
(glibtop_error_io_r, glibtop_warn_io_r): New functions,
|
||||
display `strerror (errno)' together with message.
|
||||
|
||||
* include/glibtop/global.h (TIME_WITH_SYS_TIME): including
|
||||
correct headers; (HAVE_UNISTD_H): Added conditional.
|
||||
Added `#include <sys/param.h>' and `#include <sys/stat.h>'.
|
||||
|
||||
* acconfig.h (HAVE_LINUX_TABLE): New tag.
|
||||
|
||||
* lib/lib.awk: New file.
|
||||
Creates `lib.c' depending upon `features.def'.
|
||||
|
||||
* lib/<feature>.c: Removed.
|
||||
|
||||
* sysdeps/guile/guile.awk: New file.
|
||||
Creates `guile.c' depending upon `features.def'.
|
||||
|
||||
* sysdeps/guile/*.c: Removed.
|
||||
|
||||
1998-06-13 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* features.def: List of features for `guile-names.awk'.
|
||||
|
||||
* sysdeps/guile/names/guile-names.awk: New file.
|
||||
Creates `guile-names.c' depending upon `features.def'.
|
||||
|
||||
* sysdeps/guile/names/*.c: Removed.
|
||||
|
||||
* kernel: New directory. Contains some kernel code to
|
||||
implement a new system call table () to fetch information
|
||||
directly from the Linux kernel.
|
||||
|
||||
* sysdeps/kernel: New directory. Uses the table () function
|
||||
from the `kernel' directory to fetch things directly from
|
||||
the Linux kernel.
|
||||
|
||||
* sysdeps/Makefile.am (DIST_SUBDIRS): Added `kernel'.
|
||||
|
||||
* configure.in: Removed `build_CC' again.
|
||||
|
||||
1998-06-12 Martin Baulig <baulig@taurus.uni-trier.de>
|
||||
|
||||
* include/glibtop/sysdeps.h (glibtop_types_sysdeps):
|
||||
Forgot to change declaration on Jun 6.
|
||||
|
||||
* sysdeps/names/sysdeps.c (glibtop_types_sysdeps):
|
||||
Using numeric constants from `types.h' instead of string
|
||||
constants; forgot to change this on Jun 6. Added information
|
||||
about new `features' field of `_glibtop_sysdeps'.
|
||||
|
||||
* sysdeps/guile/names/*.c (glibtop_guile_types_*):
|
||||
Using `gh_ulong2scm' instead of `gh_str02scm'.
|
||||
|
||||
* sysdeps/guile/proclist.c: Replaced call to
|
||||
`gh_append2 ()' with `gh_append ()'.
|
||||
|
||||
* sysdeps/guile/names/*.c: dito.
|
||||
|
||||
1998-06-08 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* support: Added again.
|
||||
|
||||
* Makefile.am (SUBDIRS): Added `support' again.
|
||||
|
||||
* configure.in: First, we check for gnome. If it is not
|
||||
found, we run GNOME_SUPPORT_CHECKS; otherwise use
|
||||
`$GNOME_LIBDIR -lgnomesupport'.
|
||||
|
||||
1998-06-07 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* examples/ChangeLog: New file.
|
||||
|
||||
* macros/gnome-libgtop-sysdeps.m4: Include
|
||||
`glibtop_machine.h' for Linux.
|
||||
|
||||
* sysdeps/linux/glibtop_machine.h: New file.
|
||||
|
||||
* sysdeps/linux/*.c: Performance optimizations. We now use
|
||||
`open' and `read' instead of `fopen' and `fscanf'.
|
||||
|
||||
* *.[ch]: Using single underscore instead of two underscores
|
||||
for function prefixes (regexp: ``s,__([rspl])\b,_$1,g'') to
|
||||
avoid ambiguity with mangled C++ names.
|
||||
|
||||
1998-06-06 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* sysdeps/osf1/glibtop_server.h: New file.
|
||||
|
||||
* sysdeps/osf1/*.c: renamed all functions implementing
|
||||
features that don't need to be suid to '__s'.
|
||||
|
||||
* sysdeps/names/procdata.c: Removed that file.
|
||||
|
||||
* include/glibtop/*.h (glibtop_types_*): Changed declaration.
|
||||
|
||||
* glibtop.h: Added `#include <types.h>'.
|
||||
|
||||
* include/glibtop/types.h: New file - numeric constants
|
||||
for `glibtop_types_<feature>'.
|
||||
|
||||
* sysdeps/names/*.c (glibtop_types_*): Using numeric
|
||||
constants from `types.h' instead of string constants.
|
||||
|
||||
1998-06-05 Martin Baulig <baulig@taurus.uni-trier.de>
|
||||
|
||||
* support: removed that directory.
|
||||
|
||||
* configure.in: we check whether '-lgnomesupport' is
|
||||
included in $GNOME_LIBS and add it together with
|
||||
$GNOME_LIBDIR to LIBSUPPORT in this case.
|
||||
|
||||
Gnome (gnome-libs) is now required to build libgtop,
|
||||
added short comment to configure.in how to revert this
|
||||
change.
|
||||
|
||||
* Makefile.am: removed `support' subdir.
|
||||
|
||||
1998-06-03 Martin Baulig <baulig@merkur.uni-trier.de>
|
||||
|
||||
* libgtop.spec: New file.
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Added `autogen.sh' and
|
||||
`libgtop.spec'.
|
||||
|
||||
* configure.in (LIBGTOP_INCS): is now identically to
|
||||
`LIBGTOP_GUILE_INCS'.
|
||||
|
||||
* include/glibtop/global.h: only including intl headers
|
||||
while compiling libgtop.
|
||||
|
||||
1998-06-02 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* src/server/main.c: #include <locale.h>
|
||||
|
||||
1998-06-02 Martin Baulig <baulig@merkur.uni-trier.de>
|
||||
|
||||
* lib/open.c (glibtop_open): renamed to `glibtop_open__l'.
|
||||
|
||||
* sysdeps/linux/open.c (glibtop_open): renamed to
|
||||
`glibtop_open__r'.
|
||||
|
||||
* include/glibtop/open.h (GLIBTOP_OPEN_NO_OVERRIDE):
|
||||
tells `glibtop_open' to use the default server and not
|
||||
to check the environment variables.
|
||||
|
||||
* include/glibtop/sysdeps.h (_glibtop_sysdeps):
|
||||
renamed 'dummy' member to 'features'.
|
||||
|
||||
* src/proxy/*: new directory - proxy server.
|
||||
|
||||
* include/glibtop/command.h (GLIBTOP_CMND_SYSDEPS):
|
||||
added definition here.
|
||||
|
||||
* src/server/main.c (GLIBTOP_CMND_SYSDEPS): new
|
||||
command to get glibtop_server_features.
|
||||
|
||||
1998-06-01 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* NEWS: added more detailed description of today's and
|
||||
yesterday's changes.
|
||||
|
||||
* include/glibtop/*.h: to use the ChangeLog entry from May 28:
|
||||
'__l' is a function defined in the client part;
|
||||
'__s' is a function defined in the sysdeps part and
|
||||
'__p' is a function that needs special priviledges.
|
||||
'__r' is mapped either on '__p' or on '__s'.
|
||||
the function without suffix is mapped on '__l'.
|
||||
|
||||
* sysdeps/common/sysdeps.c: now using '__r' functions,
|
||||
they are #defined either as the '__p' or the '__s' ones.
|
||||
|
||||
* sysdeps/linux/*.c: changed call of 'glibtop_init__r',
|
||||
it now takes two additional arguments.
|
||||
|
||||
* examples/{first.c, second.c}: now using 'glibtop_init'
|
||||
instead of 'glibtop_init__r'.
|
||||
|
||||
* include/glibtop/sysdeps.h: added 'dummy' member so
|
||||
'GLIBTOP_SYSDEPS_<feature>' now start with 1.
|
||||
|
||||
* include/glibtop/*.h: we now #define 'glibtop_get_<feature>'
|
||||
as 'glibtop_get_<feature>__l' and 'glibtop_get_<feature>__r'
|
||||
either as the '__p' or the '__s' function.
|
||||
|
||||
* lib/*.c: removed #if's - we now decide at runtime
|
||||
whether to use the server or to call the appropriate
|
||||
function for the sysdeps directory.
|
||||
|
||||
1998-05-28 Martin Baulig <baulig@merkur.uni-trier.de>
|
||||
|
||||
* src/server/main.c: we now use the '__p' functions,
|
||||
but only if the appropriate 'GLIBTOP_SUID_<feature>'
|
||||
has a non-zero value.
|
||||
|
||||
* configure.in (@machine_incs@): always use
|
||||
`-I$(top_srcdir)/sysdeps/@sysdeps_dir@'; it's no
|
||||
longer conditional.
|
||||
|
||||
* examples/Makefile.am: removed the '_linux' examples.
|
||||
|
||||
* sysdeps/linux/*.c: renamed all functions implementing
|
||||
features to '__s'.
|
||||
|
||||
* lib/*.c: renamed all functions implementing features
|
||||
to '__l'; we only emit code for those functions if the
|
||||
corresponding 'GLIBTOP_SUID_<feature>' has a positive value.
|
||||
|
||||
* include/glibtop/*.h: added some new function suffixes:
|
||||
'__l' is a function defined in the client part;
|
||||
'__s' is a function defined in the sysdeps part and
|
||||
'__p' is a function that needs special priviledges.
|
||||
'__r' is mapped either on '__l' or on '__s'.
|
||||
|
||||
* sysdeps/linux/glibtop_server.h: New file -
|
||||
defines system dependent constants 'GLIBTOP_SUID_<feature>'
|
||||
being either 'GLIBTOP_SYSDEPS_<feature>'+1 depending upon
|
||||
whether or not this feature requires using the server.
|
||||
|
||||
* lib/sysdeps.c: removed that file; it is no longer
|
||||
needed.
|
||||
|
||||
1998-05-25 Martin Baulig <baulig@merkur.uni-trier.de>
|
||||
|
||||
* src/server/main.c: Fixed `broken pipe' error when server
|
||||
is running SUID; accidentally uses setreuid () instead of
|
||||
setregid ().
|
||||
|
||||
1998-05-24 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* sysdeps/sun4/{open.c, mem.c, glibtop_machine.h}: added
|
||||
memory statistics.
|
||||
|
||||
* include/glibtop/mem.h (_glibtop_mem): added `locked'
|
||||
member to this structure for SunOS.
|
||||
|
||||
1998-05-23 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* sysdeps/sun4/{open.c, cpu.c}: Started porting.
|
||||
Getting CPU usage now working. Took a lot of code
|
||||
from top-3.4.
|
||||
|
||||
* sysdeps/sun4/glibtop_machine.h: New file.
|
||||
System dependend header file for SunOS.
|
||||
|
||||
* configure.in (CFLAGS): added -D_IN_LIBGTOP
|
||||
|
||||
* */Makefile.am (INCLUDES): removed -I$(includedir).
|
||||
|
||||
1998-05-22 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* doc/{libgtop-ref.sgml, libgtop-ref.dsl}: New files.
|
||||
This is a reference manual that gets automatically
|
||||
build from make-docbook.scm.
|
||||
|
||||
* guile/make-docbook.scm: New file. Uses the guile
|
||||
interface of libgtop to create docbook documentation
|
||||
for all functions.
|
||||
|
||||
1998-05-21 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* Makefile.am: 'gtopConf.sh' has been renamed to
|
||||
'libgtopConf.sh'; variables in this script have changed.
|
||||
|
||||
* lib/Makefile.am: uses '@LIBGTOP_SERVER@' instead of
|
||||
'@GTOP_SERVER@'.
|
||||
|
||||
* configure.in: renamed variables for 'libgtopConf.sh.in'.
|
||||
|
||||
* acconfig.h: added 'NEED_LIBGTOP'.
|
||||
|
||||
* libgtopConf.sh.in: renamed from 'gtopConf.sh.in';
|
||||
we now define 'LIBGTOP_LIBDIR', 'LIBGTOP_INCLUDEDIR',
|
||||
'LIBGTOP_LIBS', 'LIBGTOP_INCS', 'LIBGTOP_GUILE_LIBS',
|
||||
'LIBGTOP_GUILE_INCS', 'LIBGTOP_BINDIR', 'LIBGTOP_SERVER',
|
||||
'libgtop_sysdeps_dir', 'libgtop_need_server',
|
||||
'libgtop_use_machine_h', 'libgtop_guile_found',
|
||||
'libgtop_want_names', 'libgtop_want_guile_names',
|
||||
'libgtop_want_examples'.
|
||||
|
||||
* gtopConf.sh.in: renamed to 'libgtopConf.sh.in'.
|
||||
|
||||
* acinclude.m4 (AC_LC_SYSDEPS): rewrote that macro -
|
||||
moved some of the code to 'macros/gnome-libgtop-sysdeps.m4';
|
||||
renamed variables: look at the ChangeLog entry for the
|
||||
new 'libgtopConf.sh.in' for details.
|
||||
|
||||
* doc/gnome-hackers.sgml: added information about latest
|
||||
changes in 'acinclude.m4' and 'gtopConf.sh.in'.
|
||||
|
||||
* Makefile.am: conditionally building 'examples' subdir,
|
||||
added 'copyright.txt' to EXTRA_DIST.
|
||||
|
||||
* configure.in: added 'gtop_guile_found', 'gtop_want_names',
|
||||
'gtop_want_guile_names' and 'gtop_want_examples' for use in
|
||||
'gtopConf.sh.in'; added 'include' and 'include/glibtop' subdirs.
|
||||
|
||||
* acconfig.h: added 'GLIBTOP_EXAMPLES'.
|
||||
|
||||
* acinclude.m4 (AC_LC_SYSDEPS): define 'GLIBTOP_NAMES' when
|
||||
building libgtop and a new conditional 'GLIBTOP_NAMES'; added
|
||||
new parameter '--without-examples'; define 'GLIBTOP_EXAMPLES'
|
||||
and conditional 'GLIBTOP_EXAMPLES'.
|
||||
|
||||
* gtopConf.sh.in: added 'GTOP_GUILE_FOUND', 'GTOP_WANT_NAMES',
|
||||
'GTOP_WANT_GUILE_NAMES' and 'GTOP_WANT_EXAMPLES'.
|
||||
|
||||
* include/glibtop/Makefile.am: new file - header file
|
||||
now get properly installed and go into the distribution.
|
||||
|
||||
* include/Makefile.am: new file
|
||||
|
||||
* sysdeps/guile/Makefile.am: added 'DIST_SUBDIRS'
|
||||
|
||||
* sysdeps/Makefile.am: added 'DIST_SUBDIRS'
|
||||
|
||||
* doc/gnome-hackers.sgml: new file - short intro on how
|
||||
to use libgtop in the gnome project; especially 'configure'
|
||||
and 'gtopConf.sh'.
|
||||
|
||||
* doc/gnome-hackers.dsl: new file - sets output filename
|
||||
and directory for 'gnome-hackers.sgml'.
|
||||
|
||||
* doc/libgtop.dsl: most stuff from this file has moved
|
||||
to 'dbtohtml.dsl', it now only overrides the output
|
||||
filename and directory.
|
||||
|
||||
* doc/dbtohtml.dsl: new file - contains most that was
|
||||
formerly in 'libgtop.dsl'.
|
||||
|
||||
* configure.in: 'GTOP_INCS' and 'GTOP_LIBS' now really
|
||||
point to the places where everything gets installed and
|
||||
no longer to the build directory, so that they can be
|
||||
used in 'gtopConf.sh'.
|
||||
|
||||
* acinclude.m4 (AC_LC_SYSDEPS): added 'machine_incs'
|
||||
which is used in 'INCLUDES' in several 'Makefile.am's;
|
||||
fixed typo 'ac_cv_want_names'; added missing AC_SUBST
|
||||
of 'use_glibtop_machine_h'.
|
||||
|
||||
1998-05-20 Martin Baulig <baulig@merkur.uni-trier.de>
|
||||
|
||||
* NEWS: added more detailed description of
|
||||
today's changes.
|
||||
|
||||
* examples/third.c: added required check for
|
||||
'GLIBGTOP_GUILE_NAMES'.
|
||||
|
||||
* sysdeps/Makefile.am: only build 'names' subdir
|
||||
when necessary.
|
||||
|
||||
* sysdeps/guile/Makefile.am: only build 'names'
|
||||
subdir when necessary.
|
||||
|
||||
* acinclude.m4 (AC_LC_SYSDEPS): added
|
||||
'--enable-libgtop-server' (default=auto),
|
||||
'--enable-libgtop-names' (default=yes) and
|
||||
'--enable-libgtop-guile' (default=yes); we
|
||||
now define 'GLIBTOP_NAMES' here.
|
||||
|
||||
* acconfig.h: added 'GLIBTOP_NAMES' and
|
||||
'GLIBTOP_GUILE_NAMES'
|
||||
|
||||
* gtopConf.sh.in: added definition of 'GTOP_GUILE_LIBS'
|
||||
and 'GTOP_GUILE_INCS':
|
||||
|
||||
'GTOP_LIBS' and 'GTOP_INCS' now contains everything
|
||||
that is needed to link with libgtop.
|
||||
|
||||
'GTOP_GUILE_LIBS' and 'GTOP_GUILE_INCS' now contains
|
||||
everything that is needed to link with libgtop and its
|
||||
guile interface. When guile cannot be found on the system
|
||||
or building of the guile interface was disables, they are
|
||||
identical to 'GTOP_LIBS' and 'GTOP_INCS'
|
||||
[FIXME: Should I make them empty in this case?]
|
||||
|
||||
* sysdeps/osf1/procuid.c (glibtop_get_proc_uid__r):
|
||||
added implementation for DEC OSF/1.
|
||||
|
||||
* sysdeps/sun4/uptime.c: forgot to checkin
|
||||
|
||||
* sysdeps/sun4/loadavg.c: forgot to checkin
|
||||
|
||||
* sysdeps/osf1/uptime.c: forgot to checkin
|
||||
|
||||
* sysdeps/osf1/loadavg.c: forgot to checkin
|
||||
|
||||
1998-05-19 Martin Baulig <baulig@merkur.uni-trier.de>
|
||||
|
||||
* sysdeps/stub/uptime.c: forgot this file all the
|
||||
time - stub for glibtop_uptime
|
||||
|
||||
* sysdeps/stub/loadavg.c: forgot this file all the
|
||||
time - stub for glibtop_loadavg
|
||||
|
||||
* NEWS: Libgtop is now in the GNOME CVS Repository.
|
||||
|
||||
* po/Makefile.in.in: new file
|
||||
|
||||
* ABOUT-NLS: new file
|
||||
|
||||
1998-05-17 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* NEWS: added some stuff from 'README.LATEST'.
|
||||
|
75
Makefile.am
75
Makefile.am
@@ -1,12 +1,18 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
built_SUBDIRS = sysdeps src lib examples
|
||||
if GLIBTOP_EXAMPLES
|
||||
examples_SUBDIRS = examples
|
||||
endif
|
||||
|
||||
SUBDIRS = po intl support macros $(built_SUBDIRS)
|
||||
built_SUBDIRS = include sysdeps lib src
|
||||
|
||||
include_HEADERS =
|
||||
SUBDIRS = po intl support macros $(built_SUBDIRS) $(examples_SUBDIRS)
|
||||
|
||||
EXTRA_DIST = gtopConf.sh.in
|
||||
DIST_SUBDIRS = po intl macros include sysdeps src lib examples
|
||||
|
||||
include_HEADERS = glibtop.h
|
||||
|
||||
EXTRA_DIST = autogen.sh libgtop.spec copyright.txt libgtopConf.sh.in
|
||||
|
||||
release:
|
||||
$(MAKE) dist distdir=$(PACKAGE)$(VERSION)
|
||||
@@ -14,7 +20,10 @@ release:
|
||||
## Put `exec' in the name because this should be installed by
|
||||
## `install-exec', not `install-data'.
|
||||
confexecdir=$(libdir)
|
||||
confexec_DATA = $(top_builddir)/gtopConf.sh
|
||||
confexec_DATA = $(top_builddir)/libgtopConf.sh
|
||||
|
||||
noinst_DATA = $(top_builddir)/perl/Makefile.PL \
|
||||
$(top_builddir)/perl/Libgtop.xs
|
||||
|
||||
## to automatically rebuild aclocal.m4 if any of the macros in
|
||||
## `macros/' change
|
||||
@@ -22,20 +31,50 @@ confexec_DATA = $(top_builddir)/gtopConf.sh
|
||||
@MAINT@macros/macros.dep: macros/Makefile.am
|
||||
@MAINT@ cd macros && $(MAKE) macros.dep
|
||||
|
||||
## We create gtopConf.sh here and not from configure because we want
|
||||
## 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).
|
||||
gtopConf.sh: gtopConf.sh.in Makefile
|
||||
libgtopConf.sh: libgtopConf.sh.in Makefile
|
||||
## Use sed and then mv to avoid problems if the user interrupts.
|
||||
sed -e 's,\@GTOP_LIBDIR\@,$(libdir),g' \
|
||||
-e 's,\@GTOP_INCLUDEDIR\@,$(includedir),g' \
|
||||
-e 's,\@GTOP_LIBS\@,$(GTOP_LIBS),g' \
|
||||
-e 's,\@GTOP_INCS\@,$(GTOP_INCS),g' \
|
||||
-e 's,\@GTOP_BINDIR\@,$(GTOP_BINDIR),g' \
|
||||
-e 's,\@GTOP_SERVER\@,$(GTOP_SERVER),g' \
|
||||
-e 's,\@GTOP_SYSDEPS_DIR\@,$(sysdeps_dir),g' \
|
||||
-e 's,\@GTOP_NEED_SERVER\@,$(need_server),g' \
|
||||
-e 's,\@GTOP_USE_MACHINE_H\@,$(use_glibtop_machine_h),g' \
|
||||
< $(srcdir)/gtopConf.sh.in > gtopConf.tmp \
|
||||
&& mv gtopConf.tmp gtopConf.sh
|
||||
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
|
||||
|
||||
perl/Makefile.PL: perl/Makefile.PL.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)/perl/Makefile.PL.in > perl/Makefile.tmp \
|
||||
&& mv perl/Makefile.tmp perl/Makefile.PL
|
||||
|
||||
perl/Libgtop.xs: perl/perl.awk $(top_builddir)/config.h $(top_srcdir)/features.def
|
||||
$(AWK) -f $(top_srcdir)/perl/perl.awk < $(top_srcdir)/features.def > perl/lgt-t
|
||||
mv perl/lgt-t perl/Libgtop.xs
|
||||
|
148
NEWS
148
NEWS
@@ -1,5 +1,153 @@
|
||||
$Id$
|
||||
|
||||
Jun/01/1998
|
||||
===========
|
||||
|
||||
* We have some new ``suffix rules'':
|
||||
|
||||
'__l' is a function defined in the client part;
|
||||
'__s' is a function defined in the sysdeps part and
|
||||
'__p' is a function that needs special priviledges.
|
||||
'__r' is mapped either on '__p' or on '__s'.
|
||||
the function without suffix is mapped on '__l'.
|
||||
|
||||
* We now decide at runtime whether or not using the server
|
||||
is required for a particular function. All user programs
|
||||
now call the '__l' function defined in '-lgtop' (in the lib
|
||||
subdir). These functions either use 'glibtop_call__l' to
|
||||
call the server or call the '__r' function.
|
||||
|
||||
* A function in the sysdeps directory now has the '__s' suffix
|
||||
if it do not need any priviledges (and thus can be called directly
|
||||
from client code) and the '__p' suffix otherwise (when it has to
|
||||
be called from the server).
|
||||
|
||||
* If you call one of these functions:
|
||||
|
||||
-> use the '__p' suffix to be sure to get the SUID-safe one
|
||||
(used in the server).
|
||||
-> use the '__s' suffix to be sure to get a function that
|
||||
doesn't need any priviledges.
|
||||
-> use the '__r' suffix otherwise (it is mapped either on the
|
||||
'__p' or on the '__s' one).
|
||||
|
||||
Only use the '__p' and '__s' functions in a 'GLIBTOP_SUID_<feature>'
|
||||
conditional, otherwise you'll get undefined symbols !
|
||||
|
||||
* The server is now started from 'glibtop_init__r', but only when
|
||||
it's really needed; for instance on DEC OSF/1 you only need it
|
||||
for the proc* features - if you program only fetches the CPU usage,
|
||||
now server will be started.
|
||||
|
||||
* Sorry, at the moment everything is a little bit unstable, I'm doing
|
||||
heavy changes. I've just some great ideas which still need some work:
|
||||
|
||||
-> I want to have a SUID server that only implements those features
|
||||
that need to be SUID; everything else uses the sysdeps code directly.
|
||||
|
||||
-> If a program only uses stuff that do not need the server, the
|
||||
server will not be started at all.
|
||||
|
||||
-> I'm working on some kind of proxy server that can be used on a remote
|
||||
host; in feature one can then use the MDI stuff from ghex in gtop to
|
||||
have notebook pages displaying processes from different hosts.
|
||||
|
||||
* Well it is as much unstable that it only works under Linux at the moment.
|
||||
|
||||
1998-06-01 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* sysdeps/common/sysdeps.c: now using '__r' functions,
|
||||
they are #defined either as the '__p' or the '__s' ones.
|
||||
|
||||
* sysdeps/linux/*.c: changed call of 'glibtop_init__r',
|
||||
it now takes two additional arguments.
|
||||
|
||||
* examples/{first.c, second.c}: now using 'glibtop_init'
|
||||
instead of 'glibtop_init__r'.
|
||||
|
||||
* include/glibtop/sysdeps.h: added 'dummy' member so
|
||||
'GLIBTOP_SYSDEPS_<feature>' now start with 1.
|
||||
|
||||
* include/glibtop/*.h: we now #define 'glibtop_get_<feature>'
|
||||
as 'glibtop_get_<feature>__l' and 'glibtop_get_<feature>__r'
|
||||
either as the '__p' or the '__s' function.
|
||||
|
||||
* lib/*.c: removed #if's - we now decide at runtime
|
||||
whether to use the server or to call the appropriate
|
||||
function for the sysdeps directory.
|
||||
|
||||
1998-05-28 Martin Baulig <baulig@merkur.uni-trier.de>
|
||||
|
||||
* src/server/main.c: we now use the '__p' functions,
|
||||
but only if the appropriate 'GLIBTOP_SUID_<feature>'
|
||||
has a non-zero value.
|
||||
|
||||
* configure.in (@machine_incs@): always use
|
||||
`-I$(top_srcdir)/sysdeps/@sysdeps_dir@'; it's no
|
||||
longer conditional.
|
||||
|
||||
* examples/Makefile.am: removed the '_linux' examples.
|
||||
|
||||
* sysdeps/linux/*.c: renamed all functions implementing
|
||||
features to '__s'.
|
||||
|
||||
* lib/*.c: renamed all functions implementing features
|
||||
to '__l'; we only emit code for those functions if the
|
||||
corresponding 'GLIBTOP_SUID_<feature>' has a positive value.
|
||||
|
||||
* include/glibtop/*.h: added some new function suffixes:
|
||||
'__l' is a function defined in the client part;
|
||||
'__s' is a function defined in the sysdeps part and
|
||||
'__p' is a function that needs special priviledges.
|
||||
'__r' is mapped either on '__l' or on '__s'.
|
||||
|
||||
* sysdeps/linux/glibtop_server.h: New file -
|
||||
defines system dependent constants 'GLIBTOP_SUID_<feature>'
|
||||
being either 'GLIBTOP_SYSDEPS_<feature>'+1 depending upon
|
||||
whether or not this feature requires using the server.
|
||||
|
||||
* lib/sysdeps.c: removed that file; it is no longer
|
||||
needed.
|
||||
|
||||
|
||||
|
||||
May/21/1998
|
||||
===========
|
||||
|
||||
* 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'.
|
||||
|
||||
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;
|
||||
|
||||
* '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.
|
||||
|
||||
* '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.
|
||||
|
||||
* '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
|
||||
===========
|
||||
|
||||
* Libgtop is now in the GNOME CVS Repository.
|
||||
|
||||
May/17/1998
|
||||
===========
|
||||
|
||||
|
@@ -28,3 +28,12 @@
|
||||
|
||||
#undef HAVE_GLIBTOP_MACHINE_H
|
||||
|
||||
#undef GLIBTOP_NAMES
|
||||
#undef GLIBTOP_GUILE_NAMES
|
||||
#undef GLIBTOP_EXAMPLES
|
||||
|
||||
#undef NEED_LIBGTOP
|
||||
|
||||
#undef HAVE_LINUX_TABLE
|
||||
|
||||
#undef HAVE_XAUTH
|
||||
|
721
acinclude.m4
721
acinclude.m4
@@ -29,558 +29,158 @@ AC_DEFUN([AC_LC_CANONICAL_HOST],[
|
||||
|
||||
AC_DEFUN([AC_LC_SYSDEPS],[
|
||||
AC_REQUIRE([AC_LC_CANONICAL_HOST])
|
||||
AC_MSG_CHECKING(for sysdeps directory)
|
||||
AC_ARG_WITH(sysdeps,
|
||||
[ --with-sysdeps=dir which sysdeps directory should be used [default=auto]],
|
||||
[if test "x$withval" = "xyes" ; then
|
||||
ac_cv_sysdeps_dir=yes
|
||||
elif test "x$withval" = "xauto" ; then
|
||||
ac_cv_sysdeps_dir=yes
|
||||
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
|
||||
ac_cv_sysdeps_dir=$withval
|
||||
fi],[ac_cv_sysdeps_dir=yes])
|
||||
if test "x$ac_cv_sysdeps_dir" = "xyes" ; then
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
sysdeps_dir=linux
|
||||
use_glibtop_machine_h=no
|
||||
need_server=no
|
||||
;;
|
||||
sunos4*)
|
||||
sysdeps_dir=sun4
|
||||
use_glibtop_machine_h=no
|
||||
need_server=yes
|
||||
;;
|
||||
osf*)
|
||||
sysdeps_dir=osf1
|
||||
use_glibtop_machine_h=yes
|
||||
AC_DEFINE(HAVE_GLIBTOP_MACHINE_H)
|
||||
need_server=yes
|
||||
;;
|
||||
*)
|
||||
sysdeps_dir=stub
|
||||
use_glibtop_machine_h=no
|
||||
need_server=no
|
||||
;;
|
||||
esac
|
||||
elif test "x$ac_cv_sysdeps_dir" = "xno" ; then
|
||||
sysdeps_dir=stub
|
||||
else
|
||||
sysdeps_dir=stub
|
||||
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
|
||||
test -d $srcdir/sysdeps/$sysdeps_dir || sysdeps_dir=stub
|
||||
AC_MSG_RESULT($sysdeps_dir)
|
||||
AC_SUBST(sysdeps_dir)
|
||||
AC_SUBST(need_server)
|
||||
])
|
||||
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
[AC_PREREQ([2.12])
|
||||
AC_CONFIG_HEADER([$1])
|
||||
dnl When config.status generates a header, we must update the stamp-h file.
|
||||
dnl This file resides in the same directory as the config header
|
||||
dnl that is generated. We must strip everything past the first ":",
|
||||
dnl and everything past the last "/".
|
||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
||||
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
||||
<<am_indx=1
|
||||
for am_file in <<$1>>; do
|
||||
case " <<$>>CONFIG_HEADERS " in
|
||||
*" <<$>>am_file "*<<)>>
|
||||
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
||||
;;
|
||||
esac
|
||||
am_indx=`expr "<<$>>am_indx" + 1`
|
||||
done<<>>dnl>>)
|
||||
changequote([,]))])
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AM_PROG_INSTALL])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
dnl test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
ifelse([$3],,
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
|
||||
AC_REQUIRE([AM_SANITY_CHECK])
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])
|
||||
dnl FIXME This is truly gross.
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
||||
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_PROG_INSTALL,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
|
||||
AC_SUBST(INSTALL_SCRIPT)dnl
|
||||
|
||||
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)
|
||||
])
|
||||
|
||||
######################################################################
|
||||
# progtest.m4 from gettext 0.32
|
||||
######################################################################
|
||||
# Search path for a program which passes the given test.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
#
|
||||
# Check to make sure that the build environment is sane.
|
||||
#
|
||||
|
||||
AC_DEFUN(AM_SANITY_CHECK,
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
if test "[$]*" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
fi
|
||||
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
||||
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "[$]2" = conftestfile
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
rm -f conftest*
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||
dnl The program must properly implement --version.
|
||||
AC_DEFUN(AM_MISSING_PROG,
|
||||
[AC_MSG_CHECKING(for working $2)
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||
$1=$2
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
$1="$3/missing $2"
|
||||
AC_MSG_RESULT(missing)
|
||||
fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
# Add --enable-maintainer-mode option to configure.
|
||||
# From Jim Meyering
|
||||
# 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
|
||||
|
||||
AC_DEFUN(AM_MAINTAINER_MODE,
|
||||
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
||||
dnl maintainer-mode is disabled by default
|
||||
AC_ARG_ENABLE(maintainer-mode,
|
||||
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer],
|
||||
USE_MAINTAINER_MODE=$enableval,
|
||||
USE_MAINTAINER_MODE=no)
|
||||
AC_MSG_RESULT($USE_MAINTAINER_MODE)
|
||||
if test $USE_MAINTAINER_MODE = yes; then
|
||||
MAINT=
|
||||
else
|
||||
MAINT='#M#'
|
||||
fi
|
||||
AC_SUBST(MAINT)dnl
|
||||
]
|
||||
)
|
||||
|
||||
# aclocal-include.m4
|
||||
#
|
||||
# This macro adds the name macrodir to the set of directories
|
||||
# that `aclocal' searches for macros.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl AM_ACLOCAL_INCLUDE(macrodir)
|
||||
AC_DEFUN([AM_ACLOCAL_INCLUDE],
|
||||
[ACLOCAL="$ACLOCAL -I $1"])
|
||||
|
||||
dnl
|
||||
dnl GNOME_CHECK_GUILE (failflag)
|
||||
dnl
|
||||
dnl if failflag is "fail" then GNOME_CHECK_GUILE will abort if guile is not found.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([GNOME_CHECK_GUILE],
|
||||
[
|
||||
saved_ldflags="$LDFLAGS"
|
||||
saved_cppflags="$CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $GNOME_LIBDIR"
|
||||
|
||||
AC_CHECK_LIB(qthreads,main,[
|
||||
QTTHREADS_LIB="-lqthreads"
|
||||
],[
|
||||
AC_CHECK_LIB(qt, qt_null, QTTHREADS_LIB="-lqt")
|
||||
],$LIBS)
|
||||
AC_SUBST(QTTHREADS_LIB)
|
||||
|
||||
AC_CHECK_LIB(termcap,main,TERMCAP_LIB="-ltermcap")
|
||||
AC_CHECK_LIB(readline,main,READLINE_LIB="-lreadline",,$TERMCAP_LIB)
|
||||
|
||||
AC_SUBST(TERMCAP_LIB)
|
||||
AC_SUBST(READLINE_LIB)
|
||||
|
||||
AC_CHECK_PROG(BUILD_GUILE, build-guile, yes, no)
|
||||
|
||||
if test "x$BUILD_GUILE" = "xyes"; then
|
||||
AC_MSG_CHECKING(whether build-guile works)
|
||||
if test x`build-guile --version >/dev/null 2>&1 || \
|
||||
echo no` = xno; then
|
||||
BUILD_GUILE=no
|
||||
fi
|
||||
AC_MSG_RESULT($BUILD_GUILE)
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(m, sin)
|
||||
|
||||
if test "x$BUILD_GUILE" = "xyes"; then
|
||||
AC_MSG_CHECKING(for guile libraries)
|
||||
GUILE_LIBS="-L`build-guile info libdir` `build-guile link`"
|
||||
AC_MSG_RESULT($GUILE_LIBS)
|
||||
AC_MSG_CHECKING(for guile headers)
|
||||
GUILE_INCS="-I`build-guile info includedir`"
|
||||
AC_MSG_RESULT($GUILE_INCS)
|
||||
else
|
||||
GUILE_LIBS="$GNOME_LIBDIR"
|
||||
GUILE_INCS="$GNOME_INCLUDEDIR"
|
||||
AC_CHECK_LIB(rx, main, GUILE_LIBS="-lrx $GUILE_LIBS")
|
||||
AC_CHECK_LIB(qt, main, GUILE_LIBS="-lqt $GUILE_LIBS")
|
||||
AC_CHECK_LIB(dl, dlopen, GUILE_LIBS="-ldl $GUILE_LIBS")
|
||||
GUILE_LIBS="-lguile $GUILE_LIBS $QTTHREADS_LIB $TERMCAP_LIB $READLINE_LIB"
|
||||
fi
|
||||
|
||||
AC_SUBST(GUILE_LIBS)
|
||||
AC_SUBST(GUILE_INCS)
|
||||
|
||||
LDFLAGS="$saved_ldflags $GUILE_LIBS"
|
||||
CPPFLAGS="$saved_cppflags $GUILE_INCS"
|
||||
|
||||
AC_MSG_CHECKING(whether guile works)
|
||||
AC_TRY_LINK([
|
||||
#include <libguile.h>
|
||||
#include <guile/gh.h>
|
||||
],[
|
||||
gh_eval_str("(newline)");
|
||||
scm_boot_guile(0,NULL,NULL,NULL);
|
||||
],[
|
||||
ac_cv_guile_found=yes
|
||||
AC_DEFINE(HAVE_GUILE)
|
||||
],[
|
||||
ac_cv_guile_found=no
|
||||
])
|
||||
AC_MSG_RESULT($ac_cv_guile_found)
|
||||
|
||||
if test x$ac_cv_guile_found = xno ; then
|
||||
if test x$1 = xfail ; then
|
||||
AC_MSG_ERROR(Can not find Guile 1.2 on this system)
|
||||
else
|
||||
AC_MSG_WARN(Can not find Guile 1.2 on this system)
|
||||
fi
|
||||
ac_cv_guile_found=no
|
||||
fi
|
||||
|
||||
LDFLAGS="$saved_ldflags"
|
||||
CPPFLAGS="$saved_cppflags"
|
||||
|
||||
AC_SUBST(GUILE_LIBS)
|
||||
AM_CONDITIONAL(GUILE, test x$ac_cv_guile_found = xyes)
|
||||
])
|
||||
|
||||
# Define a conditional.
|
||||
|
||||
AC_DEFUN(AM_CONDITIONAL,
|
||||
[AC_SUBST($1_TRUE)
|
||||
AC_SUBST($1_FALSE)
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi])
|
||||
|
||||
|
||||
dnl AM_PROG_LEX
|
||||
dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
|
||||
AC_DEFUN(AM_PROG_LEX,
|
||||
[AC_CHECK_PROGS(LEX, flex lex, "$1/missing flex")
|
||||
AC_PROG_LEX
|
||||
AC_DECL_YYTEXT])
|
||||
|
||||
|
||||
# serial 18 AM_PROG_LIBTOOL
|
||||
AC_DEFUN(AM_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([AC_PROG_RANLIB])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AM_PROG_LD])
|
||||
AC_REQUIRE([AM_PROG_NM])
|
||||
AC_REQUIRE([AC_PROG_LN_S])
|
||||
|
||||
# Always use our own libtool.
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||
AC_SUBST(LIBTOOL)
|
||||
|
||||
dnl Allow the --disable-shared flag to stop us from building shared libs.
|
||||
AC_ARG_ENABLE(shared,
|
||||
[ --enable-shared build shared libraries [default=yes]],
|
||||
[if test "$enableval" = no; then
|
||||
libtool_enable_shared=no
|
||||
else
|
||||
libtool_enable_shared=yes
|
||||
fi])
|
||||
test -n "$libtool_enable_shared" && enable_shared="$libtool_enable_shared"
|
||||
libtool_shared=
|
||||
test "$enable_shared" = no && libtool_shared=" --disable-shared"
|
||||
|
||||
dnl Allow the --disable-static flag to stop us from building static libs.
|
||||
AC_ARG_ENABLE(static,
|
||||
[ --enable-static build static libraries [default=yes]],
|
||||
[if test "$enableval" = no; then
|
||||
libtool_enable_static=no
|
||||
else
|
||||
libtool_enable_static=yes
|
||||
fi])
|
||||
test -n "$libtool_enable_static" && enable_static="$libtool_enable_static"
|
||||
libtool_static=
|
||||
test "$enable_static" = no && libtool_static=" --disable-static"
|
||||
|
||||
libtool_flags="$libtool_shared$libtool_static"
|
||||
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
|
||||
# Some flags need to be propagated to the compiler or linker for good
|
||||
# libtool support.
|
||||
[case "$host" in
|
||||
*-*-irix6*)
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
flag_passed=no
|
||||
for f in -32 -64 -n32 ABI -cckr -mips1 -mips2 -mips3 -mips4; do
|
||||
case "$f" in
|
||||
ABI)
|
||||
test -n "$SGI_ABI" && flag_passed=yes
|
||||
if test "$flag_passed" = no && test "$ac_cv_prog_gcc" = yes; then
|
||||
# Choose the ABI flag according to GCC's specs.
|
||||
if $CC -dumpspecs 2>&1 | sed '/^\*link:$/,/^$/!d' | egrep -e '[ ]-32' >/dev/null; then
|
||||
LD="${LD-ld} -32"
|
||||
else
|
||||
LD="${LD-ld} -n32"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
|
||||
flag_passed=yes
|
||||
LD="${LD-ld} $f"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
;;
|
||||
|
||||
*-*-sco3.2v5*)
|
||||
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
;;
|
||||
esac]
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
])
|
||||
|
||||
# AM_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AM_PROG_LD,
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
ac_prog=ld
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
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
|
||||
/*)
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
;;
|
||||
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
# If it is relative, then search for the first ld in PATH.
|
||||
with_gnu_ld=unknown
|
||||
;;
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
AC_MSG_CHECKING([for GNU ld])
|
||||
else
|
||||
AC_MSG_CHECKING([for non-GNU ld])
|
||||
fi
|
||||
AC_CACHE_VAL(ac_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
for ac_dir in ifelse([$5], , $PATH, [$5]); do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog"; then
|
||||
ac_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
test "$with_gnu_ld" != no && break
|
||||
else
|
||||
test "$with_gnu_ld" != yes && break
|
||||
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"
|
||||
else
|
||||
ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
LD="$ac_cv_path_LD"
|
||||
if test -n "$LD"; then
|
||||
AC_MSG_RESULT($LD)
|
||||
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
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_SUBST(LD)
|
||||
AM_PROG_LD_GNU
|
||||
AC_SUBST($1)dnl
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_PROG_LD_GNU,
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
||||
ac_cv_prog_gnu_ld=yes
|
||||
else
|
||||
ac_cv_prog_gnu_ld=no
|
||||
fi])
|
||||
])
|
||||
|
||||
# AM_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AM_PROG_NM,
|
||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
||||
AC_CACHE_VAL(ac_cv_path_NM,
|
||||
[case "$NM" in
|
||||
/*)
|
||||
ac_cv_path_NM="$NM" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
|
||||
test -z "$ac_dir" && dir=.
|
||||
if test -f $ac_dir/nm; then
|
||||
# Check to see if the nm accepts a BSD-compat flag.
|
||||
# Adding the `sed 1!d' prevents false positives on HP-UX, which says:
|
||||
# nm: unknown option "B" ignored
|
||||
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
else
|
||||
ac_cv_path_NM="$ac_dir/nm"
|
||||
fi
|
||||
break
|
||||
######################################################################
|
||||
# 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.
|
||||
|
||||
# serial 1
|
||||
|
||||
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
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
||||
;;
|
||||
esac])
|
||||
NM="$ac_cv_path_NM"
|
||||
AC_MSG_RESULT([$NM])
|
||||
AC_SUBST(NM)
|
||||
])
|
||||
fi])
|
||||
|
||||
dnl LIBGTOP_SUPPORT_CHECKS
|
||||
dnl Check for various support functions needed by the standard
|
||||
dnl Gnome libraries. Sets LIBOBJS, might define some macros,
|
||||
dnl and will set the need_libgtop_support shell variable to "yes"
|
||||
dnl or "no". Also sets up the Automake BUILD_LIBGTOP_SUPPORT
|
||||
dnl conditional.
|
||||
AC_DEFUN([LIBGTOP_SUPPORT_CHECKS],[
|
||||
need_libgtop_support=no
|
||||
save_LIBOBJS="$LIBOBJS"
|
||||
LIBOBJS=
|
||||
|
||||
AC_CACHE_CHECK([for program_invocation_short_name], libgtop_cv_short_name, [
|
||||
AC_TRY_LINK([#include <errno.h>],[
|
||||
char *foo = program_invocation_short_name],
|
||||
libgtop_cv_short_name=yes, libgtop_cv_short_name=no)])
|
||||
if test "$libgtop_cv_short_name" = yes; then
|
||||
AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME)
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for program_invocation_name], libgtop_cv_invocation_name, [
|
||||
AC_TRY_LINK([#include <errno.h>],[
|
||||
char *foo = program_invocation_name],
|
||||
libgtop_cv_invocation_name=yes, libgtop_cv_invocation_name=no)])
|
||||
if test "$libgtop_cv_invocation_name" = yes; then
|
||||
AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME)
|
||||
fi
|
||||
|
||||
AC_REPLACE_FUNCS(strtok_r strcasecmp strndup strnlen strerror)
|
||||
|
||||
if test "$LIBOBJS" != ""; then
|
||||
need_libgtop_support=yes
|
||||
fi
|
||||
# Turn our LIBOBJS into libtool objects. This is gross, but it
|
||||
# requires changes to autoconf before it goes away.
|
||||
LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'`
|
||||
AC_SUBST(LTLIBOBJS)
|
||||
|
||||
LIBOBJS="$save_LIBOBJS"
|
||||
AM_CONDITIONAL(BUILD_LIBGTOP_SUPPORT, test "$need_libgtop_support" = yes)
|
||||
])
|
||||
|
||||
######################################################################
|
||||
# gettext.m4 from gettext 0.32
|
||||
######################################################################
|
||||
# Macro to add for using GNU gettext.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
#
|
||||
@@ -889,72 +489,3 @@ __argz_count __argz_stringify __argz_next])
|
||||
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
|
||||
< $srcdir/po/POTFILES.in > po/POTFILES
|
||||
])
|
||||
|
||||
# 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
|
||||
AC_SUBST($1)dnl
|
||||
])
|
||||
|
||||
# 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.
|
||||
|
||||
# serial 1
|
||||
|
||||
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])
|
||||
|
||||
|
204
configure.in
204
configure.in
@@ -4,19 +4,21 @@ dnl
|
||||
|
||||
AC_INIT(copyright.txt)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
AM_INIT_AUTOMAKE(libgtop, 0.01)
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AM_ACLOCAL_INCLUDE(macros)
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
AC_ISC_POSIX
|
||||
AC_PROG_CC
|
||||
AC_STDC_HEADERS
|
||||
AC_ARG_PROGRAM
|
||||
|
||||
AC_PROG_AWK
|
||||
|
||||
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)
|
||||
@@ -24,35 +26,50 @@ AC_CHECK_TOOL(NM,nm)
|
||||
NM=`which $NM`
|
||||
export CC CXX RANLIB LD AS AR NM
|
||||
|
||||
AC_LC_SYSDEPS
|
||||
|
||||
GNOME_CHECK_GUILE
|
||||
|
||||
if test x$ac_cv_guile_found = xyes ; then
|
||||
guile_examples='third third_static third_linux'
|
||||
guile_subdirs='guile'
|
||||
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
|
||||
|
||||
GNOME_SUPPORT_CHECKS
|
||||
dnl If you want to use libgtop without gnome, comment the following line out.
|
||||
GNOME_INIT_HOOK(gnome_found=yes)
|
||||
|
||||
if test "x$gnome_found" != xyes; then
|
||||
GNOME_SUPPORT_CHECKS
|
||||
else
|
||||
AM_CONDITIONAL(BUILD_GNOME_SUPPORT, false)
|
||||
AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
|
||||
fi
|
||||
|
||||
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'
|
||||
guile_subdirs='guile'
|
||||
else
|
||||
guile_examples=
|
||||
guile_subdirs=
|
||||
fi
|
||||
else
|
||||
guile_examples=
|
||||
guile_subdirs=
|
||||
fi
|
||||
|
||||
AC_SUBST(guile_examples)
|
||||
AC_SUBST(guile_subdirs)
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
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
|
||||
@@ -82,51 +99,139 @@ AC_TYPE_SIGNAL
|
||||
AC_FUNC_STRFTIME
|
||||
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
|
||||
|
||||
ALL_LINGUAS=""
|
||||
ALL_LINGUAS="fr"
|
||||
AM_GNU_GETTEXT
|
||||
|
||||
AC_PATH_XTRA
|
||||
|
||||
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
|
||||
test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
|
||||
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)
|
||||
XE_SPACE(libs_xauth, $X_LIBS -lXau)
|
||||
fi
|
||||
AC_SUBST(libs_xauth)
|
||||
|
||||
|
||||
CFLAGS="$CFLAGS -D_IN_LIBGTOP"
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(CPPFLAGS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(GNOME_ENABLE_DEBUG),)
|
||||
|
||||
LIBSUPPORT=
|
||||
SUPPORTINCS=
|
||||
if test "$need_libgtop_support" = yes; then
|
||||
LIBSUPPORT='$(top_builddir)/support/libgtopsupport.la'
|
||||
SUPPORTINCS='-I$(top_srcdir)/support'
|
||||
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 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
|
||||
AC_SUBST(LIBSUPPORT)
|
||||
AC_SUBST(SUPPORTINCS)
|
||||
|
||||
dnl These definitions are expanded in make.
|
||||
GTOP_LIBS='-L$(libdir) -lgtop_common -lgtop '
|
||||
GTOP_INCS='-I$(includedir) -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/include'
|
||||
GTOP_BINDIR='$(bindir)'
|
||||
GTOP_SERVER='$(bindir)/gtop_server'
|
||||
LIBGTOP_LIBS='-L$(libdir) -lgtop'
|
||||
LIBGTOP_INCS='-I$(includedir)'
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_LIBS"
|
||||
LIBGTOP_GUILE_INCS="$LIBGTOP_INCS"
|
||||
LIBGTOP_BINDIR='$(bindir)'
|
||||
LIBGTOP_SERVER='$(bindir)/gtop_server'
|
||||
|
||||
GTOP_INCS="$GTOP_INCS -I\$(top_srcdir)/intl -DGTOPLOCALEDIR=\\\"\$(datadir)/locale\\\""
|
||||
sysdeps_dir="$libgtop_sysdeps_dir"
|
||||
AC_SUBST(sysdeps_dir)
|
||||
|
||||
if test "x$use_glibtop_machine_h" = "xyes" ; then
|
||||
GTOP_INCS="$GTOP_INCS -I\$(top_srcdir)/sysdeps/\$(sysdeps_dir)"
|
||||
if test x$ac_cv_guile_found = xyes ; then
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_guile"
|
||||
libgtop_guile_found=yes
|
||||
else
|
||||
libgtop_guile_found=no
|
||||
fi
|
||||
|
||||
AC_SUBST(libgtop_guile_found)
|
||||
|
||||
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
|
||||
|
||||
AC_SUBST(libgtop_want_guile_names)
|
||||
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_common $libs_xauth"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_common $libs_xauth"
|
||||
|
||||
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
|
||||
GTOP_INCS="$GTOP_INCS $GUILE_INCS"
|
||||
GTOP_LIBS="$GTOP_LIBS $GUILE_LIBS"
|
||||
LIBGTOP_INCS="$LIBGTOP_INCS $GUILE_INCS"
|
||||
LIBGTOP_GUILE_INCS="$LIBGTOP_INCS $GUILE_INCS"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS $GUILE_LIBS"
|
||||
fi
|
||||
|
||||
AC_SUBST(GTOP_LIBS)
|
||||
AC_SUBST(GTOP_INCS)
|
||||
AC_SUBST(GTOP_BINDIR)
|
||||
AC_SUBST(GTOP_SERVER)
|
||||
machine_incs='-I$(top_srcdir)/sysdeps/@sysdeps_dir@'
|
||||
|
||||
AC_SUBST(LIBSUPPORT)
|
||||
AC_SUBST(SUPPORTINCS)
|
||||
AC_SUBST(machine_incs)
|
||||
|
||||
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)
|
||||
|
||||
LIBSUPPORT=
|
||||
SUPPORTINCS=
|
||||
if test "$need_gnome_support" = yes; then
|
||||
if test "x$gnome_found" = xyes ; then
|
||||
LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
|
||||
SUPPORTINCS="$GNOME_INCLUDEDIR"
|
||||
else
|
||||
LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
|
||||
SUPPORTINCS='-DNEED_GNOMESUPPORT_H -I$(top_builddir)/support -I$(top_srcdir)/support'
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
po/Makefile.in
|
||||
intl/Makefile
|
||||
include/Makefile
|
||||
include/glibtop/Makefile
|
||||
sysdeps/Makefile
|
||||
sysdeps/common/Makefile
|
||||
sysdeps/names/Makefile
|
||||
@@ -136,8 +241,11 @@ sysdeps/stub/Makefile
|
||||
sysdeps/sun4/Makefile
|
||||
sysdeps/osf1/Makefile
|
||||
sysdeps/linux/Makefile
|
||||
sysdeps/kernel/Makefile
|
||||
src/Makefile
|
||||
src/server/Makefile
|
||||
src/proxy/Makefile
|
||||
src/daemon/Makefile
|
||||
lib/Makefile
|
||||
examples/Makefile
|
||||
support/Makefile
|
||||
|
@@ -1,15 +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
|
||||
|
22
doc/Makefile
22
doc/Makefile
@@ -1,6 +1,22 @@
|
||||
all: .timestamp
|
||||
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
|
||||
-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
|
||||
|
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>
|
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>
|
1621
doc/libgtop.dsl
1621
doc/libgtop.dsl
File diff suppressed because it is too large
Load Diff
11
examples/ChangeLog
Normal file
11
examples/ChangeLog
Normal file
@@ -0,0 +1,11 @@
|
||||
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,65 +2,52 @@
|
||||
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
INCLUDES = @GTOP_INCS@
|
||||
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@
|
||||
CFLAGS = -Wall -W @CFLAGS@ -O0
|
||||
|
||||
DEFS = @DEFS@
|
||||
|
||||
bin_PROGRAMS = first first_static first_linux \
|
||||
second second_static second_linux \
|
||||
bin_PROGRAMS = first first_static second second_static \
|
||||
@guile_examples@
|
||||
|
||||
EXTRA_PROGRAMS = third third_static third_linux
|
||||
EXTRA_PROGRAMS = third third_static
|
||||
|
||||
first_SOURCES = first.c
|
||||
first_LDADD = $(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/lib/libgtop.la \
|
||||
@INTLLIBS@ @LIBSUPPORT@
|
||||
first_LDADD = $(top_builddir)/lib/libgtop.la \
|
||||
$(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
|
||||
@INTLLIBS@ @LIBSUPPORT@ @libs_xauth@
|
||||
|
||||
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)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/lib/libgtop.la \
|
||||
@INTLLIBS@ @LIBSUPPORT@
|
||||
second_LDADD = $(top_builddir)/lib/libgtop.la \
|
||||
$(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
|
||||
@INTLLIBS@ @LIBSUPPORT@ @libs_xauth@
|
||||
|
||||
second_static_SOURCES = $(second_SOURCES)
|
||||
second_static_LDADD = $(second_LDADD)
|
||||
second_static_LDFLAGS = -static
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
third_SOURCES = third.c
|
||||
third_LDADD = $(top_builddir)/sysdeps/guile/libgtop_guile.la \
|
||||
$(top_builddir)/sysdeps/guile/names/libgtop_guile_names.la \
|
||||
$(top_builddir)/sysdeps/names/libgtop_names.la \
|
||||
$(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(third_guile_names_LIBS) $(third_names_LIBS) \
|
||||
$(top_builddir)/lib/libgtop.la \
|
||||
@GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@
|
||||
$(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
|
||||
@GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@ @libs_xauth@
|
||||
|
||||
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 \
|
||||
$(top_builddir)/sysdeps/guile/names/libgtop_guile_names.la \
|
||||
$(top_builddir)/sysdeps/names/libgtop_names.la \
|
||||
$(top_builddir)/sysdeps/common/libgtop_common.la \
|
||||
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
|
||||
@GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@
|
||||
third_linux_LDFLAGS = -static
|
||||
|
466
examples/first.c
466
examples/first.c
@@ -19,110 +19,145 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/close.h>
|
||||
#include <glibtop/xmalloc.h>
|
||||
|
||||
#include <glibtop/parameter.h>
|
||||
|
||||
#include <glibtop/union.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
#ifndef PROFILE_COUNT
|
||||
#define PROFILE_COUNT 1
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_union data;
|
||||
glibtop_sysdeps sysdeps;
|
||||
unsigned i, *ptr;
|
||||
unsigned c, method, count, port, i, *ptr;
|
||||
char buffer [BUFSIZ];
|
||||
pid_t pid, ppid;
|
||||
|
||||
count = PROFILE_COUNT;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
glibtop_init__r (&glibtop_global_server);
|
||||
glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN);
|
||||
|
||||
glibtop_get_cpu (&data.cpu);
|
||||
glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method));
|
||||
|
||||
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);
|
||||
printf ("Method = %d\n", method);
|
||||
|
||||
glibtop_get_mem (&data.mem);
|
||||
count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ);
|
||||
buffer [count] = 0;
|
||||
|
||||
fprintf (stderr, "Memory (0x%08lx): %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);
|
||||
printf ("Command = '%s'\n", buffer);
|
||||
|
||||
glibtop_get_swap (&data.swap);
|
||||
count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ);
|
||||
buffer [count] = 0;
|
||||
|
||||
fprintf (stderr, "Swap (0x%08lx): %lu, %lu, %lu\n", data.swap.flags,
|
||||
data.swap.total, data.swap.used, data.swap.free);
|
||||
glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port));
|
||||
|
||||
glibtop_get_uptime (&data.uptime);
|
||||
printf ("Host = '%s' - %u\n\n", buffer, port);
|
||||
|
||||
fprintf (stderr, "Uptime (0x%08lx): %f, %f\n", data.uptime.flags,
|
||||
data.uptime.uptime, data.uptime.idletime);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_cpu (&data.cpu);
|
||||
|
||||
glibtop_get_loadavg (&data.loadavg);
|
||||
printf ("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);
|
||||
|
||||
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 < count; c++)
|
||||
glibtop_get_mem (&data.mem);
|
||||
|
||||
glibtop_get_shm_limits (&data.shm_limits);
|
||||
printf ("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 < count; c++)
|
||||
glibtop_get_swap (&data.swap);
|
||||
|
||||
printf ("Swap (0x%08lx): %lu, %lu, %lu\n", data.swap.flags,
|
||||
data.swap.total, data.swap.used, data.swap.free);
|
||||
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_uptime (&data.uptime);
|
||||
|
||||
printf ("Uptime (0x%08lx): %f, %f\n", data.uptime.flags,
|
||||
data.uptime.uptime, data.uptime.idletime);
|
||||
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_loadavg (&data.loadavg);
|
||||
|
||||
printf ("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 < count; c++)
|
||||
glibtop_get_shm_limits (&data.shm_limits);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_msg_limits (&data.msg_limits);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_msg_limits (&data.msg_limits);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_sem_limits (&data.sem_limits);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_sem_limits (&data.sem_limits);
|
||||
|
||||
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 ("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);
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
printf ("\n");
|
||||
|
||||
glibtop_get_sysdeps (&sysdeps);
|
||||
|
||||
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 ("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);
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
printf ("\n");
|
||||
|
||||
ptr = glibtop_get_proclist (&data.proclist);
|
||||
|
||||
fprintf (stderr, "Proclist (0x%08lx): %ld, %ld, %ld\n",
|
||||
data.proclist.flags, data.proclist.number,
|
||||
data.proclist.size, data.proclist.total);
|
||||
printf ("Proclist (0x%08lx): %ld, %ld, %ld\n",
|
||||
data.proclist.flags, data.proclist.number,
|
||||
data.proclist.size, data.proclist.total);
|
||||
|
||||
if (ptr) {
|
||||
fprintf (stderr, "\nProcess: ");
|
||||
printf ("\nProcess: ");
|
||||
for (i = 0; i < data.proclist.number; i++)
|
||||
fprintf (stderr, "%s%u", i ? ", " : "", ptr [i]);
|
||||
fprintf (stderr, "\n");
|
||||
printf ("%s%u", i ? ", " : "", ptr [i]);
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
glibtop_free (ptr);
|
||||
@@ -130,197 +165,218 @@ main (int argc, char *argv [])
|
||||
pid = getpid ();
|
||||
ppid = getppid ();
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
printf ("\n");
|
||||
|
||||
glibtop_get_proc_state (&data.proc_state, pid);
|
||||
for (c = 0; c < count; c++)
|
||||
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);
|
||||
printf ("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);
|
||||
for (c = 0; c < count; c++)
|
||||
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);
|
||||
printf ("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);
|
||||
for (c = 0; c < count; c++)
|
||||
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);
|
||||
printf ("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);
|
||||
for (c = 0; c < count; c++)
|
||||
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);
|
||||
printf ("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);
|
||||
for (c = 0; c < count; c++)
|
||||
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);
|
||||
printf ("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);
|
||||
for (c = 0; c < count; c++)
|
||||
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);
|
||||
printf ("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);
|
||||
for (c = 0; c < count; c++)
|
||||
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);
|
||||
printf ("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");
|
||||
printf ("\n");
|
||||
|
||||
glibtop_get_proc_state (&data.proc_state, ppid);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_state (&data.proc_state, ppid);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_uid (&data.proc_uid, ppid);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_uid (&data.proc_uid, ppid);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_mem (&data.proc_mem, ppid);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_mem (&data.proc_mem, ppid);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_time (&data.proc_time, ppid);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_time (&data.proc_time, ppid);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_signal (&data.proc_signal, ppid);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_signal (&data.proc_signal, ppid);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, ppid);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, ppid);
|
||||
|
||||
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 ("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);
|
||||
|
||||
glibtop_get_proc_segment (&data.proc_segment, ppid);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_segment (&data.proc_segment, ppid);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
printf ("\n");
|
||||
|
||||
glibtop_get_proc_state (&data.proc_state, 1);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_state (&data.proc_state, 1);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_uid (&data.proc_uid, 1);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_uid (&data.proc_uid, 1);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_mem (&data.proc_mem, 1);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_mem (&data.proc_mem, 1);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_time (&data.proc_time, 1);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_time (&data.proc_time, 1);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_signal (&data.proc_signal, 1);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_signal (&data.proc_signal, 1);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, 1);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, 1);
|
||||
|
||||
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 ("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);
|
||||
|
||||
glibtop_get_proc_segment (&data.proc_segment, 1);
|
||||
for (c = 0; c < count; c++)
|
||||
glibtop_get_proc_segment (&data.proc_segment, 1);
|
||||
|
||||
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);
|
||||
printf ("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);
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@
|
||||
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>
|
||||
@@ -39,7 +41,7 @@ main (int argc, char *argv [])
|
||||
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
glibtop_init__r (&glibtop_global_server);
|
||||
glibtop_init ();
|
||||
|
||||
glibtop_get_sysdeps (&sysdeps);
|
||||
|
||||
|
80
examples/test.scm
Normal file
80
examples/test.scm
Normal file
@@ -0,0 +1,80 @@
|
||||
(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)
|
@@ -19,6 +19,8 @@
|
||||
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>
|
||||
@@ -45,7 +47,9 @@ void
|
||||
main_prog (int argc, char *argv[])
|
||||
{
|
||||
glibtop_boot_guile ();
|
||||
#ifdef GLIBTOP_GUILE_NAMES
|
||||
glibtop_boot_guile_names ();
|
||||
#endif
|
||||
|
||||
gh_repl (argc, argv);
|
||||
}
|
||||
|
@@ -1,10 +0,0 @@
|
||||
(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)
|
16
features.def
Normal file
16
features.def
Normal file
@@ -0,0 +1,16 @@
|
||||
cpu ulong(total,user,nice,sys,idle,frequency)
|
||||
mem ulong(total,used,free,shared,buffer,cached,user,locked)
|
||||
swap ulong(total,used,free)
|
||||
uptime double(uptime,idletime)
|
||||
loadavg double(loadavg[0],loadavg[1],loadavg[2])
|
||||
shm_limits ulong(shmmax,shmmin,shmmni,shmseg,shmall)
|
||||
msg_limits ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql)
|
||||
sem_limits ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem)
|
||||
proclist ulong(number,size,total)
|
||||
proc_state str(cmd):char(state):ulong(uid,gid)
|
||||
proc_uid long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice)
|
||||
proc_mem long(size,vsize,resident,share,rss,rss_rlim)
|
||||
proc_time long(start_time,utime,stime,cutime,cstime,timeout,it_real_value)
|
||||
proc_signal long(signal,blocked,sigignore,sigcatch)
|
||||
proc_kernel ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,wchan)
|
||||
proc_segment long(trs,lrs,drs,dt):ulong(start_code,end_code,start_stack)
|
21
glibtop.h
21
glibtop.h
@@ -24,6 +24,9 @@
|
||||
|
||||
#include <glibtop/global.h>
|
||||
|
||||
#include <glibtop_server.h>
|
||||
#include <glibtop/types.h>
|
||||
|
||||
#ifdef HAVE_GLIBTOP_MACHINE_H
|
||||
#include <glibtop_machine.h>
|
||||
#endif
|
||||
@@ -32,22 +35,34 @@ typedef struct _glibtop glibtop;
|
||||
|
||||
struct _glibtop
|
||||
{
|
||||
int fd; /* Server file descriptor */
|
||||
unsigned flags;
|
||||
unsigned method; /* Server Method */
|
||||
#ifdef HAVE_GLIBTOP_MACHINE_H
|
||||
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 */
|
||||
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 */
|
||||
pid_t pid; /* PID of the server */
|
||||
};
|
||||
|
||||
extern glibtop *glibtop_global_server;
|
||||
|
||||
#define glibtop_init() glibtop_init__r(&glibtop_global_server);
|
||||
extern const unsigned long glibtop_server_features;
|
||||
|
||||
extern glibtop *glibtop_init__r __P((glibtop **));
|
||||
#define glibtop_init() glibtop_init_r(&glibtop_global_server, 0, 0);
|
||||
|
||||
#define glibtop_close() glibtop_close_r(&glibtop_global_server);
|
||||
|
||||
extern glibtop *glibtop_init_r __P((glibtop **, const unsigned long, const unsigned));
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
|
@@ -1,17 +0,0 @@
|
||||
#
|
||||
# Configuration of the libgtop package
|
||||
#
|
||||
|
||||
GTOP_LIBDIR="@GTOP_LIBDIR@"
|
||||
GTOP_INCLUDEDIR="@GTOP_INCLUDEDIR@"
|
||||
|
||||
GTOP_LIBS="@GTOP_LIBS@"
|
||||
GTOP_INCS="@GTOP_INCS@"
|
||||
|
||||
GTOP_BINDIR="@GTOP_BINDIR@"
|
||||
GTOP_SERVER="@GTOP_SERVER@"
|
||||
|
||||
GTOP_SYSDEPS_DIR="@GTOP_SYSDEPS_DIR@"
|
||||
GTOP_NEED_SERVER="@GTOP_NEED_SERVER@"
|
||||
GTOP_USE_MACHINE_H="@GTOP_USE_MACHINE_H@"
|
||||
|
1
guile/.cvsignore
Normal file
1
guile/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
reference.sgml
|
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))
|
||||
)
|
2
include/.cvsignore
Normal file
2
include/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
2
include/Makefile.am
Normal file
2
include/Makefile.am
Normal file
@@ -0,0 +1,2 @@
|
||||
SUBDIRS = glibtop
|
||||
|
2
include/glibtop/.cvsignore
Normal file
2
include/glibtop/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
9
include/glibtop/Makefile.am
Normal file
9
include/glibtop/Makefile.am
Normal file
@@ -0,0 +1,9 @@
|
||||
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 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 types.h \
|
||||
parameter.h
|
@@ -26,7 +26,7 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern void glibtop_close __P((glibtop *));
|
||||
extern void glibtop_close_r __P((glibtop *));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@@ -29,6 +29,7 @@ __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
|
||||
@@ -49,18 +50,36 @@ __BEGIN_DECLS
|
||||
|
||||
#define GLIBTOP_MAX_CMND 18
|
||||
|
||||
typedef struct _glibtop_command glibtop_command;
|
||||
#define _GLIBTOP_PARAM_SIZE 16
|
||||
|
||||
typedef struct _glibtop_command glibtop_command;
|
||||
typedef struct _glibtop_response glibtop_response;
|
||||
|
||||
struct _glibtop_command
|
||||
{
|
||||
glibtop server;
|
||||
unsigned command;
|
||||
size_t size;
|
||||
glibtop server;
|
||||
unsigned command;
|
||||
size_t size, data_size;
|
||||
char parameter [_GLIBTOP_PARAM_SIZE];
|
||||
};
|
||||
|
||||
#define glibtop_call(p1, p2, p3, p4) glibtop_call__r(glibtop_global_server, p1, p2, p3, p4)
|
||||
union _glibtop_response_union
|
||||
{
|
||||
glibtop_union data;
|
||||
glibtop_sysdeps sysdeps;
|
||||
};
|
||||
|
||||
extern void *glibtop_call__r __P((glibtop *, unsigned, size_t, void *, size_t, void *));
|
||||
struct _glibtop_response
|
||||
{
|
||||
off_t offset;
|
||||
size_t size, data_size;
|
||||
union _glibtop_response_union u;
|
||||
};
|
||||
|
||||
#define glibtop_call(p1, p2, p3, p4) glibtop_call_r(glibtop_global_server, p1, p2, p3, p4)
|
||||
|
||||
extern void *glibtop_call_l __P((glibtop *, unsigned, size_t, void *, size_t, void *));
|
||||
extern void *glibtop_call_s __P((glibtop *, unsigned, size_t, void *, size_t, void *));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@@ -49,9 +49,21 @@ struct _glibtop_cpu
|
||||
frequency; /* GLIBTOP_CPU_FREQUENCY */
|
||||
};
|
||||
|
||||
#define glibtop_get_cpu(cpu) glibtop_get_cpu__r(glibtop_global_server, cpu)
|
||||
#define glibtop_get_cpu(cpu) glibtop_get_cpu_l(glibtop_global_server, cpu)
|
||||
|
||||
extern void glibtop_get_cpu__r __P((glibtop *, glibtop_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_l __P((glibtop *, glibtop_cpu *));
|
||||
|
||||
#if GLIBTOP_SUID_CPU
|
||||
extern void glibtop_get_cpu_p __P((glibtop *, glibtop_cpu *));
|
||||
#else
|
||||
extern void glibtop_get_cpu_s __P((glibtop *, glibtop_cpu *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -77,7 +89,7 @@ extern SCM glibtop_guile_descriptions_cpu __P((void));
|
||||
/* 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 unsigned glibtop_types_cpu [];
|
||||
extern const char *glibtop_labels_cpu [];
|
||||
extern const char *glibtop_descriptions_cpu [];
|
||||
|
||||
|
@@ -26,9 +26,17 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define glibtop_error(p1, args...) glibtop_error__r(glibtop_global_server , p1 , ## args)
|
||||
#define glibtop_error(p1, args...) glibtop_error_r(glibtop_global_server , p1 , ## args)
|
||||
#define glibtop_warn(p1, args...) glibtop_warn_r(glibtop_global_server , p1 , ## args)
|
||||
|
||||
extern void glibtop_error__r __P((glibtop *, char *, ...));
|
||||
#define glibtop_error_io(p1, args...) glibtop_error_io_r(glibtop_global_server , p1 , ## args)
|
||||
#define glibtop_warn_io(p1, args...) glibtop_warn_io_r(glibtop_global_server , p1 , ## args)
|
||||
|
||||
extern void glibtop_error_r __P((glibtop *, char *, ...));
|
||||
extern void glibtop_warn_r __P((glibtop *, char *, ...));
|
||||
|
||||
extern void glibtop_error_io_r __P((glibtop *, char *, ...));
|
||||
extern void glibtop_warn_io_r __P((glibtop *, char *, ...));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@@ -51,21 +51,42 @@
|
||||
# define __P(protos) ()
|
||||
#endif
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef WITHOUT_GUILE
|
||||
#undef HAVE_GUILE
|
||||
#undef GLIBTOP_GUILE_NAMES
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
#include <guile/gh.h>
|
||||
#endif
|
||||
|
||||
#ifdef _IN_LIBGTOP
|
||||
#if (defined HAVE_LIBINTL_H) || (defined HAVE_GETTEXT)
|
||||
#include <libintl.h>
|
||||
#else
|
||||
#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>
|
||||
@@ -73,7 +94,9 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
193
include/glibtop/gnuserv.h
Normal file
193
include/glibtop/gnuserv.h
Normal file
@@ -0,0 +1,193 @@
|
||||
/* -*-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>
|
||||
#include <glibtop/error.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 SYSV_IPC
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#define MCOOKIE_SCREEN "42980" /* screen # to use as the gnuserv cookie */
|
||||
#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(SYSV_IPC) && !defined(UNIX_DOMAIN_SOCKETS) && !defined(INTERNET_DOMAIN_SOCKETS)
|
||||
|
||||
#ifdef HAVE_SYSVIPC
|
||||
#define SYSV_IPC /* SYSV systems use SYSV IPC by default */
|
||||
#endif /* HAVE_SYSVIPC */
|
||||
|
||||
#ifdef BSD
|
||||
#define UNIX_DOMAIN_SOCKETS /* BSD systems use Unix Domain sockets by default */
|
||||
#endif /* BSD */
|
||||
|
||||
#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.
|
||||
*/
|
||||
|
||||
# define GSERV_BUFSZ BUFSIZ
|
||||
|
||||
|
||||
#ifdef SYSV_IPC
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/msg.h>
|
||||
|
||||
#define send_string(s,str) \
|
||||
if (strlen(msgp->mtext) + strlen(str) < GSERV_BUFSZ) \
|
||||
strcat(msgp->mtext,str); \
|
||||
else \
|
||||
{ \
|
||||
fprintf(stderr,"%s: not enough message buffer space\n",progname); \
|
||||
exit(1); \
|
||||
} \
|
||||
|
||||
#endif /* SYSV_IPC */
|
||||
|
||||
#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
|
||||
|
||||
// extern char *optarg;
|
||||
// extern int optind;
|
||||
|
||||
/* 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 */
|
||||
extern int glibtop_make_connection __P((const char *, int, int *));
|
||||
|
||||
#ifdef SYSV_IPC
|
||||
void disconnect_from_ipc_server();
|
||||
#endif
|
||||
|
||||
#if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS)
|
||||
// void send_string (int s, const char *msg);
|
||||
// void disconnect_from_server (int s, int echo);
|
||||
// int read_line (int s, char *dest);
|
||||
#endif
|
||||
|
||||
#ifdef INTERNET_DOMAIN_SOCKETS
|
||||
extern long glibtop_internet_addr __P((const char *));
|
||||
#endif
|
@@ -39,9 +39,21 @@ struct _glibtop_loadavg
|
||||
double loadavg [3]; /* GLIBTOP_LOADAVG_LOADAVG */
|
||||
};
|
||||
|
||||
#define glibtop_get_loadavg(loadavg) glibtop_get_loadavg__r(glibtop_global_server, loadavg)
|
||||
#define glibtop_get_loadavg(loadavg) glibtop_get_loadavg_l(glibtop_global_server, loadavg)
|
||||
|
||||
extern void glibtop_get_loadavg__r __P((glibtop *, glibtop_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_l __P((glibtop *, glibtop_loadavg *));
|
||||
|
||||
#if GLIBTOP_SUID_LOADAVG
|
||||
extern void glibtop_get_loadavg_p __P((glibtop *, glibtop_loadavg *));
|
||||
#else
|
||||
extern void glibtop_get_loadavg_s __P((glibtop *, glibtop_loadavg *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -67,7 +79,7 @@ extern SCM glibtop_guile_descriptions_loadavg __P((void));
|
||||
/* 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 unsigned glibtop_types_loadavg [];
|
||||
extern const char *glibtop_labels_loadavg [];
|
||||
extern const char *glibtop_descriptions_loadavg [];
|
||||
|
||||
|
@@ -34,8 +34,9 @@ __BEGIN_DECLS
|
||||
#define GLIBTOP_MEM_BUFFER 4
|
||||
#define GLIBTOP_MEM_CACHED 5
|
||||
#define GLIBTOP_MEM_USER 6
|
||||
#define GLIBTOP_MEM_LOCKED 7
|
||||
|
||||
#define GLIBTOP_MAX_MEM 7
|
||||
#define GLIBTOP_MAX_MEM 8
|
||||
|
||||
typedef struct _glibtop_mem glibtop_mem;
|
||||
|
||||
@@ -48,12 +49,25 @@ struct _glibtop_mem
|
||||
shared, /* GLIBTOP_MEM_SHARED */
|
||||
buffer, /* GLIBTOP_MEM_BUFFER */
|
||||
cached, /* GLIBTOP_MEM_CACHED */
|
||||
user; /* GLIBTOP_MEM_USER */
|
||||
user, /* GLIBTOP_MEM_USER */
|
||||
locked; /* GLIBTOP_MEM_LOCKED */
|
||||
};
|
||||
|
||||
#define glibtop_get_mem(mem) glibtop_get_mem__r(glibtop_global_server, mem)
|
||||
#define glibtop_get_mem(mem) glibtop_get_mem_l(glibtop_global_server, mem)
|
||||
|
||||
extern void glibtop_get_mem__r __P((glibtop *, glibtop_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_l __P((glibtop *, glibtop_mem *));
|
||||
|
||||
#if GLIBTOP_SUID_MEM
|
||||
extern void glibtop_get_mem_p __P((glibtop *, glibtop_mem *));
|
||||
#else
|
||||
extern void glibtop_get_mem_s __P((glibtop *, glibtop_mem *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -79,7 +93,7 @@ extern SCM glibtop_guile_descriptions_mem __P((void));
|
||||
/* 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 unsigned glibtop_types_mem [];
|
||||
extern const char *glibtop_labels_mem [];
|
||||
extern const char *glibtop_descriptions_mem [];
|
||||
|
||||
|
@@ -51,9 +51,21 @@ struct _glibtop_msg_limits
|
||||
msgtql; /* GLIBTOP_IPC_MSGTQL */
|
||||
};
|
||||
|
||||
#define glibtop_get_msg_limits(msg) glibtop_get_msg_limits__r(glibtop_global_server, msg)
|
||||
#define glibtop_get_msg_limits(msg) glibtop_get_msg_limits_l(glibtop_global_server, msg)
|
||||
|
||||
extern void glibtop_get_msg_limits__r __P((glibtop *, glibtop_msg_limits *));
|
||||
#if GLIBTOP_SUID_MSG_LIMITS
|
||||
#define glibtop_get_msg_limits_r glibtop_get_msg_limits_p
|
||||
#else
|
||||
#define glibtop_get_msg_limits_r glibtop_get_msg_limits_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_msg_limits_l __P((glibtop *, glibtop_msg_limits *));
|
||||
|
||||
#if GLIBTOP_SUID_MSG_LIMITS
|
||||
extern void glibtop_get_msg_limits_p __P((glibtop *, glibtop_msg_limits *));
|
||||
#else
|
||||
extern void glibtop_get_msg_limits_s __P((glibtop *, glibtop_msg_limits *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -79,7 +91,7 @@ extern SCM glibtop_guile_descriptions_msg_limits __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_msg_limits [];
|
||||
extern const char *glibtop_types_msg_limits [];
|
||||
extern const unsigned glibtop_types_msg_limits [];
|
||||
extern const char *glibtop_labels_msg_limits [];
|
||||
extern const char *glibtop_descriptions_msg_limits [];
|
||||
|
||||
|
@@ -26,7 +26,22 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern void glibtop_open __P((glibtop *, const char *));
|
||||
#define _GLIBTOP_INIT_STATE_INIT 0x10000
|
||||
#define _GLIBTOP_INIT_STATE_OPEN 0x20000
|
||||
#define _GLIBTOP_INIT_STATE_SERVER 0x40000
|
||||
|
||||
#define GLIBTOP_INIT_NO_OPEN 1
|
||||
#define GLIBTOP_INIT_NO_INIT 2
|
||||
|
||||
#define GLIBTOP_OPEN_NO_OVERRIDE 1
|
||||
|
||||
#define GLIBTOP_METHOD_DIRECT 1
|
||||
#define GLIBTOP_METHOD_PIPE 2
|
||||
#define GLIBTOP_METHOD_INET 3
|
||||
|
||||
extern void glibtop_open_l __P((glibtop *, const char *, const unsigned long, const unsigned));
|
||||
|
||||
extern void glibtop_open_r __P((glibtop *, const char *, const unsigned long, const unsigned));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/* $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.
|
||||
@@ -19,34 +17,26 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef __GLIBTOP_PARAMETER_H__
|
||||
#define __GLIBTOP_PARAMETER_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/xmalloc.h>
|
||||
#include <glibtop/proclist.h>
|
||||
#include <glibtop/open.h>
|
||||
|
||||
#include <guile/gh.h>
|
||||
__BEGIN_DECLS
|
||||
|
||||
SCM
|
||||
glibtop_guile_get_proclist (void)
|
||||
{
|
||||
glibtop_proclist proclist;
|
||||
unsigned *ptr;
|
||||
unsigned i;
|
||||
SCM list;
|
||||
#define GLIBTOP_PARAM_METHOD 1
|
||||
#define GLIBTOP_PARAM_FEATURES 2
|
||||
#define GLIBTOP_PARAM_COMMAND 3
|
||||
#define GLIBTOP_PARAM_HOST 4
|
||||
#define GLIBTOP_PARAM_PORT 5
|
||||
|
||||
ptr = glibtop_get_proclist (&proclist);
|
||||
#define glibtop_get_parameter(p1,p2,p3) glibtop_get_parameter_l(glibtop_global_server,p1,p2,p3)
|
||||
#define glibtop_set_parameter(p1,p2,p3) glibtop_set_parameter_l(glibtop_global_server,p1,p2,p3)
|
||||
|
||||
list = gh_list (gh_ulong2scm (proclist.flags),
|
||||
gh_ulong2scm (proclist.number),
|
||||
gh_ulong2scm (proclist.size),
|
||||
gh_ulong2scm (proclist.total),
|
||||
SCM_UNDEFINED);
|
||||
extern size_t glibtop_get_parameter_l __P((glibtop *, const unsigned, void *, size_t));
|
||||
extern void glibtop_set_parameter_l __P((glibtop *, const unsigned, const void *, size_t));
|
||||
|
||||
if (ptr) {
|
||||
for (i = 0; i < proclist.number; i++)
|
||||
list = gh_append2 (list, gh_list (gh_ulong2scm ((unsigned long) ptr [i]), SCM_UNDEFINED));
|
||||
}
|
||||
__END_DECLS
|
||||
|
||||
glibtop_free (ptr);
|
||||
|
||||
return list;
|
||||
}
|
||||
#endif
|
@@ -60,9 +60,21 @@ struct _glibtop_proc_kernel
|
||||
* proc is sleeping in */
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_kernel(p1, p2) glibtop_get_proc_kernel__r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_get_proc_kernel(p1, p2) glibtop_get_proc_kernel_l(glibtop_global_server, p1, p2)
|
||||
|
||||
extern void glibtop_get_proc_kernel__r __P((glibtop *, glibtop_proc_kernel *, pid_t));
|
||||
#if GLIBTOP_SUID_PROC_KERNEL
|
||||
#define glibtop_get_proc_kernel_r glibtop_get_proc_kernel_p
|
||||
#else
|
||||
#define glibtop_get_proc_kernel_r glibtop_get_proc_kernel_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_proc_kernel_l __P((glibtop *, glibtop_proc_kernel *, pid_t));
|
||||
|
||||
#if GLIBTOP_SUID_PROC_KERNEL
|
||||
extern void glibtop_get_proc_kernel_p __P((glibtop *, glibtop_proc_kernel *, pid_t));
|
||||
#else
|
||||
extern void glibtop_get_proc_kernel_s __P((glibtop *, glibtop_proc_kernel *, pid_t));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -87,8 +99,8 @@ extern SCM glibtop_guile_descriptions_proc_kernel __P((void));
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_types_proc_kernel [];
|
||||
extern const char *glibtop_names_proc_kernel [];
|
||||
extern const unsigned glibtop_types_proc_kernel [];
|
||||
extern const char *glibtop_labels_proc_kernel [];
|
||||
extern const char *glibtop_descriptions_proc_kernel [];
|
||||
|
||||
|
@@ -43,9 +43,21 @@ struct _glibtop_proclist
|
||||
size; /* GLIBTOP_PROCLIST_SIZE */
|
||||
};
|
||||
|
||||
#define glibtop_get_proclist(proclist) glibtop_get_proclist__r(glibtop_global_server, proclist)
|
||||
#define glibtop_get_proclist(proclist) glibtop_get_proclist_l(glibtop_global_server, proclist)
|
||||
|
||||
extern unsigned *glibtop_get_proclist__r __P((glibtop *, glibtop_proclist *));
|
||||
#if GLIBTOP_SUID_PROCLIST
|
||||
#define glibtop_get_proclist_r glibtop_get_proclist_p
|
||||
#else
|
||||
#define glibtop_get_proclist_r glibtop_get_proclist_s
|
||||
#endif
|
||||
|
||||
extern unsigned *glibtop_get_proclist_l __P((glibtop *, glibtop_proclist *));
|
||||
|
||||
#if GLIBTOP_SUID_PROCLIST
|
||||
extern unsigned *glibtop_get_proclist_p __P((glibtop *, glibtop_proclist *));
|
||||
#else
|
||||
extern unsigned *glibtop_get_proclist_s __P((glibtop *, glibtop_proclist *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -71,7 +83,7 @@ extern SCM glibtop_guile_descriptions_proclist __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proclist [];
|
||||
extern const char *glibtop_types_proclist [];
|
||||
extern const unsigned glibtop_types_proclist [];
|
||||
extern const char *glibtop_labels_proclist [];
|
||||
extern const char *glibtop_descriptions_proclist [];
|
||||
|
||||
|
@@ -53,9 +53,21 @@ struct _glibtop_proc_mem
|
||||
* of the process; usually 2,147,483,647 */
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_mem(p1, p2) glibtop_get_proc_mem__r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_get_proc_mem(p1, p2) glibtop_get_proc_mem_l(glibtop_global_server, p1, p2)
|
||||
|
||||
extern void glibtop_get_proc_mem__r __P((glibtop *, glibtop_proc_mem *, pid_t));
|
||||
#if GLIBTOP_SUID_PROC_MEM
|
||||
#define glibtop_get_proc_mem_r glibtop_get_proc_mem_p
|
||||
#else
|
||||
#define glibtop_get_proc_mem_r glibtop_get_proc_mem_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_proc_mem_l __P((glibtop *, glibtop_proc_mem *, pid_t));
|
||||
|
||||
#if GLIBTOP_SUID_PROC_MEM
|
||||
extern void glibtop_get_proc_mem_p __P((glibtop *, glibtop_proc_mem *, pid_t));
|
||||
#else
|
||||
extern void glibtop_get_proc_mem_s __P((glibtop *, glibtop_proc_mem *, pid_t));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -81,7 +93,7 @@ extern SCM glibtop_guile_descriptions_proc_mem __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_mem [];
|
||||
extern const char *glibtop_types_proc_mem [];
|
||||
extern const unsigned glibtop_types_proc_mem [];
|
||||
extern const char *glibtop_labels_proc_mem [];
|
||||
extern const char *glibtop_descriptions_proc_mem [];
|
||||
|
||||
|
@@ -54,9 +54,21 @@ struct _glibtop_proc_segment
|
||||
start_stack; /* address of the bottom of stack segment */
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_segment(p1, p2) glibtop_get_proc_segment__r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_get_proc_segment(p1, p2) glibtop_get_proc_segment_l(glibtop_global_server, p1, p2)
|
||||
|
||||
extern void glibtop_get_proc_segment__r __P((glibtop *, glibtop_proc_segment *, pid_t));
|
||||
#if GLIBTOP_SUID_PROC_SEGMENT
|
||||
#define glibtop_get_proc_segment_r glibtop_get_proc_segment_p
|
||||
#else
|
||||
#define glibtop_get_proc_segment_r glibtop_get_proc_segment_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_proc_segment_l __P((glibtop *, glibtop_proc_segment *, pid_t));
|
||||
|
||||
#if GLIBTOP_SUID_PROC_SEGMENT
|
||||
extern void glibtop_get_proc_segment_p __P((glibtop *, glibtop_proc_segment *, pid_t));
|
||||
#else
|
||||
extern void glibtop_get_proc_segment_s __P((glibtop *, glibtop_proc_segment *, pid_t));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -81,8 +93,8 @@ extern SCM glibtop_guile_descriptions_proc_segment __P((void));
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_types_proc_segment [];
|
||||
extern const char *glibtop_names_proc_segment [];
|
||||
extern const unsigned glibtop_types_proc_segment [];
|
||||
extern const char *glibtop_labels_proc_segment [];
|
||||
extern const char *glibtop_descriptions_proc_segment [];
|
||||
|
||||
|
@@ -47,9 +47,21 @@ struct _glibtop_proc_signal
|
||||
sigcatch; /* mask of caught signals */
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_signal(p1, p2) glibtop_get_proc_signal__r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_get_proc_signal(p1, p2) glibtop_get_proc_signal_l(glibtop_global_server, p1, p2)
|
||||
|
||||
extern void glibtop_get_proc_signal__r __P((glibtop *, glibtop_proc_signal *, pid_t));
|
||||
#if GLIBTOP_SUID_PROC_SIGNAL
|
||||
#define glibtop_get_proc_signal_r glibtop_get_proc_signal_p
|
||||
#else
|
||||
#define glibtop_get_proc_signal_r glibtop_get_proc_signal_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_proc_signal_l __P((glibtop *, glibtop_proc_signal *, pid_t));
|
||||
|
||||
#if GLIBTOP_SUID_PROC_SIGNAL
|
||||
extern void glibtop_get_proc_signal_p __P((glibtop *, glibtop_proc_signal *, pid_t));
|
||||
#else
|
||||
extern void glibtop_get_proc_signal_s __P((glibtop *, glibtop_proc_signal *, pid_t));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -75,7 +87,7 @@ extern SCM glibtop_guile_descriptions_proc_signal __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_signal [];
|
||||
extern const char *glibtop_types_proc_signal [];
|
||||
extern const unsigned glibtop_types_proc_signal [];
|
||||
extern const char *glibtop_labels_proc_signal [];
|
||||
extern const char *glibtop_descriptions_proc_signal [];
|
||||
|
||||
|
@@ -54,9 +54,21 @@ struct _glibtop_proc_state
|
||||
gid; /* GID of process */
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_state(p1, p2) glibtop_get_proc_state__r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_get_proc_state(p1, p2) glibtop_get_proc_state_l(glibtop_global_server, p1, p2)
|
||||
|
||||
extern void glibtop_get_proc_state__r __P((glibtop *, glibtop_proc_state *, pid_t));
|
||||
#if GLIBTOP_SUID_PROC_STATE
|
||||
#define glibtop_get_proc_state_r glibtop_get_proc_state_p
|
||||
#else
|
||||
#define glibtop_get_proc_state_r glibtop_get_proc_state_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_proc_state_l __P((glibtop *, glibtop_proc_state *, pid_t));
|
||||
|
||||
#if GLIBTOP_SUID_PROC_STATE
|
||||
extern void glibtop_get_proc_state_p __P((glibtop *, glibtop_proc_state *, pid_t));
|
||||
#else
|
||||
extern void glibtop_get_proc_state_s __P((glibtop *, glibtop_proc_state *, pid_t));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -82,7 +94,7 @@ extern SCM glibtop_guile_descriptions_proc_state __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_state [];
|
||||
extern const char *glibtop_types_proc_state [];
|
||||
extern const unsigned glibtop_types_proc_state [];
|
||||
extern const char *glibtop_labels_proc_state [];
|
||||
extern const char *glibtop_descriptions_proc_state [];
|
||||
|
||||
|
@@ -59,9 +59,21 @@ struct _glibtop_proc_time
|
||||
* due to an interval timer. */
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_time(p1, p2) glibtop_get_proc_time__r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_get_proc_time(p1, p2) glibtop_get_proc_time_l(glibtop_global_server, p1, p2)
|
||||
|
||||
extern void glibtop_get_proc_time__r __P((glibtop *, glibtop_proc_time *, pid_t));
|
||||
#if GLIBTOP_SUID_PROC_TIME
|
||||
#define glibtop_get_proc_time_r glibtop_get_proc_time_p
|
||||
#else
|
||||
#define glibtop_get_proc_time_r glibtop_get_proc_time_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_proc_time_l __P((glibtop *, glibtop_proc_time *, pid_t));
|
||||
|
||||
#if GLIBTOP_SUID_PROC_TIME
|
||||
extern void glibtop_get_proc_time_p __P((glibtop *, glibtop_proc_time *, pid_t));
|
||||
#else
|
||||
extern void glibtop_get_proc_time_s __P((glibtop *, glibtop_proc_time *, pid_t));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -87,7 +99,7 @@ extern SCM glibtop_guile_descriptions_proc_time __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_time [];
|
||||
extern const char *glibtop_types_proc_time [];
|
||||
extern const unsigned glibtop_types_proc_time [];
|
||||
extern const char *glibtop_labels_proc_time [];
|
||||
extern const char *glibtop_descriptions_proc_time [];
|
||||
|
||||
|
@@ -63,9 +63,21 @@ struct _glibtop_proc_uid
|
||||
nice; /* standard unix nice level of process */
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_uid(p1, p2) glibtop_get_proc_uid__r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_get_proc_uid(p1, p2) glibtop_get_proc_uid_l(glibtop_global_server, p1, p2)
|
||||
|
||||
extern void glibtop_get_proc_uid__r __P((glibtop *, glibtop_proc_uid *, pid_t));
|
||||
#if GLIBTOP_SUID_PROC_UID
|
||||
#define glibtop_get_proc_uid_r glibtop_get_proc_uid_p
|
||||
#else
|
||||
#define glibtop_get_proc_uid_r glibtop_get_proc_uid_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_proc_uid_l __P((glibtop *, glibtop_proc_uid *, pid_t));
|
||||
|
||||
#if GLIBTOP_SUID_PROC_UID
|
||||
extern void glibtop_get_proc_uid_p __P((glibtop *, glibtop_proc_uid *, pid_t));
|
||||
#else
|
||||
extern void glibtop_get_proc_uid_s __P((glibtop *, glibtop_proc_uid *, pid_t));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -91,7 +103,7 @@ extern SCM glibtop_guile_descriptions_proc_uid __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_uid [];
|
||||
extern const char *glibtop_types_proc_uid [];
|
||||
extern const unsigned glibtop_types_proc_uid [];
|
||||
extern const char *glibtop_labels_proc_uid [];
|
||||
extern const char *glibtop_descriptions_proc_uid [];
|
||||
|
||||
|
@@ -29,7 +29,8 @@ __BEGIN_DECLS
|
||||
|
||||
#define glibtop_read(p1, p2) glibtop_read(glibtop_global_server, p1, p2)
|
||||
|
||||
extern void glibtop_read__r __P((glibtop *, size_t, void *));
|
||||
extern void glibtop_read_l __P((glibtop *, size_t, void *));
|
||||
extern void glibtop_read_s __P((glibtop *, size_t, void *));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@@ -27,9 +27,10 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define glibtop_read_data() glibtop_read_data__r(glibtop_global_server)
|
||||
#define glibtop_read_data() glibtop_read_data_r(glibtop_global_server)
|
||||
|
||||
extern void *glibtop_read_data__r __P((glibtop *));
|
||||
extern void *glibtop_read_data_l __P((glibtop *));
|
||||
extern void *glibtop_read_data_s __P((glibtop *));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@@ -57,9 +57,21 @@ struct _glibtop_sem_limits
|
||||
semaem; /* GLIBTOP_IPC_SEMAEM */
|
||||
};
|
||||
|
||||
#define glibtop_get_sem_limits(sem) glibtop_get_sem_limits__r(glibtop_global_server, sem)
|
||||
#define glibtop_get_sem_limits(sem) glibtop_get_sem_limits_l(glibtop_global_server, sem)
|
||||
|
||||
extern void glibtop_get_sem_limits__r __P((glibtop *, glibtop_sem_limits *));
|
||||
#if GLIBTOP_SUID_SEM_LIMITS
|
||||
#define glibtop_get_sem_limits_r glibtop_get_sem_limits_p
|
||||
#else
|
||||
#define glibtop_get_sem_limits_r glibtop_get_sem_limits_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_sem_limits_l __P((glibtop *, glibtop_sem_limits *));
|
||||
|
||||
#if GLIBTOP_SUID_SEM_LIMITS
|
||||
extern void glibtop_get_sem_limits_p __P((glibtop *, glibtop_sem_limits *));
|
||||
#else
|
||||
extern void glibtop_get_sem_limits_s __P((glibtop *, glibtop_sem_limits *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -85,7 +97,7 @@ extern SCM glibtop_guile_descriptions_sem_limits __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_sem_limits [];
|
||||
extern const char *glibtop_types_sem_limits [];
|
||||
extern const unsigned glibtop_types_sem_limits [];
|
||||
extern const char *glibtop_labels_sem_limits [];
|
||||
extern const char *glibtop_descriptions_sem_limits [];
|
||||
|
||||
|
@@ -47,9 +47,21 @@ struct _glibtop_shm_limits
|
||||
shmall; /* GLIBTOP_IPC_SHMALL */
|
||||
};
|
||||
|
||||
#define glibtop_get_shm_limits(shm) glibtop_get_shm_limits__r(glibtop_global_server, shm)
|
||||
#define glibtop_get_shm_limits(shm) glibtop_get_shm_limits_l(glibtop_global_server, shm)
|
||||
|
||||
extern void glibtop_get_shm_limits__r __P((glibtop *, glibtop_shm_limits *));
|
||||
#if GLIBTOP_SUID_SHM_LIMITS
|
||||
#define glibtop_get_shm_limits_r glibtop_get_shm_limits_p
|
||||
#else
|
||||
#define glibtop_get_shm_limits_r glibtop_get_shm_limits_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_shm_limits_l __P((glibtop *, glibtop_shm_limits *));
|
||||
|
||||
#if GLIBTOP_SUID_SHM_LIMITS
|
||||
extern void glibtop_get_shm_limits_p __P((glibtop *, glibtop_shm_limits *));
|
||||
#else
|
||||
extern void glibtop_get_shm_limits_s __P((glibtop *, glibtop_shm_limits *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -75,7 +87,7 @@ extern SCM glibtop_guile_descriptions_shm_limits __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_shm_limits [];
|
||||
extern const char *glibtop_types_shm_limits [];
|
||||
extern const unsigned glibtop_types_shm_limits [];
|
||||
extern const char *glibtop_labels_shm_limits [];
|
||||
extern const char *glibtop_descriptions_shm_limits [];
|
||||
|
||||
|
@@ -43,9 +43,21 @@ struct _glibtop_swap
|
||||
free; /* GLIBTOP_SWAP_FREE */
|
||||
};
|
||||
|
||||
#define glibtop_get_swap(swap) glibtop_get_swap__r(glibtop_global_server, swap)
|
||||
#define glibtop_get_swap(swap) glibtop_get_swap_l(glibtop_global_server, swap)
|
||||
|
||||
extern void glibtop_get_swap__r __P((glibtop *, glibtop_swap *));
|
||||
#if GLIBTOP_SUID_SWAP
|
||||
#define glibtop_get_swap_r glibtop_get_swap_p
|
||||
#else
|
||||
#define glibtop_get_swap_r glibtop_get_swap_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_swap_l __P((glibtop *, glibtop_swap *));
|
||||
|
||||
#if GLIBTOP_SUID_SWAP
|
||||
extern void glibtop_get_swap_p __P((glibtop *, glibtop_swap *));
|
||||
#else
|
||||
extern void glibtop_get_swap_s __P((glibtop *, glibtop_swap *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -71,7 +83,7 @@ extern SCM glibtop_guile_descriptions_swap __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_swap [];
|
||||
extern const char *glibtop_types_swap [];
|
||||
extern const unsigned glibtop_types_swap [];
|
||||
extern const char *glibtop_labels_swap [];
|
||||
extern const char *glibtop_descriptions_swap [];
|
||||
|
||||
|
@@ -27,30 +27,34 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define GLIBTOP_SYSDEPS_CPU 0
|
||||
#define GLIBTOP_SYSDEPS_MEM 1
|
||||
#define GLIBTOP_SYSDEPS_SWAP 2
|
||||
#define GLIBTOP_SYSDEPS_UPTIME 3
|
||||
#define GLIBTOP_SYSDEPS_LOADAVG 4
|
||||
#define GLIBTOP_SYSDEPS_SHM_LIMITS 5
|
||||
#define GLIBTOP_SYSDEPS_MSG_LIMITS 6
|
||||
#define GLIBTOP_SYSDEPS_SEM_LIMITS 7
|
||||
#define GLIBTOP_SYSDEPS_PROCLIST 8
|
||||
#define GLIBTOP_SYSDEPS_PROC_STATE 9
|
||||
#define GLIBTOP_SYSDEPS_PROC_UID 10
|
||||
#define GLIBTOP_SYSDEPS_PROC_MEM 11
|
||||
#define GLIBTOP_SYSDEPS_PROC_TIME 12
|
||||
#define GLIBTOP_SYSDEPS_PROC_SIGNAL 13
|
||||
#define GLIBTOP_SYSDEPS_PROC_KERNEL 14
|
||||
#define GLIBTOP_SYSDEPS_PROC_SEGMENT 15
|
||||
#define GLIBTOP_SYSDEPS_FEATURES 0
|
||||
#define GLIBTOP_SYSDEPS_CPU 1
|
||||
#define GLIBTOP_SYSDEPS_MEM 2
|
||||
#define GLIBTOP_SYSDEPS_SWAP 3
|
||||
#define GLIBTOP_SYSDEPS_UPTIME 4
|
||||
#define GLIBTOP_SYSDEPS_LOADAVG 5
|
||||
#define GLIBTOP_SYSDEPS_SHM_LIMITS 6
|
||||
#define GLIBTOP_SYSDEPS_MSG_LIMITS 7
|
||||
#define GLIBTOP_SYSDEPS_SEM_LIMITS 8
|
||||
#define GLIBTOP_SYSDEPS_PROCLIST 9
|
||||
#define GLIBTOP_SYSDEPS_PROC_STATE 10
|
||||
#define GLIBTOP_SYSDEPS_PROC_UID 11
|
||||
#define GLIBTOP_SYSDEPS_PROC_MEM 12
|
||||
#define GLIBTOP_SYSDEPS_PROC_TIME 13
|
||||
#define GLIBTOP_SYSDEPS_PROC_SIGNAL 14
|
||||
#define GLIBTOP_SYSDEPS_PROC_KERNEL 15
|
||||
#define GLIBTOP_SYSDEPS_PROC_SEGMENT 16
|
||||
|
||||
#define GLIBTOP_MAX_SYSDEPS 16
|
||||
#define GLIBTOP_MAX_SYSDEPS 17
|
||||
|
||||
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
|
||||
|
||||
typedef struct _glibtop_sysdeps glibtop_sysdeps;
|
||||
|
||||
struct _glibtop_sysdeps
|
||||
{
|
||||
unsigned long flags,
|
||||
features, /* server features */
|
||||
cpu, /* glibtop_cpu */
|
||||
mem, /* glibtop_mem */
|
||||
swap, /* glibtop_swap */
|
||||
@@ -69,9 +73,9 @@ struct _glibtop_sysdeps
|
||||
proc_segment; /* glibtop_proc_segment */
|
||||
};
|
||||
|
||||
#define glibtop_get_sysdeps(sysdeps) glibtop_get_sysdeps__r(glibtop_global_server,sysdeps)
|
||||
#define glibtop_get_sysdeps(sysdeps) glibtop_get_sysdeps_r(glibtop_global_server,sysdeps)
|
||||
|
||||
extern void glibtop_get_sysdeps__r __P((glibtop *, glibtop_sysdeps *));
|
||||
extern void glibtop_get_sysdeps_r __P((glibtop *, glibtop_sysdeps *));
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -97,7 +101,7 @@ extern SCM glibtop_guile_descriptions_sysdeps __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_sysdeps [];
|
||||
extern const char *glibtop_types_sysdeps [];
|
||||
extern const unsigned glibtop_types_sysdeps [];
|
||||
extern const char *glibtop_labels_sysdeps [];
|
||||
extern const char *glibtop_descriptions_sysdeps [];
|
||||
|
||||
|
36
include/glibtop/types.h
Normal file
36
include/glibtop/types.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef __GLIBTOP_TYPES_H__
|
||||
#define __GLIBTOP_TYPES_H__
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define GLIBTOP_TYPE_LONG 1
|
||||
#define GLIBTOP_TYPE_ULONG 2
|
||||
#define GLIBTOP_TYPE_DOUBLE 3
|
||||
#define GLIBTOP_TYPE_INT 4
|
||||
#define GLIBTOP_TYPE_CHAR 5
|
||||
#define GLIBTOP_TYPE_STRING 6
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
@@ -41,9 +41,21 @@ struct _glibtop_uptime
|
||||
idletime; /* GLIBTOP_UPTIME_IDLETIME */
|
||||
};
|
||||
|
||||
#define glibtop_get_uptime(uptime) glibtop_get_uptime__r(glibtop_global_server, uptime)
|
||||
#define glibtop_get_uptime(uptime) glibtop_get_uptime_l(glibtop_global_server, uptime)
|
||||
|
||||
extern void glibtop_get_uptime__r __P((glibtop *, glibtop_uptime *));
|
||||
#if GLIBTOP_SUID_UPTIME
|
||||
#define glibtop_get_uptime_r glibtop_get_uptime_p
|
||||
#else
|
||||
#define glibtop_get_uptime_r glibtop_get_uptime_s
|
||||
#endif
|
||||
|
||||
extern void glibtop_get_uptime_l __P((glibtop *, glibtop_uptime *));
|
||||
|
||||
#if GLIBTOP_SUID_UPTIME
|
||||
extern void glibtop_get_uptime_p __P((glibtop *, glibtop_uptime *));
|
||||
#else
|
||||
extern void glibtop_get_uptime_s __P((glibtop *, glibtop_uptime *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
@@ -69,7 +81,7 @@ extern SCM glibtop_guile_descriptions_uptime __P((void));
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_uptime [];
|
||||
extern const char *glibtop_types_uptime [];
|
||||
extern const unsigned glibtop_types_uptime [];
|
||||
extern const char *glibtop_labels_uptime [];
|
||||
extern const char *glibtop_descriptions_uptime [];
|
||||
|
||||
|
@@ -29,7 +29,8 @@ __BEGIN_DECLS
|
||||
|
||||
#define glibtop_write(p1, p2) glibtop_write(glibtop_global_server, p1, p2)
|
||||
|
||||
extern void glibtop_write__r __P((glibtop *, size_t, void *));
|
||||
extern void glibtop_write_l __P((glibtop *, size_t, void *));
|
||||
extern void glibtop_write_s __P((glibtop *, size_t, void *));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@@ -27,15 +27,17 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define glibtop_malloc(p1) glibtop_malloc__r(glibtop_global_server, p1)
|
||||
#define glibtop_calloc(p1, p2) glibtop_calloc__r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_realloc(p1, p2) glibtop_realloc__r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_free(p1) glibtop_free__r(glibtop_global_server, p1)
|
||||
#define glibtop_malloc(p1) glibtop_malloc_r(glibtop_global_server, p1)
|
||||
#define glibtop_calloc(p1, p2) glibtop_calloc_r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_realloc(p1, p2) glibtop_realloc_r(glibtop_global_server, p1, p2)
|
||||
#define glibtop_strdup(p2) glibtop_strdup_r(glibtop_global_server, p1)
|
||||
#define glibtop_free(p1) glibtop_free_r(glibtop_global_server, p1)
|
||||
|
||||
extern void *glibtop_malloc__r __P((glibtop *, size_t));
|
||||
extern void *glibtop_calloc__r __P((glibtop *, size_t, size_t));
|
||||
extern void *glibtop_realloc__r __P((glibtop *, void *, size_t));
|
||||
extern void glibtop_free__r __P((glibtop *, void *));
|
||||
extern void *glibtop_malloc_r __P((glibtop *, size_t));
|
||||
extern void *glibtop_calloc_r __P((glibtop *, size_t, size_t));
|
||||
extern void *glibtop_realloc_r __P((glibtop *, void *, size_t));
|
||||
extern char *glibtop_strdup_r __P((glibtop *, const char *));
|
||||
extern void glibtop_free_r __P((glibtop *, void *));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
6
kernel/ChangeLog
Normal file
6
kernel/ChangeLog
Normal file
@@ -0,0 +1,6 @@
|
||||
1998-06-14 Martin Baulig <baulig@taurus.uni-trier.de>
|
||||
|
||||
* README: Added README.
|
||||
|
||||
* kernel.patch: Patch for the Linux kernel to add the
|
||||
new system call.
|
13
kernel/Makefile
Normal file
13
kernel/Makefile
Normal file
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# Makefile for the linux system information tables.
|
||||
#
|
||||
# Note! Dependencies are done automagically by 'make dep', which also
|
||||
# removes any old dependencies. DON'T put your own dependencies here
|
||||
# unless it's something special (ie not a .c file).
|
||||
#
|
||||
# Note 2! The CFLAGS definition is now in the main makefile...
|
||||
|
||||
O_TARGET := table.o
|
||||
O_OBJS := main.o
|
||||
|
||||
include $(TOPDIR)/Rules.make
|
21
kernel/README
Normal file
21
kernel/README
Normal file
@@ -0,0 +1,21 @@
|
||||
This is a new system call `table ()' for the Linux table. It is faster
|
||||
than reading from /proc and can be used to fetch all information required
|
||||
for libgtop until whe have some other function (extended sysctl, ...) in
|
||||
standard kernels.
|
||||
|
||||
I didn't want to change sysctl or some other function myself cause this may
|
||||
cause other applications relying upon those function to fail. This is
|
||||
something for the ``real'' kernel gurus ...
|
||||
|
||||
To use this new system call for libgtop, do the following:
|
||||
|
||||
* Copy this directory to /usr/src/linux/table
|
||||
* Make /usr/src/linux/include/linux/table.h symlink to /usr/src/linux/table/table.h
|
||||
* Apply the patch `kernel.patch' to the kernel, compile, install and reboot
|
||||
* Recompile libgtop (remove `config.cache' and run the `autogen.sh' again).
|
||||
|
||||
If you want to change and/or add something - feel free to do so !
|
||||
|
||||
Have fun,
|
||||
|
||||
Martin
|
49
kernel/kernel.patch
Normal file
49
kernel/kernel.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
diff -ur linux-2.0.32/Makefile linux-hacked/Makefile
|
||||
--- linux-2.0.32/Makefile Fri Nov 7 19:51:05 1997
|
||||
+++ linux-hacked/Makefile Thu Jun 11 20:41:12 1998
|
||||
@@ -87,7 +87,7 @@
|
||||
# standard CFLAGS
|
||||
#
|
||||
|
||||
-CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strength-reduce
|
||||
+CFLAGS = -Wall -Wstrict-prototypes -g -O2 -fomit-frame-pointer -fno-strength-reduce
|
||||
|
||||
ifdef CONFIG_CPP
|
||||
CFLAGS := $(CFLAGS) -x c++
|
||||
@@ -113,12 +113,12 @@
|
||||
# Include the make variables (CC, etc...)
|
||||
#
|
||||
|
||||
-ARCHIVES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o net/network.a
|
||||
+ARCHIVES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o net/network.a table/table.o
|
||||
FILESYSTEMS =fs/filesystems.a
|
||||
DRIVERS =drivers/block/block.a \
|
||||
drivers/char/char.a
|
||||
LIBS =$(TOPDIR)/lib/lib.a
|
||||
-SUBDIRS =kernel drivers mm fs net ipc lib
|
||||
+SUBDIRS =kernel drivers mm fs net ipc lib table
|
||||
|
||||
ifeq ($(CONFIG_ISDN),y)
|
||||
DRIVERS := $(DRIVERS) drivers/isdn/isdn.a
|
||||
diff -ur linux-2.0.32/arch/i386/kernel/entry.S linux-hacked/arch/i386/kernel/entry.S
|
||||
--- linux-2.0.32/arch/i386/kernel/entry.S Tue Sep 16 23:42:45 1997
|
||||
+++ linux-hacked/arch/i386/kernel/entry.S Thu Jun 11 21:37:20 1998
|
||||
@@ -699,4 +699,6 @@
|
||||
.long SYMBOL_NAME(sys_mremap)
|
||||
.long 0,0
|
||||
.long SYMBOL_NAME(sys_vm86)
|
||||
- .space (NR_syscalls-166)*4
|
||||
+ .long 0
|
||||
+ .long SYMBOL_NAME(sys_table)
|
||||
+ .space (NR_syscalls-168)*4
|
||||
diff -ur linux-2.0.32/include/asm-i386/unistd.h linux-hacked/include/asm-i386/unistd.h
|
||||
--- linux-2.0.32/include/asm-i386/unistd.h Fri Mar 22 07:34:02 1996
|
||||
+++ linux-hacked/include/asm-i386/unistd.h Thu Jun 11 21:37:03 1998
|
||||
@@ -169,6 +169,7 @@
|
||||
#define __NR_sched_rr_get_interval 161
|
||||
#define __NR_nanosleep 162
|
||||
#define __NR_mremap 163
|
||||
+#define __NR_table 168
|
||||
|
||||
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
|
||||
#define _syscall0(type,name) \
|
423
kernel/main.c
Normal file
423
kernel/main.c
Normal file
@@ -0,0 +1,423 @@
|
||||
/*
|
||||
* linux/table/table_impl.c
|
||||
* Copyright (C) 1998 Martin Baulig
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/kernel_stat.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/user.h>
|
||||
#include <linux/a.out.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/mman.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/config.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/swap.h>
|
||||
|
||||
#include <asm/segment.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include <linux/table.h>
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#if defined(__i386__)
|
||||
# define KSTK_EIP(tsk) (((unsigned long *)tsk->kernel_stack_page)[1019])
|
||||
# define KSTK_ESP(tsk) (((unsigned long *)tsk->kernel_stack_page)[1022])
|
||||
#elif defined(__alpha__)
|
||||
/*
|
||||
* See arch/alpha/kernel/ptrace.c for details.
|
||||
*/
|
||||
# define PT_REG(reg) (PAGE_SIZE - sizeof(struct pt_regs) \
|
||||
+ (long)&((struct pt_regs *)0)->reg)
|
||||
# define KSTK_EIP(tsk) (*(unsigned long *)(tsk->kernel_stack_page + PT_REG(pc)))
|
||||
# define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->tss.usp)
|
||||
#elif defined(__sparc__)
|
||||
# define PT_REG(reg) (PAGE_SIZE - sizeof(struct pt_regs) \
|
||||
+ (long)&((struct pt_regs *)0)->reg)
|
||||
# define KSTK_EIP(tsk) (*(unsigned long *)(tsk->kernel_stack_page + PT_REG(pc)))
|
||||
# define KSTK_ESP(tsk) (*(unsigned long *)(tsk->kernel_stack_page + PT_REG(u_regs[UREG_FP])))
|
||||
#endif
|
||||
|
||||
static struct task_struct *
|
||||
get_task (pid_t pid)
|
||||
{
|
||||
struct task_struct ** p;
|
||||
|
||||
p = task;
|
||||
while (++p < task+NR_TASKS) {
|
||||
if (*p && (*p)->pid == pid)
|
||||
return *p;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void statm_pte_range(pmd_t * pmd, unsigned long address, unsigned long size,
|
||||
int * pages, int * shared, int * dirty, int * total)
|
||||
{
|
||||
pte_t * pte;
|
||||
unsigned long end;
|
||||
|
||||
if (pmd_none(*pmd))
|
||||
return;
|
||||
if (pmd_bad(*pmd)) {
|
||||
printk("statm_pte_range: bad pmd (%08lx)\n", pmd_val(*pmd));
|
||||
pmd_clear(pmd);
|
||||
return;
|
||||
}
|
||||
pte = pte_offset(pmd, address);
|
||||
address &= ~PMD_MASK;
|
||||
end = address + size;
|
||||
if (end > PMD_SIZE)
|
||||
end = PMD_SIZE;
|
||||
do {
|
||||
pte_t page = *pte;
|
||||
|
||||
address += PAGE_SIZE;
|
||||
pte++;
|
||||
if (pte_none(page))
|
||||
continue;
|
||||
++*total;
|
||||
if (!pte_present(page))
|
||||
continue;
|
||||
++*pages;
|
||||
if (pte_dirty(page))
|
||||
++*dirty;
|
||||
if (pte_page(page) >= high_memory)
|
||||
continue;
|
||||
if (mem_map[MAP_NR(pte_page(page))].count > 1)
|
||||
++*shared;
|
||||
} while (address < end);
|
||||
}
|
||||
|
||||
static inline void statm_pmd_range(pgd_t * pgd, unsigned long address, unsigned long size,
|
||||
int * pages, int * shared, int * dirty, int * total)
|
||||
{
|
||||
pmd_t * pmd;
|
||||
unsigned long end;
|
||||
|
||||
if (pgd_none(*pgd))
|
||||
return;
|
||||
if (pgd_bad(*pgd)) {
|
||||
printk("statm_pmd_range: bad pgd (%08lx)\n", pgd_val(*pgd));
|
||||
pgd_clear(pgd);
|
||||
return;
|
||||
}
|
||||
pmd = pmd_offset(pgd, address);
|
||||
address &= ~PGDIR_MASK;
|
||||
end = address + size;
|
||||
if (end > PGDIR_SIZE)
|
||||
end = PGDIR_SIZE;
|
||||
do {
|
||||
statm_pte_range(pmd, address, end - address, pages, shared, dirty, total);
|
||||
address = (address + PMD_SIZE) & PMD_MASK;
|
||||
pmd++;
|
||||
} while (address < end);
|
||||
}
|
||||
|
||||
static void statm_pgd_range(pgd_t * pgd, unsigned long address, unsigned long end,
|
||||
int * pages, int * shared, int * dirty, int * total)
|
||||
{
|
||||
while (address < end) {
|
||||
statm_pmd_range(pgd, address, end - address, pages, shared, dirty, total);
|
||||
address = (address + PGDIR_SIZE) & PGDIR_MASK;
|
||||
pgd++;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
get_wchan (struct task_struct *p)
|
||||
{
|
||||
if (!p || p == current || p->state == TASK_RUNNING)
|
||||
return 0;
|
||||
#if defined(__i386__)
|
||||
{
|
||||
unsigned long ebp, eip;
|
||||
unsigned long stack_page;
|
||||
int count = 0;
|
||||
|
||||
stack_page = p->kernel_stack_page;
|
||||
if (!stack_page)
|
||||
return 0;
|
||||
ebp = p->tss.ebp;
|
||||
do {
|
||||
if (ebp < stack_page || ebp >= 4092+stack_page)
|
||||
return 0;
|
||||
eip = *(unsigned long *) (ebp+4);
|
||||
if (eip < (unsigned long) interruptible_sleep_on
|
||||
|| eip >= (unsigned long) add_timer)
|
||||
return eip;
|
||||
ebp = *(unsigned long *) ebp;
|
||||
} while (count++ < 16);
|
||||
}
|
||||
#elif defined(__alpha__)
|
||||
/*
|
||||
* This one depends on the frame size of schedule(). Do a
|
||||
* "disass schedule" in gdb to find the frame size. Also, the
|
||||
* code assumes that sleep_on() follows immediately after
|
||||
* interruptible_sleep_on() and that add_timer() follows
|
||||
* immediately after interruptible_sleep(). Ugly, isn't it?
|
||||
* Maybe adding a wchan field to task_struct would be better,
|
||||
* after all...
|
||||
*/
|
||||
{
|
||||
unsigned long schedule_frame;
|
||||
unsigned long pc;
|
||||
|
||||
pc = thread_saved_pc(&p->tss);
|
||||
if (pc >= (unsigned long) interruptible_sleep_on && pc < (unsigned long) add_timer) {
|
||||
schedule_frame = ((unsigned long *)p->tss.ksp)[6];
|
||||
return ((unsigned long *)schedule_frame)[12];
|
||||
}
|
||||
return pc;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
asmlinkage int
|
||||
sys_table (int type, union table *buf, const void *param)
|
||||
{
|
||||
union table tbl;
|
||||
struct sysinfo i;
|
||||
struct task_struct *tsk = NULL;
|
||||
pid_t pid;
|
||||
int err;
|
||||
|
||||
if (type == TABLE_VERSION)
|
||||
return _TABLE_VERSION;
|
||||
|
||||
if (!buf)
|
||||
return -EFAULT;
|
||||
|
||||
memset (&tbl, 0, sizeof (union table));
|
||||
|
||||
/* For TABLE_PROC_*, read pid and get task_struct */
|
||||
|
||||
switch (type) {
|
||||
case TABLE_PROC_UID:
|
||||
case TABLE_PROC_MEM:
|
||||
case TABLE_PROC_SEGMENT:
|
||||
case TABLE_PROC_TIME:
|
||||
case TABLE_PROC_STATE:
|
||||
case TABLE_PROC_SIGNAL:
|
||||
case TABLE_PROC_KERNEL:
|
||||
err = verify_area (VERIFY_READ, param, sizeof (pid_t));
|
||||
if (err)
|
||||
return err;
|
||||
memcpy_fromfs (&pid, param, sizeof (pid_t));
|
||||
|
||||
tsk = get_task (pid);
|
||||
if (tsk == NULL)
|
||||
return -ESRCH;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Main function dispatcher */
|
||||
|
||||
switch (type) {
|
||||
case TABLE_CPU:
|
||||
tbl.cpu.total = jiffies;
|
||||
tbl.cpu.user = kstat.cpu_user;
|
||||
tbl.cpu.nice = kstat.cpu_nice;
|
||||
tbl.cpu.sys = kstat.cpu_system;
|
||||
tbl.cpu.idle = tbl.cpu.total - (tbl.cpu.user + tbl.cpu.nice + tbl.cpu.sys);
|
||||
tbl.cpu.frequency = HZ;
|
||||
break;
|
||||
case TABLE_MEM:
|
||||
si_meminfo (&i);
|
||||
tbl.mem.total = i.totalram;
|
||||
tbl.mem.used = i.totalram - i.freeram;
|
||||
tbl.mem.free = i.freeram;
|
||||
tbl.mem.shared = i.sharedram;
|
||||
tbl.mem.buffer = i.bufferram;
|
||||
tbl.mem.cached = page_cache_size << PAGE_SHIFT;
|
||||
break;
|
||||
case TABLE_SWAP:
|
||||
si_swapinfo (&i);
|
||||
tbl.swap.total = i.totalswap;
|
||||
tbl.swap.used = i.totalswap - i.freeswap;
|
||||
tbl.swap.free = i.freeswap;
|
||||
break;
|
||||
case TABLE_LOADAVG:
|
||||
tbl.loadavg.loadavg [0] = (double) avenrun [0] / (1 << FSHIFT);
|
||||
tbl.loadavg.loadavg [1] = (double) avenrun [1] / (1 << FSHIFT);
|
||||
tbl.loadavg.loadavg [2] = (double) avenrun [2] / (1 << FSHIFT);
|
||||
tbl.loadavg.nr_running = nr_running;
|
||||
tbl.loadavg.nr_tasks = nr_tasks;
|
||||
tbl.loadavg.last_pid = last_pid;
|
||||
break;
|
||||
case TABLE_UPTIME:
|
||||
tbl.uptime.uptime = jiffies;
|
||||
tbl.uptime.idle = task[0]->utime + task[0]->stime;
|
||||
break;
|
||||
case TABLE_PROC_STATE:
|
||||
tbl.proc_state.state = tsk->state;
|
||||
tbl.proc_state.flags = tsk->flags;
|
||||
memcpy (tbl.proc_state.comm, tsk->comm, sizeof (tbl.proc_state.comm));
|
||||
break;
|
||||
case TABLE_PROC_UID:
|
||||
tbl.proc_uid.uid = tsk->uid;
|
||||
tbl.proc_uid.euid = tsk->euid;
|
||||
tbl.proc_uid.suid = tsk->suid;
|
||||
tbl.proc_uid.fsuid = tsk->fsuid;
|
||||
|
||||
tbl.proc_uid.gid = tsk->gid;
|
||||
tbl.proc_uid.egid = tsk->egid;
|
||||
tbl.proc_uid.sgid = tsk->sgid;
|
||||
tbl.proc_uid.fsgid = tsk->fsgid;
|
||||
|
||||
tbl.proc_uid.pid = tsk->pid;
|
||||
tbl.proc_uid.pgrp = tsk->pgrp;
|
||||
tbl.proc_uid.ppid = tsk->p_pptr->pid;
|
||||
|
||||
tbl.proc_uid.session = tsk->session;
|
||||
tbl.proc_uid.tty = tsk->tty ? kdev_t_to_nr (tsk->tty->device) : 0;
|
||||
tbl.proc_uid.tpgid = tsk->tty ? tsk->tty->pgrp : -1;
|
||||
|
||||
tbl.proc_uid.priority = tsk->priority;
|
||||
tbl.proc_uid.counter = tsk->counter;
|
||||
tbl.proc_uid.def_priority = DEF_PRIORITY;
|
||||
break;
|
||||
case TABLE_PROC_SIGNAL:
|
||||
tbl.proc_signal.signal = tsk->signal;
|
||||
tbl.proc_signal.blocked = tsk->blocked;
|
||||
|
||||
if (tsk->sig) {
|
||||
struct sigaction * action = tsk->sig->action;
|
||||
unsigned long sig_ign = 0, sig_caught = 0;
|
||||
unsigned long bit = 1;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
switch((unsigned long) action->sa_handler) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
sig_ign |= bit;
|
||||
break;
|
||||
default:
|
||||
sig_caught |= bit;
|
||||
}
|
||||
bit <<= 1;
|
||||
action++;
|
||||
}
|
||||
|
||||
tbl.proc_signal.ignored = sig_ign;
|
||||
tbl.proc_signal.caught = sig_caught;
|
||||
} else {
|
||||
tbl.proc_signal.ignored = 0;
|
||||
tbl.proc_signal.caught = 0;
|
||||
}
|
||||
break;
|
||||
case TABLE_PROC_MEM:
|
||||
if (tsk->mm && tsk->mm != &init_mm) {
|
||||
tbl.proc_mem.context = tsk->mm->context;
|
||||
tbl.proc_mem.start_code = tsk->mm->start_code;
|
||||
tbl.proc_mem.end_code = tsk->mm->end_code;
|
||||
tbl.proc_mem.start_data = tsk->mm-> start_data;
|
||||
tbl.proc_mem.end_data = tsk->mm->end_data;
|
||||
tbl.proc_mem.start_brk = tsk->mm->start_brk;
|
||||
tbl.proc_mem.brk = tsk->mm->brk;
|
||||
tbl.proc_mem.start_stack = tsk->mm->start_stack;
|
||||
tbl.proc_mem.start_mmap = tsk->mm->start_mmap;
|
||||
tbl.proc_mem.arg_start = tsk->mm->arg_start;
|
||||
tbl.proc_mem.arg_end = tsk->mm->arg_end;
|
||||
tbl.proc_mem.env_start = tsk->mm->env_start;
|
||||
tbl.proc_mem.env_end = tsk->mm->env_end;
|
||||
tbl.proc_mem.rss = tsk->mm->rss;
|
||||
tbl.proc_mem.total_vm = tsk->mm->total_vm;
|
||||
tbl.proc_mem.locked_vm = tsk->mm->locked_vm;
|
||||
}
|
||||
tbl.proc_mem.rlim = tsk->rlim ? tsk->rlim[RLIMIT_RSS].rlim_cur : 0;
|
||||
break;
|
||||
case TABLE_PROC_SEGMENT:
|
||||
if (tsk->mm && tsk->mm != &init_mm) {
|
||||
unsigned long vsize = 0;
|
||||
int size = 0, resident = 0, share = 0;
|
||||
int trs = 0, lrs = 0, drs = 0, dt = 0;
|
||||
struct vm_area_struct * vma = tsk->mm->mmap;
|
||||
|
||||
while (vma) {
|
||||
pgd_t *pgd = pgd_offset(tsk->mm, vma->vm_start);
|
||||
int pages = 0, shared = 0, dirty = 0, total = 0;
|
||||
|
||||
vsize += vma->vm_end - vma->vm_start;
|
||||
|
||||
statm_pgd_range (pgd, vma->vm_start, vma->vm_end,
|
||||
&pages, &shared, &dirty, &total);
|
||||
resident += pages;
|
||||
share += shared;
|
||||
dt += dirty;
|
||||
size += total;
|
||||
if (vma->vm_flags & VM_EXECUTABLE)
|
||||
trs += pages; /* text */
|
||||
else if (vma->vm_flags & VM_GROWSDOWN)
|
||||
drs += pages; /* stack */
|
||||
else if (vma->vm_end > 0x60000000)
|
||||
lrs += pages; /* library */
|
||||
else
|
||||
drs += pages;
|
||||
vma = vma->vm_next;
|
||||
}
|
||||
|
||||
tbl.proc_segment.vsize = vsize;
|
||||
tbl.proc_segment.size = size;
|
||||
tbl.proc_segment.resident = resident;
|
||||
tbl.proc_segment.shared = share;
|
||||
tbl.proc_segment.trs = trs;
|
||||
tbl.proc_segment.lrs = lrs;
|
||||
tbl.proc_segment.dt = dt;
|
||||
}
|
||||
break;
|
||||
case TABLE_PROC_TIME:
|
||||
tbl.proc_time.utime = tsk->utime;
|
||||
tbl.proc_time.stime = tsk->stime;
|
||||
tbl.proc_time.cutime = tsk->cutime;
|
||||
tbl.proc_time.cstime = tsk->cstime;
|
||||
|
||||
tbl.proc_time.start_time = tsk->start_time;
|
||||
tbl.proc_time.timeout = tsk->timeout;
|
||||
tbl.proc_time.policy = tsk->policy;
|
||||
tbl.proc_time.rt_priority = tsk->rt_priority;
|
||||
|
||||
tbl.proc_time.it_real_value = tsk->it_real_value;
|
||||
tbl.proc_time.it_prof_value = tsk->it_prof_value;
|
||||
tbl.proc_time.it_virt_value = tsk->it_virt_value;
|
||||
tbl.proc_time.it_real_incr = tsk->it_real_incr;
|
||||
tbl.proc_time.it_prof_incr = tsk->it_prof_incr;
|
||||
tbl.proc_time.it_virt_incr = tsk->it_virt_incr;
|
||||
break;
|
||||
case TABLE_PROC_KERNEL:
|
||||
tbl.proc_kernel.min_flt = tsk->min_flt;
|
||||
tbl.proc_kernel.cmin_flt = tsk->cmin_flt;
|
||||
tbl.proc_kernel.maj_flt = tsk->maj_flt;
|
||||
tbl.proc_kernel.cmaj_flt = tsk->cmaj_flt;
|
||||
|
||||
tbl.proc_kernel.kesp = tsk->kernel_stack_page ? KSTK_EIP(tsk) : 0;
|
||||
tbl.proc_kernel.keip = tsk->kernel_stack_page ? KSTK_ESP(tsk) : 0;
|
||||
|
||||
tbl.proc_kernel.nswap = tsk->nswap;
|
||||
tbl.proc_kernel.cnswap = tsk->cnswap;
|
||||
|
||||
tbl.proc_kernel.wchan = get_wchan (tsk);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
err = verify_area (VERIFY_WRITE, buf, sizeof (struct table));
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
memcpy_tofs (buf, &tbl, sizeof (union table));
|
||||
return 0;
|
||||
}
|
154
kernel/table.h
Normal file
154
kernel/table.h
Normal file
@@ -0,0 +1,154 @@
|
||||
#ifndef _LINUX_TABLE_H
|
||||
#define _LINUX_TABLE_H
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <linux/types.h>
|
||||
#endif
|
||||
|
||||
#define TABLE_VERSION 0
|
||||
#define TABLE_CPU 1
|
||||
#define TABLE_MEM 2
|
||||
#define TABLE_SWAP 3
|
||||
#define TABLE_LOADAVG 4
|
||||
#define TABLE_UPTIME 5
|
||||
#define TABLE_PROC_UID 6
|
||||
#define TABLE_PROC_MEM 7
|
||||
#define TABLE_PROC_SEGMENT 8
|
||||
#define TABLE_PROC_TIME 9
|
||||
#define TABLE_PROC_STATE 10
|
||||
#define TABLE_PROC_SIGNAL 11
|
||||
#define TABLE_PROC_KERNEL 12
|
||||
|
||||
/* CPU Usage (in jiffies = 1/100th seconds) */
|
||||
|
||||
struct table_cpu
|
||||
{
|
||||
unsigned long total; /* Total CPU Time */
|
||||
unsigned long user; /* CPU Time in User Mode */
|
||||
unsigned long nice; /* CPU Time in User Mode (nice) */
|
||||
unsigned long sys; /* CPU Time in System Mode */
|
||||
unsigned long idle; /* CPU Time in the Idle Task */
|
||||
unsigned long frequency; /* Tick frequency */
|
||||
};
|
||||
|
||||
/* Memory Usage (in bytes) */
|
||||
|
||||
struct table_mem
|
||||
{
|
||||
unsigned long total; /* Total physical memory */
|
||||
unsigned long used; /* Used memory size */
|
||||
unsigned long free; /* Free memory size */
|
||||
unsigned long shared; /* Shared memory size */
|
||||
unsigned long buffer; /* Size of buffers */
|
||||
unsigned long cached; /* Size of cached memory */
|
||||
};
|
||||
|
||||
/* Swap Space (in bytes) */
|
||||
|
||||
struct table_swap
|
||||
{
|
||||
unsigned long total; /* Total swap space */
|
||||
unsigned long used; /* Used swap space */
|
||||
unsigned long free; /* Free swap space */
|
||||
};
|
||||
|
||||
/* Load average */
|
||||
|
||||
struct table_loadavg
|
||||
{
|
||||
double loadavg [3];
|
||||
unsigned nr_running;
|
||||
unsigned nr_tasks;
|
||||
unsigned last_pid;
|
||||
};
|
||||
|
||||
/* Uptime */
|
||||
|
||||
struct table_uptime
|
||||
{
|
||||
unsigned long uptime;
|
||||
unsigned long idle;
|
||||
};
|
||||
|
||||
/* Information about processes. */
|
||||
|
||||
struct table_proc_state
|
||||
{
|
||||
long state;
|
||||
unsigned long flags;
|
||||
char comm[16];
|
||||
};
|
||||
|
||||
struct table_proc_uid
|
||||
{
|
||||
int uid, euid, suid, fsuid;
|
||||
int gid, egid, sgid, fsgid;
|
||||
int pid, pgrp, ppid;
|
||||
int session;
|
||||
unsigned int tty;
|
||||
int tpgid;
|
||||
long priority;
|
||||
long counter;
|
||||
long def_priority;
|
||||
};
|
||||
|
||||
struct table_proc_mem
|
||||
{
|
||||
unsigned long context;
|
||||
unsigned long start_code, end_code, start_data, end_data;
|
||||
unsigned long start_brk, brk, start_stack, start_mmap;
|
||||
unsigned long arg_start, arg_end, env_start, env_end;
|
||||
unsigned long rss, rlim, total_vm, locked_vm;
|
||||
};
|
||||
|
||||
struct table_proc_segment
|
||||
{
|
||||
unsigned long vsize;
|
||||
int size, resident, shared;
|
||||
int trs, lrs, drs, dt;
|
||||
};
|
||||
|
||||
struct table_proc_time
|
||||
{
|
||||
long utime, stime, cutime, cstime, start_time;
|
||||
unsigned long timeout, policy, rt_priority;
|
||||
unsigned long it_real_value, it_prof_value, it_virt_value;
|
||||
unsigned long it_real_incr, it_prof_incr, it_virt_incr;
|
||||
};
|
||||
|
||||
struct table_proc_signal
|
||||
{
|
||||
unsigned long signal;
|
||||
unsigned long blocked; /* bitmap of masked signals */
|
||||
unsigned long ignored; /* mask of ignored signals */
|
||||
unsigned long caught; /* mask of caught signals */
|
||||
};
|
||||
|
||||
struct table_proc_kernel
|
||||
{
|
||||
unsigned long keip, kesp, wchan;
|
||||
unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
|
||||
unsigned long nswap, cnswap;
|
||||
};
|
||||
|
||||
/* Union */
|
||||
|
||||
union table
|
||||
{
|
||||
struct table_cpu cpu;
|
||||
struct table_mem mem;
|
||||
struct table_swap swap;
|
||||
struct table_loadavg loadavg;
|
||||
struct table_uptime uptime;
|
||||
struct table_proc_uid proc_uid;
|
||||
struct table_proc_mem proc_mem;
|
||||
struct table_proc_segment proc_segment;
|
||||
struct table_proc_time proc_time;
|
||||
struct table_proc_state proc_state;
|
||||
struct table_proc_signal proc_signal;
|
||||
struct table_proc_kernel proc_kernel;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_IPC_H */
|
||||
|
||||
|
85
kernel/test.c
Normal file
85
kernel/test.c
Normal file
@@ -0,0 +1,85 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/table.h>
|
||||
|
||||
#include <syscall.h>
|
||||
|
||||
static inline _syscall3 (int, table, int, type, union table *, tbl, const void *, param);
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
union table tbl;
|
||||
unsigned count;
|
||||
int ret;
|
||||
|
||||
ret = table (TABLE_VERSION, NULL, NULL);
|
||||
|
||||
if (ret == -1) {
|
||||
fprintf (stderr, "table(%u): %s\n", TABLE_VERSION, sys_errlist [errno]);
|
||||
exit (-errno);
|
||||
}
|
||||
|
||||
fprintf (stderr, "Table (%u) = %u\n", TABLE_VERSION, ret);
|
||||
|
||||
for (count = 0; count < 5; count++) {
|
||||
ret = table (TABLE_CPU, &tbl, NULL);
|
||||
|
||||
if (ret == -1) {
|
||||
fprintf (stderr, "table(%u): %s\n", TABLE_CPU, sys_errlist [errno]);
|
||||
exit (-errno);
|
||||
}
|
||||
|
||||
fprintf (stderr, "Table (%u) = %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
TABLE_CPU, tbl.cpu.total, tbl.cpu.user, tbl.cpu.nice,
|
||||
tbl.cpu.sys, tbl.cpu.idle, tbl.cpu.frequency);
|
||||
}
|
||||
|
||||
ret = table (TABLE_MEM, &tbl, NULL);
|
||||
|
||||
if (ret == -1) {
|
||||
fprintf (stderr, "table(%u): %s\n", TABLE_MEM, sys_errlist [errno]);
|
||||
exit (-errno);
|
||||
}
|
||||
|
||||
fprintf (stderr, "Table (%u) = %lu, %lu, %lu, %lu, %lu, %lu\n",
|
||||
TABLE_MEM, tbl.mem.total, tbl.mem.used, tbl.mem.free,
|
||||
tbl.mem.shared, tbl.mem.buffer, tbl.mem.cached);
|
||||
|
||||
ret = table (TABLE_SWAP, &tbl, NULL);
|
||||
|
||||
if (ret == -1) {
|
||||
fprintf (stderr, "table(%u): %s\n", TABLE_SWAP, sys_errlist [errno]);
|
||||
exit (-errno);
|
||||
}
|
||||
|
||||
fprintf (stderr, "Table (%u) = %lu, %lu, %lu\n",
|
||||
TABLE_SWAP, tbl.swap.total, tbl.swap.used, tbl.swap.free);
|
||||
|
||||
ret = table (TABLE_LOADAVG, &tbl, NULL);
|
||||
|
||||
if (ret == -1) {
|
||||
fprintf (stderr, "table(%u): %s\n", TABLE_LOADAVG, sys_errlist [errno]);
|
||||
exit (-errno);
|
||||
}
|
||||
|
||||
fprintf (stderr, "Table (%u) = (%lu, %lu, %lu) - %u, %u, %u\n",
|
||||
TABLE_LOADAVG, tbl.loadavg.loadavg [0], tbl.loadavg.loadavg [1],
|
||||
tbl.loadavg.loadavg [2], tbl.loadavg.nr_running,
|
||||
tbl.loadavg.nr_tasks, tbl.loadavg.last_pid);
|
||||
|
||||
ret = table (TABLE_UPTIME, &tbl, NULL);
|
||||
|
||||
if (ret == -1) {
|
||||
fprintf (stderr, "table(%u): %s\n", TABLE_UPTIME, sys_errlist [errno]);
|
||||
exit (-errno);
|
||||
}
|
||||
|
||||
fprintf (stderr, "Table (%u) = %lu, %lu\n",
|
||||
TABLE_UPTIME, tbl.uptime.uptime, tbl.uptime.idle);
|
||||
|
||||
exit (0);
|
||||
}
|
1
kernel/version.h
Normal file
1
kernel/version.h
Normal file
@@ -0,0 +1 @@
|
||||
#define _TABLE_VERSION 1
|
@@ -32,3 +32,4 @@ sysinfo.lo
|
||||
uptime.lo
|
||||
write.lo
|
||||
xmalloc.lo
|
||||
lib.c
|
||||
|
@@ -1,15 +1,23 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
INCLUDES = @GTOP_INCS@
|
||||
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@ -DGTOP_SERVER=\""@GTOP_SERVER@"\"
|
||||
CFLAGS = -Wall -W @CFLAGS@ -DGTOP_SERVER=\""@LIBGTOP_SERVER@"\" -DDEBUG
|
||||
|
||||
lib_LTLIBRARIES = libgtop.la
|
||||
|
||||
libgtop_la_SOURCES = init.c open.c close.c read.c read_data.c \
|
||||
write.c command.c cpu.c mem.c swap.c uptime.c \
|
||||
loadavg.c shm_limits.c msg_limits.c \
|
||||
sem_limits.c proclist.c procstate.c procuid.c \
|
||||
proctime.c procmem.c procsignal.c prockernel.c \
|
||||
procsegment.c
|
||||
libgtop_la_SOURCES = init.c open.c close.c command.c read.c read_data.c \
|
||||
write.c lib.c parameter.c
|
||||
|
||||
BUILT_SOURCES = lib.c
|
||||
|
||||
lib.c: lib.awk $(top_builddir)/config.h $(top_builddir)/features.def
|
||||
$(AWK) -f $(srcdir)/lib.awk < $(top_builddir)/features.def > lib-t
|
||||
mv lib-t lib.c
|
||||
|
||||
EXTRA_DIST = lib.awk
|
||||
|
||||
CLEANFILES = lib.c
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
/* Closes pipe to gtop server. */
|
||||
|
||||
void
|
||||
glibtop_close (glibtop *server)
|
||||
glibtop_close_r (glibtop *server)
|
||||
{
|
||||
kill (server->pid, SIGKILL);
|
||||
close (server->input [0]);
|
||||
|
@@ -27,28 +27,53 @@
|
||||
#include <glibtop/xmalloc.h>
|
||||
|
||||
void *
|
||||
glibtop_call__r (glibtop *server, unsigned command, size_t send_size, void *send_buf,
|
||||
size_t recv_size, void *recv_buf)
|
||||
glibtop_call_l (glibtop *server, unsigned command, size_t send_size, void *send_buf,
|
||||
size_t recv_size, void *recv_buf)
|
||||
{
|
||||
glibtop_command *cmnd;
|
||||
void *ptr;
|
||||
glibtop_command cmnd;
|
||||
glibtop_response response;
|
||||
|
||||
glibtop_init__r (&server);
|
||||
glibtop_init_r (&server, 0, 0);
|
||||
|
||||
cmnd = glibtop_calloc__r (server, 1, sizeof (glibtop_command));
|
||||
memset (&cmnd, 0, sizeof (glibtop_command));
|
||||
|
||||
memcpy (&cmnd.server, server, sizeof (glibtop));
|
||||
|
||||
memcpy (&cmnd->server, server, sizeof (glibtop));
|
||||
cmnd.command = command;
|
||||
|
||||
/* If send_size is less than _GLIBTOP_PARAM_SIZE (normally 16 Bytes), we
|
||||
* send it together with command, so we only need one system call instead
|
||||
* of two. */
|
||||
|
||||
#ifdef DEBUG
|
||||
// fprintf (stderr, "COMMAND: send_size = %d; command = %d; sizeof (cmnd) = %d\n",
|
||||
// send_size, command, sizeof (glibtop_command));
|
||||
#endif
|
||||
|
||||
if (send_size <= _GLIBTOP_PARAM_SIZE) {
|
||||
memcpy (cmnd.parameter, send_buf, send_size);
|
||||
cmnd.size = send_size;
|
||||
} else {
|
||||
cmnd.data_size = send_size;
|
||||
}
|
||||
|
||||
cmnd->command = command;
|
||||
cmnd->size = send_size;
|
||||
|
||||
glibtop_write__r (server, sizeof (glibtop_command), cmnd);
|
||||
glibtop_write__r (server, send_size, send_buf);
|
||||
glibtop_read__r (server, recv_size, recv_buf);
|
||||
|
||||
ptr = glibtop_read_data__r (server);
|
||||
|
||||
glibtop_free__r (server, cmnd);
|
||||
|
||||
return ptr;
|
||||
glibtop_write_l (server, sizeof (glibtop_command), &cmnd);
|
||||
// glibtop_write_l (server, cmnd.data_size, send_buf);
|
||||
|
||||
glibtop_read_l (server, sizeof (glibtop_response), &response);
|
||||
|
||||
fprintf (stderr, "RESPONSE: %d - %d\n", response.offset, response.data_size);
|
||||
|
||||
if (recv_buf)
|
||||
memcpy (recv_buf, ((char *) &response) + response.offset, recv_size);
|
||||
|
||||
if (response.data_size) {
|
||||
void *ptr = glibtop_malloc_r (server, response.data_size);
|
||||
|
||||
glibtop_read_l (server, response.data_size, ptr);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
167
lib/init.c
167
lib/init.c
@@ -20,21 +20,168 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/xmalloc.h>
|
||||
#include <glibtop/parameter.h>
|
||||
|
||||
static glibtop _glibtop_global_server;
|
||||
glibtop *glibtop_global_server = NULL;
|
||||
#ifndef DEFAULT_PORT
|
||||
#define DEFAULT_PORT 42800
|
||||
#endif
|
||||
|
||||
static glibtop _glibtop_global_server;
|
||||
glibtop *glibtop_global_server = &_glibtop_global_server;
|
||||
|
||||
|
||||
void
|
||||
_init_server (glibtop *server, const unsigned features)
|
||||
{
|
||||
char *command, *temp;
|
||||
|
||||
/* Try to get server command, but don't override if already
|
||||
* set via glibtop_set_parameter () */
|
||||
|
||||
if (server->server_command == NULL) {
|
||||
const char *temp = getenv ("LIBGTOP_SERVER") ?
|
||||
getenv ("LIBGTOP_SERVER") : GTOP_SERVER;
|
||||
|
||||
server->server_command = glibtop_strdup_r (server, temp);
|
||||
}
|
||||
|
||||
if (server->server_rsh == NULL) {
|
||||
const char *temp = getenv ("LIBGTOP_RSH") ?
|
||||
getenv ("LIBGTOP_RSH") : "/usr/bin/ssh";
|
||||
|
||||
server->server_rsh = glibtop_strdup_r (server, temp);
|
||||
}
|
||||
|
||||
/* Try to get server method, but don't override if already
|
||||
* set via glibtop_set_parameter () */
|
||||
|
||||
if (server->method) return;
|
||||
|
||||
/* If server->command doesn't start with a colon, then it is
|
||||
* the full pathname of the server executable. */
|
||||
|
||||
if (server->server_command [0] != ':') {
|
||||
if (features & glibtop_server_features) {
|
||||
|
||||
/* We really need the server. */
|
||||
|
||||
server->method = GLIBTOP_METHOD_PIPE;
|
||||
|
||||
} else {
|
||||
|
||||
/* Fine. No server is needed, so we call the
|
||||
* sysdeps functions directly. */
|
||||
|
||||
server->method = GLIBTOP_METHOD_DIRECT;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* If the first character of 'server_command' is a colon,
|
||||
* the first field is the method to connect to the server. */
|
||||
|
||||
/* Everything up to the next colon is the method. */
|
||||
|
||||
command = glibtop_strdup_r (server, server->server_command+1);
|
||||
temp = strstr (command, ":");
|
||||
if (temp) *temp = 0;
|
||||
|
||||
/* Dispatch method. */
|
||||
|
||||
if (!strcmp (command, "direct")) {
|
||||
|
||||
/* Use sysdeps dir instead of connecting to server
|
||||
* even if using the server would be required on
|
||||
* the current system. */
|
||||
|
||||
server->method = GLIBTOP_METHOD_DIRECT;
|
||||
|
||||
} else if (!strcmp (command, "inet")) {
|
||||
|
||||
server->method = GLIBTOP_METHOD_INET;
|
||||
|
||||
/* Connect to internet server. */
|
||||
|
||||
if (temp == NULL) {
|
||||
/* If no value was set, we use 'localhost'. */
|
||||
if (server->server_host == NULL)
|
||||
server->server_host = glibtop_strdup_r
|
||||
(server, "localhost");
|
||||
} else {
|
||||
char *temp2 = strstr (temp+1, ":");
|
||||
if (temp2) *temp2 = 0;
|
||||
|
||||
/* Override default. */
|
||||
if (server->server_host)
|
||||
glibtop_free_r (server, (char *) server->server_host);
|
||||
|
||||
server->server_host = glibtop_strdup_r
|
||||
(server, temp+1);
|
||||
|
||||
temp = temp2;
|
||||
}
|
||||
|
||||
if (temp == NULL) {
|
||||
/* If no value was set, we use DEFAULT_PORT. */
|
||||
if (server->server_port == 0)
|
||||
server->server_port = DEFAULT_PORT;
|
||||
} else {
|
||||
char *temp2 = strstr (temp+1, ":");
|
||||
if (temp2) *temp2 = 0;
|
||||
|
||||
if (sscanf (temp+1, "%ld", &server->server_port) != 1)
|
||||
server->server_port = DEFAULT_PORT;
|
||||
|
||||
temp = temp2 ? temp2 + 1 : temp2;
|
||||
}
|
||||
} else {
|
||||
glibtop_error_r (server, "Unknown server method '%s'",
|
||||
server->server_command+1);
|
||||
}
|
||||
|
||||
glibtop_free_r (server, command);
|
||||
}
|
||||
|
||||
glibtop *
|
||||
glibtop_init__r (glibtop **server)
|
||||
glibtop_init_r (glibtop **server_ptr, const unsigned long features,
|
||||
const unsigned flags)
|
||||
{
|
||||
if (*server != NULL)
|
||||
return *server;
|
||||
glibtop *server;
|
||||
|
||||
if (glibtop_global_server == NULL) {
|
||||
glibtop_global_server = &_glibtop_global_server;
|
||||
glibtop_open (glibtop_global_server, "glibtop");
|
||||
if (server_ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
if (*server_ptr == NULL)
|
||||
*server_ptr = glibtop_global_server;
|
||||
|
||||
server = *server_ptr;
|
||||
|
||||
/* Should we do the initialization? */
|
||||
|
||||
if (flags & GLIBTOP_INIT_NO_INIT)
|
||||
return server;
|
||||
|
||||
/* Do the initialization, but only if not already initialized. */
|
||||
|
||||
if ((server->flags & _GLIBTOP_INIT_STATE_INIT) == 0) {
|
||||
_init_server (server, features);
|
||||
|
||||
server->flags |= _GLIBTOP_INIT_STATE_INIT;
|
||||
}
|
||||
|
||||
/* Should we open the server? */
|
||||
|
||||
if (flags & GLIBTOP_INIT_NO_OPEN)
|
||||
return server;
|
||||
|
||||
/* Open server, but only if not already opened. */
|
||||
|
||||
return *server = glibtop_global_server;
|
||||
if ((server->flags & _GLIBTOP_INIT_STATE_OPEN) == 0)
|
||||
glibtop_open_l (glibtop_global_server, "glibtop",
|
||||
features, flags);
|
||||
|
||||
return server;
|
||||
}
|
||||
|
55
lib/lib.awk
Normal file
55
lib/lib.awk
Normal file
@@ -0,0 +1,55 @@
|
||||
BEGIN {
|
||||
print "/* lib.c */";
|
||||
print "/* This is a generated file. Please modify `lib.awk' */";
|
||||
print "";
|
||||
|
||||
print "#include <glibtop.h>";
|
||||
print "#include <glibtop/open.h>";
|
||||
print "#include <glibtop/sysdeps.h>";
|
||||
print "#include <glibtop/command.h>";
|
||||
|
||||
print "";
|
||||
|
||||
}
|
||||
|
||||
function output(feature) {
|
||||
if (feature ~ /^proclist$/) {
|
||||
print "unsigned *";
|
||||
prefix = "return ";
|
||||
} else {
|
||||
prefix = "";
|
||||
print "void";
|
||||
}
|
||||
if (feature ~ /^proc_/) {
|
||||
param = ", pid_t pid";
|
||||
} else {
|
||||
param = "";
|
||||
}
|
||||
|
||||
print "glibtop_get_"feature"_l (glibtop *server, glibtop_"feature" *buf"param")";
|
||||
print "{";
|
||||
print "\tglibtop_init_r (&server, GLIBTOP_SYSDEPS_"toupper(feature)", 0);";
|
||||
print "";
|
||||
print "\tif ((server->flags & _GLIBTOP_INIT_STATE_SERVER) &&";
|
||||
print "\t (server->features & GLIBTOP_SYSDEPS_"toupper(feature)"))";
|
||||
print "\t{";
|
||||
|
||||
if (feature ~ /^proc_/) {
|
||||
print "\t\t"prefix"glibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)", sizeof (pid_t),";
|
||||
print "\t\t\t\t&pid, sizeof (glibtop_"feature"), buf);";
|
||||
print "\t} else {";
|
||||
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf, pid);";
|
||||
} else {
|
||||
print "\t\t"prefix"glibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)", 0, NULL,";
|
||||
print "\t\t\t sizeof (glibtop_"feature"), buf);";
|
||||
print "\t} else {";
|
||||
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf);";
|
||||
}
|
||||
print "\t}";
|
||||
print "}";
|
||||
print "";
|
||||
}
|
||||
|
||||
/^(\w+)/ { output($1) }
|
||||
|
||||
|
58
lib/open.c
58
lib/open.c
@@ -19,42 +19,50 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
#include <glibtop/command.h>
|
||||
#include <glibtop/xmalloc.h>
|
||||
|
||||
#include <glibtop/gnuserv.h>
|
||||
|
||||
/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */
|
||||
|
||||
void
|
||||
glibtop_open (glibtop *server, const char *program_name)
|
||||
glibtop_open_l (glibtop *server, const char *program_name,
|
||||
const unsigned long features, const unsigned flags)
|
||||
{
|
||||
char version [BUFSIZ], buffer [BUFSIZ];
|
||||
|
||||
memset (server, 0, sizeof (glibtop));
|
||||
|
||||
server->name = program_name;
|
||||
|
||||
if (pipe (server->input) || pipe (server->output))
|
||||
glibtop_error__r (server, _("cannot make a pipe: %s\n"), strerror (errno));
|
||||
/* It is important to set _GLIBTOP_INIT_STATE_OPEN here when we
|
||||
* do recursive calls to glibtop_init_r (). */
|
||||
|
||||
server->pid = fork ();
|
||||
server->flags |= _GLIBTOP_INIT_STATE_OPEN;
|
||||
|
||||
if (server->pid < 0) {
|
||||
glibtop_error__r (server, _("%s: fork failed: %s\n"), strerror (errno));
|
||||
} else if (server->pid == 0) {
|
||||
close (0); close (1); /* close (2); */
|
||||
close (server->input [0]); close (server->output [1]);
|
||||
dup2 (server->input [1], 1); /* dup2 (server->input [1], 2); */
|
||||
dup2 (server->output [0], 0);
|
||||
execl (GTOP_SERVER, NULL);
|
||||
_exit (2);
|
||||
if (server->method == GLIBTOP_METHOD_INET) {
|
||||
int connect_type;
|
||||
|
||||
fprintf (stderr, "Connecting to '%s' port %d.\n",
|
||||
server->server_host, server->server_port);
|
||||
|
||||
connect_type = glibtop_make_connection
|
||||
(server->server_host, server->server_port,
|
||||
&server->socket);
|
||||
|
||||
server->features = -1;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
close (server->input [1]);
|
||||
close (server->output [0]);
|
||||
/* If the server has been started, ask it for its features. */
|
||||
|
||||
sprintf (version, "%s server %s ready.\n", PACKAGE, VERSION);
|
||||
|
||||
glibtop_read__r (server, strlen (version), buffer);
|
||||
|
||||
if (memcmp (version, buffer, strlen (version)))
|
||||
glibtop_error__r (server, _("server version is not %s"), VERSION);
|
||||
if (server->flags & _GLIBTOP_INIT_STATE_SERVER) {
|
||||
glibtop_sysdeps sysdeps;
|
||||
|
||||
glibtop_call_l (server, GLIBTOP_CMND_SYSDEPS, 0, NULL,
|
||||
sizeof (glibtop_sysdeps), &sysdeps);
|
||||
|
||||
server->features = sysdeps.features;
|
||||
}
|
||||
}
|
||||
|
62
lib/parameter.c
Normal file
62
lib/parameter.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <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 <glibtop.h>
|
||||
#include <glibtop/parameter.h>
|
||||
|
||||
#define _write_data(ptr,size) \
|
||||
if ((data_ptr == NULL) || (data_size < size)) return -size; \
|
||||
if (ptr == NULL) { strcpy (data_ptr, ""); return 1; } \
|
||||
memcpy (data_ptr, ptr, size); \
|
||||
return size;
|
||||
|
||||
#define _strlen(ptr) (ptr ? strlen (ptr) : 0)
|
||||
|
||||
size_t
|
||||
glibtop_get_parameter_l (glibtop *server, const unsigned parameter,
|
||||
void *data_ptr, size_t data_size)
|
||||
{
|
||||
switch (parameter) {
|
||||
case GLIBTOP_PARAM_METHOD:
|
||||
_write_data (&server->method,
|
||||
sizeof (server->method));
|
||||
case GLIBTOP_PARAM_FEATURES:
|
||||
_write_data (&server->features,
|
||||
sizeof (server->features));
|
||||
case GLIBTOP_PARAM_COMMAND:
|
||||
_write_data (server->server_command,
|
||||
_strlen(server->server_command));
|
||||
case GLIBTOP_PARAM_HOST:
|
||||
_write_data (server->server_host,
|
||||
_strlen(server->server_host));
|
||||
case GLIBTOP_PARAM_PORT:
|
||||
_write_data (&server->server_port,
|
||||
sizeof (server->server_port));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
glibtop_set_parameter_l (glibtop *server, const unsigned parameter,
|
||||
const void *data_ptr, size_t data_size)
|
||||
{
|
||||
}
|
@@ -1,35 +0,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.
|
||||
|
||||
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 <glibtop.h>
|
||||
#include <glibtop/prockernel.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
glibtop_get_proc_kernel__r (glibtop *server, glibtop_proc_kernel *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
glibtop_init__r (&server);
|
||||
glibtop_call__r (server, GLIBTOP_CMND_PROC_KERNEL, sizeof (pid_t),
|
||||
&pid, sizeof (glibtop_proc_kernel), buf);
|
||||
}
|
@@ -1,32 +0,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.
|
||||
|
||||
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 <glibtop/proclist.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Fetch list of currently running processes. */
|
||||
|
||||
unsigned *
|
||||
glibtop_get_proclist__r (glibtop *server, glibtop_proclist *buf)
|
||||
{
|
||||
glibtop_init__r (&server);
|
||||
return glibtop_call__r (server, GLIBTOP_CMND_PROCLIST, 0, NULL, sizeof (glibtop_proclist), buf);
|
||||
}
|
@@ -1,35 +0,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.
|
||||
|
||||
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 <glibtop.h>
|
||||
#include <glibtop/procsegment.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
glibtop_get_proc_segment__r (glibtop *server, glibtop_proc_segment *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
glibtop_init__r (&server);
|
||||
glibtop_call__r (server, GLIBTOP_CMND_PROC_SEGMENT, sizeof (pid_t),
|
||||
&pid, sizeof (glibtop_proc_segment), buf);
|
||||
}
|
55
lib/read.c
55
lib/read.c
@@ -23,19 +23,48 @@
|
||||
|
||||
/* Reads some data from server. */
|
||||
|
||||
void
|
||||
glibtop_read__r (glibtop *server, size_t size, void *buf)
|
||||
static void
|
||||
do_read (int s, void *ptr, size_t total_size)
|
||||
{
|
||||
size_t ssize;
|
||||
int nread;
|
||||
size_t already_read = 0, remaining = total_size;
|
||||
|
||||
while (already_read < total_size) {
|
||||
nread = recv (s, ptr, remaining, 0);
|
||||
|
||||
glibtop_init__r (&server);
|
||||
|
||||
if (read (server->input [0], &ssize, sizeof (size_t)) < 0)
|
||||
glibtop_error__r (server, _("read size: %s"), strerror (errno));
|
||||
|
||||
if (size != ssize)
|
||||
glibtop_error__r (server, _("got %d bytes but requested %d"), ssize, size);
|
||||
|
||||
if (read (server->input [0], buf, size) < 0)
|
||||
glibtop_error__r (server, _("read %d bytes: %s"), size, strerror (errno));
|
||||
if (nread == 0) {
|
||||
close (s);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nread <= 0) {
|
||||
glibtop_error_io ("recv");
|
||||
return;
|
||||
}
|
||||
|
||||
already_read += nread;
|
||||
remaining -= nread;
|
||||
(char *) ptr += nread;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
glibtop_read_l (glibtop *server, size_t size, void *buf)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
glibtop_init_r (&server, 0, 0);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf (stderr, "LIBRARY: really reading %d bytes.\n", size);
|
||||
#endif
|
||||
|
||||
if (server->socket) {
|
||||
do_read (server->socket, buf, size);
|
||||
} else {
|
||||
ret = read (server->input [0], buf, size);
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
glibtop_error_io_r (server, _("read %d bytes"), size);
|
||||
}
|
||||
|
@@ -25,24 +25,43 @@
|
||||
/* Reads some data from server. */
|
||||
|
||||
void *
|
||||
glibtop_read_data__r (glibtop *server)
|
||||
glibtop_read_data_l (glibtop *server)
|
||||
{
|
||||
size_t size;
|
||||
void *ptr;
|
||||
int ret;
|
||||
|
||||
glibtop_init__r (&server);
|
||||
glibtop_init_r (&server, 0, 0);
|
||||
|
||||
if (read (server->input [0], &size, sizeof (size_t)) < 0)
|
||||
glibtop_error__r (server, _("read data size: %s"), strerror (errno));
|
||||
#ifdef DEBUG
|
||||
fprintf (stderr, "LIBRARY: reading %d data bytes.\n", sizeof (size_t));
|
||||
#endif
|
||||
|
||||
if (server->socket) {
|
||||
ret = recv (server->socket, &size, sizeof (size_t), 0);
|
||||
} else {
|
||||
ret = read (server->input [0], &size, sizeof (size_t));
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
glibtop_error_io_r (server, _("read data size"));
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf (stderr, "LIBRARY: really reading %d data bytes (ret = %d).\n", size, ret);
|
||||
#endif
|
||||
|
||||
if (!size) return NULL;
|
||||
|
||||
fprintf (stderr, "Server has %d bytes of data.\n", size);
|
||||
ptr = glibtop_malloc_r (server, size);
|
||||
|
||||
ptr = glibtop_malloc__r (server, size);
|
||||
|
||||
if (read (server->input [0], ptr, size) < 0)
|
||||
glibtop_error__r (server, _("read data %d bytes: %s"), size, strerror (errno));
|
||||
if (server->socket) {
|
||||
ret = recv (server->socket, ptr, size, 0);
|
||||
} else {
|
||||
ret = read (server->input [0], ptr, size);
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
glibtop_error_io_r (server, _("read data %d bytes"));
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
25
lib/write.c
25
lib/write.c
@@ -24,15 +24,24 @@
|
||||
/* Writes some data to server. */
|
||||
|
||||
void
|
||||
glibtop_write__r (glibtop *server, size_t size, void *buf)
|
||||
glibtop_write_l (glibtop *server, size_t size, void *buf)
|
||||
{
|
||||
glibtop_init__r (&server);
|
||||
int ret;
|
||||
|
||||
if (write (server->output [1], &size, sizeof (size_t)) < 0)
|
||||
glibtop_error__r (server, _("write size: %s"), strerror (errno));
|
||||
glibtop_init_r (&server, 0, 0);
|
||||
|
||||
if (!size) return;
|
||||
|
||||
if (write (server->output [1], buf, size) < 0)
|
||||
glibtop_error__r (server, _("write %d bytes: %s"), size, strerror (errno));
|
||||
if (size == 0) return;
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf (stderr, "LIBRARY: really writing %d bytes.\n", size);
|
||||
#endif
|
||||
|
||||
if (server->socket) {
|
||||
ret = send (server->socket, buf, size, 0);
|
||||
} else {
|
||||
ret = write (server->output [1], buf, size);
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
glibtop_error_io_r (server, _("write %d bytes"), size);
|
||||
}
|
||||
|
81
libgtop.spec
Normal file
81
libgtop.spec
Normal file
@@ -0,0 +1,81 @@
|
||||
# Note that this is NOT a relocatable package
|
||||
%define ver 0.01
|
||||
%define rel SNAP
|
||||
%define prefix /usr
|
||||
|
||||
Summary: libgtop library
|
||||
Name: libgtop
|
||||
Version: %ver
|
||||
Release: %rel
|
||||
Copyright: LGPL
|
||||
Group: X11/Libraries
|
||||
Source: ftp://ftp.gnome.org/pub/libgtop-%{ver}.tar.gz
|
||||
BuildRoot: /tmp/libgtop-root
|
||||
Packager: Michael Fulbright <msf@redhat.com>
|
||||
URL: http://www.gnome.org
|
||||
Prereq: /sbin/install-info
|
||||
Docdir: %{prefix}/doc
|
||||
|
||||
%description
|
||||
|
||||
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.
|
||||
|
||||
|
||||
%changelog
|
||||
|
||||
* Tue Jun 2 1998 Michael Fulbright <msf@redhat.com>
|
||||
|
||||
- first version of the RPM
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
# Needed for snapshot releases.
|
||||
if [ ! -f configure ]; then
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix --disable-libgtop-examples
|
||||
else
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix --disable-libgtop-examples
|
||||
fi
|
||||
|
||||
if [ "$SMP" != "" ]; then
|
||||
(make "MAKE=make -k -j $SMP"; exit 0)
|
||||
make
|
||||
else
|
||||
make
|
||||
fi
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
make prefix=$RPM_BUILD_ROOT%{prefix} install
|
||||
|
||||
#
|
||||
# msf - remove these as they are really supposed to come from gnome-libs
|
||||
#
|
||||
rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.a
|
||||
rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.la
|
||||
rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.so.0
|
||||
rm -f $RPM_BUILD_ROOT/%{prefix}/lib/libgnomesupport.so.0.0.0
|
||||
|
||||
rm -fr $RPM_BUILD_ROOT/%{prefix}/include/libgtop
|
||||
|
||||
%clean
|
||||
#rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
|
||||
%doc ANNOUNCE AUTHORS ChangeLog NEWS README README.LATEST copyright.txt doc
|
||||
%{prefix}/bin/*
|
||||
%{prefix}/lib/lib*.so.*
|
||||
%{prefix}/lib/libgtopConf.sh
|
||||
%{prefix}/lib/*a
|
||||
%{prefix}/include/*
|
25
libgtopConf.sh.in
Normal file
25
libgtopConf.sh.in
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# Configuration of the libgtop package
|
||||
#
|
||||
|
||||
LIBGTOP_LIBDIR="@LIBGTOP_LIBDIR@"
|
||||
LIBGTOP_INCLUDEDIR="@LIBGTOP_INCLUDEDIR@"
|
||||
|
||||
LIBGTOP_LIBS="@LIBGTOP_LIBS@"
|
||||
LIBGTOP_INCS="@LIBGTOP_INCS@"
|
||||
|
||||
LIBGTOP_GUILE_LIBS="@LIBGTOP_GUILE_LIBS@"
|
||||
LIBGTOP_GUILE_INCS="@LIBGTOP_GUILE_INCS@"
|
||||
|
||||
LIBGTOP_BINDIR="@LIBGTOP_BINDIR@"
|
||||
LIBGTOP_SERVER="@LIBGTOP_SERVER@"
|
||||
|
||||
libgtop_sysdeps_dir="@libgtop_sysdeps_dir@"
|
||||
libgtop_need_server="@libgtop_need_server@"
|
||||
libgtop_use_machine_h="@libgtop_use_machine_h@"
|
||||
|
||||
libgtop_guile_found="@libgtop_guile_found@"
|
||||
|
||||
libgtop_want_names="@libgtop_want_names@"
|
||||
libgtop_want_guile_names="@libgtop_want_guile_names@"
|
||||
libgtop_want_examples="@libgtop_want_examples@"
|
1
perl/.cvsignore
Normal file
1
perl/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
Libgtop.xs Makefile blib pm_to_blib Libgtop.c Libgtop.bs Makefile.PL
|
5
perl/Changes
Normal file
5
perl/Changes
Normal file
@@ -0,0 +1,5 @@
|
||||
Revision history for Perl extension Libgtop.
|
||||
|
||||
0.01 Sun Jun 21 21:00:59 1998
|
||||
- original version; created by h2xs 1.18
|
||||
|
26
perl/Libgtop.pm
Normal file
26
perl/Libgtop.pm
Normal file
@@ -0,0 +1,26 @@
|
||||
package Libgtop;
|
||||
|
||||
use strict;
|
||||
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
|
||||
|
||||
require Exporter;
|
||||
require DynaLoader;
|
||||
require AutoLoader;
|
||||
|
||||
@ISA = qw(Exporter DynaLoader);
|
||||
# Items to export into callers namespace by default. Note: do not export
|
||||
# names by default without a very good reason. Use EXPORT_OK instead.
|
||||
# Do not simply export all your public functions/methods/constants.
|
||||
@EXPORT = qw(
|
||||
|
||||
);
|
||||
$VERSION = '0.01';
|
||||
|
||||
bootstrap Libgtop $VERSION;
|
||||
|
||||
# Preloaded methods go here.
|
||||
|
||||
# Autoload methods go after __END__, and are processed by the autosplit program.
|
||||
|
||||
1;
|
||||
__END__
|
8
perl/MANIFEST
Normal file
8
perl/MANIFEST
Normal file
@@ -0,0 +1,8 @@
|
||||
.cvsignore
|
||||
Changes
|
||||
Libgtop.pm
|
||||
MANIFEST
|
||||
Makefile.PL.in
|
||||
new.pl
|
||||
perl.awk
|
||||
test.pl
|
10
perl/Makefile.PL.in
Normal file
10
perl/Makefile.PL.in
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*-cperl-*-
|
||||
use ExtUtils::MakeMaker;
|
||||
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
|
||||
# the contents of the Makefile that is written.
|
||||
WriteMakefile('NAME' => 'Libgtop',
|
||||
'VERSION_FROM' => 'Libgtop.pm',
|
||||
'LIBS' => ['@LIBGTOP_GUILE_LIBS@'],
|
||||
'DEFINE' => '',
|
||||
'INC' => '@LIBGTOP_GUILE_INCS@',
|
||||
);
|
13
perl/new.pl
Executable file
13
perl/new.pl
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
require 5.004;
|
||||
|
||||
use blib;
|
||||
use strict;
|
||||
use Libgtop;
|
||||
|
||||
print "CPU Usage: ".join (':', Libgtop::cpu)."\n";
|
||||
print "Memory Usage: ".join (':', Libgtop::mem)."\n";
|
||||
print "Swap Usage: ".join (':', Libgtop::swap)."\n";
|
||||
|
||||
|
86
perl/perl.awk
Normal file
86
perl/perl.awk
Normal file
@@ -0,0 +1,86 @@
|
||||
BEGIN {
|
||||
print "/* Libgtop.xs */";
|
||||
print "/* This is a generated file. Please modify `perl.awk' */";
|
||||
print "";
|
||||
|
||||
print "#ifdef __cplusplus";
|
||||
print "extern \"C\" {";
|
||||
print "#endif";
|
||||
print "#include \"EXTERN.h\"";
|
||||
print "#include \"perl.h\"";
|
||||
print "#include \"XSUB.h\"";
|
||||
print "#ifdef __cplusplus";
|
||||
print "}";
|
||||
print "#endif";
|
||||
print "";
|
||||
print "#undef PACKAGE";
|
||||
print "";
|
||||
print "#include <glibtop.h>";
|
||||
print "#include <glibtop/union.h>";
|
||||
print "";
|
||||
print "MODULE = Libgtop\t\tPACKAGE = Libgtop";
|
||||
print "";
|
||||
|
||||
convert["long"] = "newSViv";
|
||||
convert["ulong"] = "newSViv";
|
||||
convert["double"] = "newSVnv";
|
||||
}
|
||||
|
||||
/^(\w+)/ {
|
||||
feature = $1;
|
||||
|
||||
print "void";
|
||||
if (feature ~ /^proc_/) {
|
||||
print feature"(pid)";
|
||||
print "\tunsigned\tpid;";
|
||||
} else {
|
||||
print feature"()";
|
||||
}
|
||||
|
||||
print "PREINIT:";
|
||||
print "\tglibtop_"feature" "feature";";
|
||||
|
||||
if (feature ~ /^proclist/) {
|
||||
print "\tunsigned i, *ptr;";
|
||||
print "PPCODE:";
|
||||
print "\tptr = glibtop_get_proclist (&proclist);";
|
||||
print "";
|
||||
print "\tif (ptr) {";
|
||||
print "\t\tfor (i = 0; i < proclist.number; i++)";
|
||||
print "\t\t\tXPUSHs (sv_2mortal (newSViv (ptr [i])));";
|
||||
print "\t}";
|
||||
print "";
|
||||
print "\tglibtop_free (ptr);";
|
||||
} else {
|
||||
print "PPCODE:";
|
||||
if (feature ~ /^proc_/) {
|
||||
print "\tglibtop_get_"feature" (&"feature", pid);";
|
||||
} else {
|
||||
print "\tglibtop_get_"feature" (&"feature");";
|
||||
}
|
||||
print "";
|
||||
|
||||
nr_elements = split ($2, elements, /:/);
|
||||
for (element = 1; element <= nr_elements; element++) {
|
||||
list = elements[element];
|
||||
type = elements[element];
|
||||
sub(/\(.*/, "", type);
|
||||
sub(/^\w+\(/, "", list); sub(/\)$/, "", list);
|
||||
count = split (list, fields, /,/);
|
||||
for (field = 1; field <= count; field++) {
|
||||
if (type ~ /^str$/) {
|
||||
print "\tXPUSHs (sv_2mortal (newSVpv ("$1"."fields[field]", 0)));";
|
||||
} else {
|
||||
if (type ~ /^char$/) {
|
||||
print "\tXPUSHs (sv_2mortal (newSVpv (&"$1"."fields[field]", 1)));";
|
||||
} else {
|
||||
print "\tXPUSHs (sv_2mortal ("convert[type]" ("$1"."fields[field]")));";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "";
|
||||
}
|
||||
|
20
perl/test.pl
Normal file
20
perl/test.pl
Normal file
@@ -0,0 +1,20 @@
|
||||
# Before `make install' is performed this script should be runnable with
|
||||
# `make test'. After `make install' it should work as `perl test.pl'
|
||||
|
||||
######################### We start with some black magic to print on failure.
|
||||
|
||||
# Change 1..1 below to 1..last_test_to_print .
|
||||
# (It may become useful if the test is moved to ./t subdirectory.)
|
||||
|
||||
BEGIN { $| = 1; print "1..1\n"; }
|
||||
END {print "not ok 1\n" unless $loaded;}
|
||||
use Libgtop;
|
||||
$loaded = 1;
|
||||
print "ok 1\n";
|
||||
|
||||
######################### End of black magic.
|
||||
|
||||
# Insert your test code below (better if it prints "ok 13"
|
||||
# (correspondingly "not ok 13") depending on the success of chunk 13
|
||||
# of the test code):
|
||||
|
@@ -2,4 +2,5 @@ Makefile
|
||||
Makefile.in
|
||||
POTFILES
|
||||
cat-id-tbl.c
|
||||
fr.gmo
|
||||
libgtop.pot
|
||||
|
8
po/ChangeLog
Normal file
8
po/ChangeLog
Normal file
@@ -0,0 +1,8 @@
|
||||
Sun, 31 May 1998 22:38:59 +0200 Vincent Renardias <vincent@waw.com>
|
||||
|
||||
* fr.po: new file - ChangeLog isn't empty anymore _(;
|
||||
|
||||
1998-05-21 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* ChangeLog: new file - currently empty
|
||||
|
247
po/Makefile.in.in
Normal file
247
po/Makefile.in.in
Normal file
@@ -0,0 +1,247 @@
|
||||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# 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.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SHELL = /bin/sh
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datadir = $(prefix)/@DATADIRNAME@
|
||||
localedir = $(datadir)/locale
|
||||
gnulocaledir = $(prefix)/share/locale
|
||||
gettextsrcdir = $(prefix)/share/gettext/po
|
||||
subdir = po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
|
||||
|
||||
CC = @CC@
|
||||
GENCAT = @GENCAT@
|
||||
GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
|
||||
MSGFMT = @MSGFMT@
|
||||
XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
|
||||
MSGMERGE = PATH=../src:$$PATH msgmerge
|
||||
|
||||
DEFS = @DEFS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
|
||||
INCLUDES = -I.. -I$(top_srcdir)/intl
|
||||
|
||||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||
|
||||
SOURCES = cat-id-tbl.c
|
||||
POFILES = @POFILES@
|
||||
GMOFILES = @GMOFILES@
|
||||
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
|
||||
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
|
||||
|
||||
POTFILES = \
|
||||
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) $<
|
||||
|
||||
.po.pox:
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
||||
|
||||
.po.mo:
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
.po.gmo:
|
||||
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
|
||||
&& rm -f $$file && $(GMSGFMT) -o $$file $<
|
||||
|
||||
.po.cat:
|
||||
sed -f ../intl/po2msg.sed < $< > $*.msg \
|
||||
&& rm -f $@ && $(GENCAT) $@ $*.msg
|
||||
|
||||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
all-yes: cat-id-tbl.c $(CATALOGS)
|
||||
all-no:
|
||||
|
||||
$(srcdir)/$(PACKAGE).pot: $(POTFILES)
|
||||
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
||||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--files-from=$(srcdir)/POTFILES.in
|
||||
rm -f $(srcdir)/$(PACKAGE).pot
|
||||
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
|
||||
|
||||
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
||||
$(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
||||
rm -f cat-id-tbl.tmp
|
||||
sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
|
||||
| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
|
||||
if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
|
||||
rm cat-id-tbl.tmp; \
|
||||
else \
|
||||
echo cat-id-tbl.c changed; \
|
||||
rm -f $(srcdir)/cat-id-tbl.c; \
|
||||
mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
|
||||
fi
|
||||
cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
|
||||
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $(datadir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(datadir); \
|
||||
fi
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
case "$$cat" in \
|
||||
*.gmo) destdir=$(gnulocaledir);; \
|
||||
*) destdir=$(localedir);; \
|
||||
esac; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
dir=$$destdir/$$lang/LC_MESSAGES; \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $$dir; \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $$dir; \
|
||||
fi; \
|
||||
if test -r $$cat; then \
|
||||
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
else \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
fi; \
|
||||
if test -r $$cat.m; then \
|
||||
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
if test -r $(srcdir)/$$cat.m ; then \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat.m \
|
||||
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $(gettextsrcdir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
||||
fi; \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
||||
$(gettextsrcdir)/Makefile.in.in; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
|
||||
uninstall:
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
done
|
||||
rm -f $(gettextsrcdir)/po-Makefile.in.in
|
||||
|
||||
check: all
|
||||
|
||||
cat-id-tbl.o: ../intl/libgettext.h
|
||||
|
||||
dvi info tags TAGS ID:
|
||||
|
||||
mostlyclean:
|
||||
rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
|
||||
rm -fr *.o
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f $(GMOFILES)
|
||||
|
||||
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: update-po $(DISTFILES)
|
||||
dists="$(DISTFILES)"; \
|
||||
for file in $$dists; do \
|
||||
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir); \
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
PATH=`pwd`/../src:$$PATH; \
|
||||
cd $(srcdir); \
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
mv $$lang.po $$lang.old.po; \
|
||||
echo "$$lang:"; \
|
||||
if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
|
||||
rm -f $$lang.old.po; \
|
||||
else \
|
||||
echo "msgmerge for $$cat failed!"; \
|
||||
rm -f $$lang.po; \
|
||||
mv $$lang.old.po $$lang.po; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
POTFILES: POTFILES.in
|
||||
( if test 'x$(srcdir)' != 'x.'; then \
|
||||
posrcprefix='$(top_srcdir)/'; \
|
||||
else \
|
||||
posrcprefix="../"; \
|
||||
fi; \
|
||||
rm -f $@-t $@ \
|
||||
&& (sed -e '/^#/d' -e '/^[ ]*$$/d' \
|
||||
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
|
||||
| sed -e '$$s/\\$$//') > $@-t \
|
||||
&& chmod a-w $@-t \
|
||||
&& mv $@-t $@ )
|
||||
|
||||
Makefile: Makefile.in.in ../config.status POTFILES
|
||||
cd .. \
|
||||
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
|
||||
$(SHELL) ./config.status
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
@@ -1,18 +1,8 @@
|
||||
lib/close.c
|
||||
lib/command.c
|
||||
lib/cpu.c
|
||||
lib/mem.c
|
||||
lib/open.c
|
||||
lib/read.c
|
||||
lib/swap.c
|
||||
lib/write.c
|
||||
lib/sysdeps.c
|
||||
lib/uptime.c
|
||||
lib/loadavg.c
|
||||
lib/shm_limits.c
|
||||
lib/msg_limits.c
|
||||
lib/sem_limits.c
|
||||
lib/proclist.c
|
||||
lib/read_data.c
|
||||
acconfig.h
|
||||
glibtop.h
|
||||
|
402
po/fr.po
Normal file
402
po/fr.po
Normal file
@@ -0,0 +1,402 @@
|
||||
# libgtop fr.po
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
# Vincent Renardias <vincent@waw.com>, 1998.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libgtop VERSION\n"
|
||||
"POT-Creation-Date: 1998-06-20 15:28+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Vincent Renardias <vincent@waw.com>\n"
|
||||
"Language-Team: Vincent Renardias <vincent@waw.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=iso-8859-1\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: lib/open.c:36
|
||||
#, c-format
|
||||
msgid "cannot make a pipe: %s\n"
|
||||
msgstr "impossible de cr<63><72>r un tube: %s\n"
|
||||
|
||||
#: lib/open.c:41
|
||||
#, c-format
|
||||
msgid "%s: fork failed: %s\n"
|
||||
msgstr "%s: duplication <20>chou<6F>e: %s\n"
|
||||
|
||||
#: lib/open.c:59
|
||||
#, c-format
|
||||
msgid "server version is not %s"
|
||||
msgstr "la version du serveur n'est pas %s"
|
||||
|
||||
#: lib/read.c:34
|
||||
#, c-format
|
||||
msgid "read size: %s"
|
||||
msgstr "taille lue: %s"
|
||||
|
||||
#: lib/read.c:37
|
||||
#, c-format
|
||||
msgid "got %d bytes but requested %d"
|
||||
msgstr "obtenu %d octets, mais %d <20>taient demand<6E>s"
|
||||
|
||||
#: lib/read.c:40
|
||||
#, c-format
|
||||
msgid "read %d bytes: %s"
|
||||
msgstr "lecture de %d octets: %s"
|
||||
|
||||
#: lib/write.c:32
|
||||
#, c-format
|
||||
msgid "write size: %s"
|
||||
msgstr "taille <20>crite: %s"
|
||||
|
||||
#: lib/write.c:37
|
||||
#, c-format
|
||||
msgid "write %d bytes: %s"
|
||||
msgstr "<22>crit %d octets: %s"
|
||||
|
||||
#: lib/read_data.c:36
|
||||
#, c-format
|
||||
msgid "read data size: %s"
|
||||
msgstr "taille de la lecture: %s"
|
||||
|
||||
#: lib/read_data.c:46
|
||||
#, c-format
|
||||
msgid "read data %d bytes: %s"
|
||||
msgstr "lecture de %d octets de donn<6E>es: %s"
|
||||
|
||||
#: sysdeps/common/xmalloc.c:32
|
||||
#, c-format
|
||||
msgid "malloc %d bytes: %s"
|
||||
msgstr "malloc de %d octets: %s"
|
||||
|
||||
#: sysdeps/common/xmalloc.c:44
|
||||
#, c-format
|
||||
msgid "calloc %d block (%d bytes each): %s"
|
||||
msgstr "calloc de %d blocks (%d octets chacuns): %s"
|
||||
|
||||
#: sysdeps/common/xmalloc.c:56
|
||||
#, c-format
|
||||
msgid "realloc %d bytes: %s"
|
||||
msgstr "realloc de %d octets: %s"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:42 sysdeps/names/sysdeps.c:62
|
||||
msgid "CPU Usage"
|
||||
msgstr "Utilisation CPU"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:43 sysdeps/names/sysdeps.c:63
|
||||
msgid "Memory Usage"
|
||||
msgstr "Utilisation M<>moire"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:44 sysdeps/names/sysdeps.c:64
|
||||
msgid "Swap Usage"
|
||||
msgstr "Utilisation du Swap"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:45 sysdeps/names/sysdeps.c:65
|
||||
msgid "System Uptime"
|
||||
msgstr "Uptime du syst<73>me"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:46 sysdeps/names/sysdeps.c:66
|
||||
msgid "Load Averange"
|
||||
msgstr "Charge moyenne"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:47 sysdeps/names/sysdeps.c:67
|
||||
msgid "Shared Memory Limits"
|
||||
msgstr "Limites de la m<>moire partag<61>e"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:48 sysdeps/names/sysdeps.c:68
|
||||
msgid "Message Queue Limits"
|
||||
msgstr "Limites de la queue de messages"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:49 sysdeps/names/sysdeps.c:69
|
||||
msgid "Semaphore Set Limits"
|
||||
msgstr "Limites de l'ensemble de s<>maphores"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:50 sysdeps/names/sysdeps.c:70
|
||||
msgid "List of running Processes"
|
||||
msgstr "Liste des taches en cours d'<27>x<EFBFBD>cution"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:51 sysdeps/names/sysdeps.c:71
|
||||
msgid "Process Status information"
|
||||
msgstr "Information sur l'<27>tat du processus"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:52 sysdeps/names/sysdeps.c:72
|
||||
msgid "Process UID and TTY information"
|
||||
msgstr "Information UID et TTY du processus"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:53 sysdeps/names/sysdeps.c:73
|
||||
msgid "Process Memory information"
|
||||
msgstr "Information M<>moire du Processus"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:54 sysdeps/names/sysdeps.c:74
|
||||
msgid "Process Time information"
|
||||
msgstr "Information Temporelle sur le processus"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:55 sysdeps/names/sysdeps.c:75
|
||||
msgid "Process Signal information"
|
||||
msgstr "Information sur les signaux du processus"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:56 sysdeps/names/sysdeps.c:76
|
||||
msgid "Process Kernel Data information"
|
||||
msgstr "Information sur les donn<6E>es noyau du processus"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:57 sysdeps/names/sysdeps.c:77
|
||||
msgid "Process Segment information"
|
||||
msgstr "Information sur la segmentation du processus"
|
||||
|
||||
#: sysdeps/names/cpu.c:37
|
||||
msgid "Total CPU Time"
|
||||
msgstr "Temps CPU Total"
|
||||
|
||||
#: sysdeps/names/cpu.c:38
|
||||
msgid "CPU Time in User Mode"
|
||||
msgstr "Temps CPU en mode utilisateur"
|
||||
|
||||
#: sysdeps/names/cpu.c:39
|
||||
msgid "CPU Time in User Mode (nice)"
|
||||
msgstr "Temps CPU en mode utilisateur (nice)"
|
||||
|
||||
#: sysdeps/names/cpu.c:40
|
||||
msgid "CPU Time in System Mode"
|
||||
msgstr "Temps CPU en mode syst<73>me"
|
||||
|
||||
#: sysdeps/names/cpu.c:41
|
||||
msgid "CPU Time in the Idle Task"
|
||||
msgstr "Temps CPU pour la tache inactive"
|
||||
|
||||
#: sysdeps/names/cpu.c:42
|
||||
msgid "Tick Frequency"
|
||||
msgstr "Fr<46>quence des ticks"
|
||||
|
||||
#: sysdeps/names/cpu.c:47
|
||||
msgid "The number of jiffies (1/100ths of a second) since system boot"
|
||||
msgstr "Nombre de jiffies (1/100e de seconde) depuis le boot du syst<73>me"
|
||||
|
||||
#: sysdeps/names/cpu.c:49
|
||||
msgid ""
|
||||
"The number of jiffies (1/100ths of a second) that the system spent in user "
|
||||
"mode"
|
||||
msgstr "Le nombre de jiffies (1/100<30>me de seconde) que le systme a pass<73> en mode utilisateur"
|
||||
|
||||
#: sysdeps/names/cpu.c:51
|
||||
msgid ""
|
||||
"The number of jiffies (1/100ths of a second) that the system spent in user "
|
||||
"mode with low priority (nice)"
|
||||
msgstr "Le nombre de jiffies (1/100<30>me de seconde) que le syst<73>me a pass<73> en mode utilisateur en priorit<69> basse (nice)"
|
||||
|
||||
#: sysdeps/names/cpu.c:53
|
||||
msgid ""
|
||||
"The number of jiffies (1/100ths of a second) that the system spent in system "
|
||||
"mode"
|
||||
msgstr "Le nombre de jiffies (1/100<30>me de seconde) que le syst<73>me a pass<73> en mode syst<73>me"
|
||||
|
||||
#: sysdeps/names/cpu.c:55
|
||||
msgid ""
|
||||
"The number of jiffies (1/100ths of a second) that the system spend in the "
|
||||
"idle task"
|
||||
msgstr "Le nombre de jiffies (1/100<30>me de seconde) que le systme a pass<73> dans le processus inactif (idle task)"
|
||||
|
||||
#: sysdeps/names/cpu.c:57
|
||||
msgid ""
|
||||
"All of the above values are in jiffies (1/100ths of a second) unless "
|
||||
"otherwise stated in this field (i.e. 'frequency != 100')"
|
||||
msgstr "Toutes les valeurs ci-dessus sont exprim<69>es en jiffies (1/100<30>me de seconde) sauf pr<70>cision contraire (i.e.: fr<66>quence != 100)"
|
||||
|
||||
#: sysdeps/names/loadavg.c:36
|
||||
msgid "Load Average"
|
||||
msgstr "Charge Moyenne"
|
||||
|
||||
#: sysdeps/names/loadavg.c:41
|
||||
msgid "Number of jobs running simultaneously averaged over 1, 5 and 15 minutes"
|
||||
msgstr "Nombre de processus tournant simultannement en moyenne sur 1, 5 et 15 minutes"
|
||||
|
||||
#: sysdeps/names/mem.c:39
|
||||
msgid "Total Memory"
|
||||
msgstr "M<>moire Totale"
|
||||
|
||||
#: sysdeps/names/mem.c:40
|
||||
msgid "Used Memory"
|
||||
msgstr "M<>moire Utilis<69>e"
|
||||
|
||||
#: sysdeps/names/mem.c:41
|
||||
msgid "Free Memory"
|
||||
msgstr "M<>moire Libre"
|
||||
|
||||
#: sysdeps/names/mem.c:42
|
||||
msgid "Shared Memory"
|
||||
msgstr "M<>moire Partag<61>e"
|
||||
|
||||
#: sysdeps/names/mem.c:43
|
||||
msgid "Buffers"
|
||||
msgstr "Tampons"
|
||||
|
||||
#: sysdeps/names/mem.c:44
|
||||
msgid "Cached"
|
||||
msgstr "Dans le cache"
|
||||
|
||||
#: sysdeps/names/mem.c:45
|
||||
msgid "User"
|
||||
msgstr "Utilisateur"
|
||||
|
||||
#: sysdeps/names/mem.c:46
|
||||
msgid "Locked"
|
||||
msgstr "V<>rouill<6C>"
|
||||
|
||||
#: sysdeps/names/mem.c:51
|
||||
msgid "Total physical memory in kB"
|
||||
msgstr "M<>moire physique totalle en Ko"
|
||||
|
||||
#: sysdeps/names/mem.c:52
|
||||
msgid "Used memory size in kB"
|
||||
msgstr "M<>moire utilis<69>e en Ko"
|
||||
|
||||
#: sysdeps/names/mem.c:53
|
||||
msgid "Free memory size in kB"
|
||||
msgstr "M<>moire libre en Ko"
|
||||
|
||||
#: sysdeps/names/mem.c:54
|
||||
msgid "Shared memory size in kB"
|
||||
msgstr "M<>moire partag<61>e en Ko"
|
||||
|
||||
#: sysdeps/names/mem.c:55
|
||||
msgid "Size of buffers kB"
|
||||
msgstr "Taille des tampons en Ko"
|
||||
|
||||
#: sysdeps/names/mem.c:56
|
||||
msgid "Size of cached memory in kB"
|
||||
msgstr "Taille de la m<>moire dans le cache en Ko"
|
||||
|
||||
#: sysdeps/names/mem.c:57
|
||||
msgid "Memory used from user processes in kB"
|
||||
msgstr "M<>moire utilis<69>e par les processus utilisateurs en Ko"
|
||||
|
||||
#: sysdeps/names/mem.c:58
|
||||
msgid "Memory in locked pages in kB"
|
||||
msgstr "M<>moire dans les pages v<>rouill<6C>es en Ko"
|
||||
|
||||
#: sysdeps/names/swap.c:36 sysdeps/names/swap.c:43
|
||||
msgid "Total Swap Space"
|
||||
msgstr "Taille totalle de la zone d'<27>change"
|
||||
|
||||
#: sysdeps/names/swap.c:37 sysdeps/names/swap.c:44
|
||||
msgid "Used Swap Space"
|
||||
msgstr "Taille utilis<69>e de la zone d'<27>change"
|
||||
|
||||
#: sysdeps/names/swap.c:38 sysdeps/names/swap.c:45
|
||||
msgid "Free Swap Space"
|
||||
msgstr "Espace libre de la zone d'<27>change"
|
||||
|
||||
#: sysdeps/names/uptime.c:36
|
||||
msgid "Uptime"
|
||||
msgstr "Uptime"
|
||||
|
||||
#: sysdeps/names/uptime.c:37
|
||||
msgid "Idletime"
|
||||
msgstr "Idletime"
|
||||
|
||||
#: sysdeps/names/uptime.c:42
|
||||
msgid "Time in seconds since system boot"
|
||||
msgstr "Temps en secondes depuis le d<>marrage du syst<73>me"
|
||||
|
||||
#: sysdeps/names/uptime.c:43
|
||||
msgid "Time in seconds the system spent in the idle task since system boot"
|
||||
msgstr "Temps en secondes pass<73> dans le processus inactif depuis le d<>marrage du syst<73>me"
|
||||
|
||||
#: sysdeps/names/shm_limits.c:37 sysdeps/names/shm_limits.c:46
|
||||
msgid "Max segment size"
|
||||
msgstr "Taille maximum des segments"
|
||||
|
||||
#: sysdeps/names/shm_limits.c:38 sysdeps/names/shm_limits.c:47
|
||||
msgid "Min segment size"
|
||||
msgstr "Taille minimum des segments"
|
||||
|
||||
#: sysdeps/names/shm_limits.c:39 sysdeps/names/shm_limits.c:48
|
||||
msgid "Max number of segments"
|
||||
msgstr "Nombre maximum des segments"
|
||||
|
||||
#: sysdeps/names/shm_limits.c:40 sysdeps/names/shm_limits.c:49
|
||||
msgid "Max shared segments per process"
|
||||
msgstr "Nombre maximum de segments partag<61>s par processus"
|
||||
|
||||
#: sysdeps/names/shm_limits.c:41 sysdeps/names/shm_limits.c:50
|
||||
msgid "Max total shared memory"
|
||||
msgstr "Taille totalle de la m<>moire partag<61>e"
|
||||
|
||||
#: sysdeps/names/msg_limits.c:37 sysdeps/names/msg_limits.c:48
|
||||
msgid "Size in kilobytes of message pool"
|
||||
msgstr "Taille en kilo-octets du pool de messages"
|
||||
|
||||
#: sysdeps/names/msg_limits.c:38 sysdeps/names/msg_limits.c:49
|
||||
msgid "Number of entries in message map"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/msg_limits.c:39 sysdeps/names/msg_limits.c:50
|
||||
msgid "Max size of message"
|
||||
msgstr "Taille maximum des messages"
|
||||
|
||||
#: sysdeps/names/msg_limits.c:40 sysdeps/names/msg_limits.c:51
|
||||
msgid "Default max size of queue"
|
||||
msgstr "Taille maximum par d<>faut de la queue"
|
||||
|
||||
#: sysdeps/names/msg_limits.c:41 sysdeps/names/msg_limits.c:52
|
||||
msgid "Max queues system wide"
|
||||
msgstr "Nombre maximum de queues dans le syst<73>me"
|
||||
|
||||
#: sysdeps/names/msg_limits.c:42 sysdeps/names/msg_limits.c:53
|
||||
msgid "Message segment size"
|
||||
msgstr "Taille des segments de messages"
|
||||
|
||||
#: sysdeps/names/msg_limits.c:43 sysdeps/names/msg_limits.c:54
|
||||
msgid "Number of system message headers"
|
||||
msgstr "Nombre d'entetes de messages syst<73>me"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:39 sysdeps/names/sem_limits.c:53
|
||||
msgid "Number of entries in semaphore map"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/sem_limits.c:40 sysdeps/names/sem_limits.c:54
|
||||
msgid "Max number of arrays"
|
||||
msgstr "Nombre maximum de tables"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:41 sysdeps/names/sem_limits.c:55
|
||||
msgid "Max semaphores system wide"
|
||||
msgstr "Nombre maximum de s<>maphores dans le syst<73>me"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:42 sysdeps/names/sem_limits.c:56
|
||||
msgid "Number of undo structures system wide"
|
||||
msgstr "Nombre de structures 'undo' dans le syst<73>me"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:43 sysdeps/names/sem_limits.c:57
|
||||
msgid "Max semaphores per array"
|
||||
msgstr "Nombre maximum de s<>maphores par table"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:44 sysdeps/names/sem_limits.c:58
|
||||
msgid "Max ops per semop call"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/sem_limits.c:45 sysdeps/names/sem_limits.c:59
|
||||
msgid "Max number of undo entries per process"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/sem_limits.c:46 sysdeps/names/sem_limits.c:60
|
||||
msgid "sizeof struct sem_undo"
|
||||
msgstr "sizeof struct sem_undo"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:47 sysdeps/names/sem_limits.c:61
|
||||
msgid "Semaphore max value"
|
||||
msgstr "Valeur maximum d'un s<>maphore"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:48 sysdeps/names/sem_limits.c:62
|
||||
msgid "Adjust on exit max value"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/proclist.c:36 sysdeps/names/proclist.c:43
|
||||
msgid "Number of list elements"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/proclist.c:37 sysdeps/names/proclist.c:44
|
||||
msgid "Total size of list"
|
||||
msgstr "Taille totalle de la liste"
|
||||
|
||||
#: sysdeps/names/proclist.c:38 sysdeps/names/proclist.c:45
|
||||
msgid "Size of a single list element"
|
||||
msgstr ""
|
@@ -1 +1 @@
|
||||
SUBDIRS = server
|
||||
SUBDIRS = server proxy daemon
|
||||
|
3
src/daemon/.cvsignore
Normal file
3
src/daemon/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
Makefile.in
|
||||
Makefile
|
||||
gnuserv
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user