Compare commits

...

67 Commits

Author SHA1 Message Date
Martin Baulig
321f5180f7 Fixing mistakes from previous checkin. 1998-06-11 23:53:16 +00:00
Martin Baulig
d9874dca81 Replaced call to gh_append2 ()' with gh_append ()'.
1998-06-12  Martin Baulig  <baulig@taurus.uni-trier.de>

	* sysdeps/guile/proclist.c: Replaced call to
	`gh_append2 ()' with `gh_append ()'.
1998-06-11 22:45:18 +00:00
Martin Baulig
0d744987ff removed that directory.
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.

I have now removed all the `support' stuff from libgtop. It uses
'-lgnomesupport' from gnome-libs when it's required. So you have to
build gnome-libs before you can build libgtop.

If all works well, this is my last checkin into the stable branch.
I will now continue working on the main trunk.

Martin
1998-06-05 15:06:54 +00:00
Martin Baulig
e6b544af80 Removed stuff from support directory. 1998-06-05 14:40:20 +00:00
Martin Baulig
266d62bc3c Added sample spec file for libgtop. 1998-06-03 17:30:56 +00:00
Martin Baulig
4c3fb58e3e New file.
* 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'.
1998-06-03 17:29:47 +00:00
Martin Baulig
223f986205 only including intl headers while compiling libgtop.
* include/glibtop/global.h: only including intl headers
while compiling libgtop.
1998-06-03 17:27:26 +00:00
Martin Baulig
ec0d751472 Committing Federico's changes into the stable branch. 1998-06-03 11:06:53 +00:00
Martin Baulig
005eaa8e95 *** empty log message *** 1998-06-02 23:13:30 +00:00
Martin Baulig
dd0258acf9 Fixed `broken pipe' error when server is running SUID; accidentally uses
* src/server/main.c: Fixed `broken pipe' error when server
is running SUID; accidentally uses setreuid () instead of
setregid ().
1998-05-25 17:13:16 +00:00
Martin Baulig
15caaaf34f added memory statistics.
* sysdeps/sun4/{open.c, mem.c, glibtop_machine.h}: added
memory statistics.
1998-05-24 16:16:59 +00:00
Martin Baulig
ff3aced01e added `locked' member to this structure for SunOS.
* include/glibtop/mem.h (_glibtop_mem): added `locked'
member to this structure for SunOS.
1998-05-24 16:15:24 +00:00
Martin Baulig
b281735ba7 *** empty log message *** 1998-05-23 23:06:34 +00:00
Martin Baulig
109f8dc608 Started porting. Getting CPU usage now working. Took a lot of code from
* sysdeps/sun4/{open.c, cpu.c}: Started porting.
Getting CPU usage now working. Took a lot of code
from top-3.4.
1998-05-23 23:05:08 +00:00
Martin Baulig
37e161bcec New file. System dependend header file for SunOS.
* sysdeps/sun4/glibtop_machine.h: New file.
System dependend header file for SunOS.
1998-05-23 23:03:59 +00:00
Martin Baulig
00176cd6e8 Added 'machine_incs' again. 1998-05-23 23:00:46 +00:00
Martin Baulig
40b6a23c63 Fixed 'need_gnome_support' typo. 1998-05-23 16:08:27 +00:00
Martin Baulig
e5ad7e782f *** empty log message *** 1998-05-23 13:51:28 +00:00
Martin Baulig
977a3695f6 removed -I$(includedir).
* */Makefile.am (INCLUDES): removed -I$(includedir).
1998-05-23 13:50:46 +00:00
Martin Baulig
39be9f45bb added -D_IN_LIBGTOP
* configure.in (CFLAGS): added -D_IN_LIBGTOP
1998-05-23 13:46:31 +00:00
Martin Baulig
7cd525974a Added information about struct fields. 1998-05-22 23:56:06 +00:00
Martin Baulig
29ba1a484b Fixed typo. 1998-05-22 23:55:35 +00:00
Martin Baulig
cd9d6bbb39 *** empty log message *** 1998-05-22 23:35:09 +00:00
Martin Baulig
1e541ba56c New files. This is a reference manual that gets automatically build from
* doc/{libgtop-ref.sgml, libgtop-ref.dsl}: New files.
This is a reference manual that gets automatically
build from make-docbook.scm.
1998-05-22 23:33:23 +00:00
Martin Baulig
c67ba32006 Small bugfixes. 1998-05-22 23:24:06 +00:00
Martin Baulig
26628a6214 New file. Uses the guile interface of libgtop to create docbook
* guile/make-docbook.scm: New file. Uses the guile
interface of libgtop to create docbook documentation
for all functions.
1998-05-22 23:22:03 +00:00
Martin Baulig
33f52f01b8 *** empty log message *** 1998-05-22 00:42:47 +00:00
Martin Baulig
bee25bc218 *** empty log message *** 1998-05-21 23:30:35 +00:00
Martin Baulig
022369f08a 'gtopConf.sh' has been renamed to 'libgtopConf.sh'; variables in this
* Makefile.am: 'gtopConf.sh' has been renamed to
'libgtopConf.sh'; variables in this script have changed.
1998-05-21 23:29:00 +00:00
Martin Baulig
1d47b76ea1 uses '@LIBGTOP_SERVER@' instead of '@GTOP_SERVER@'.
* lib/Makefile.am: uses '@LIBGTOP_SERVER@' instead of
'@GTOP_SERVER@'.
1998-05-21 23:26:18 +00:00
Martin Baulig
37efa42ec6 renamed variables for 'libgtopConf.sh.in'.
* configure.in: renamed variables for 'libgtopConf.sh.in'.
1998-05-21 23:24:53 +00:00
Martin Baulig
f0f9b51b47 added 'NEED_LIBGTOP'.
* acconfig.h: added 'NEED_LIBGTOP'.
1998-05-21 23:22:59 +00:00
Martin Baulig
7e13eec9f6 rewrote that macro - moved some of the code to
* 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.
1998-05-21 23:21:25 +00:00
Martin Baulig
6241c3c65f renamed from 'gtopConf.sh.in'; we now define 'LIBGTOP_LIBDIR',
* 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'.
1998-05-21 23:20:07 +00:00
Martin Baulig
10a7ef87b9 *** empty log message *** 1998-05-21 20:37:06 +00:00
Martin Baulig
dc88112433 added information about latest changes in 'acinclude.m4' and
* doc/gnome-hackers.sgml: added information about latest
changes in 'acinclude.m4' and 'gtopConf.sh.in'.
1998-05-21 20:34:06 +00:00
Martin Baulig
998392ec05 conditionally building 'examples' subdir, added 'copyright.txt' to
* Makefile.am: conditionally building 'examples' subdir,
added 'copyright.txt' to EXTRA_DIST.
1998-05-21 20:31:04 +00:00
Martin Baulig
604c7dc48e added 'gtop_guile_found', 'gtop_want_names', 'gtop_want_guile_names' and
* 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.
1998-05-21 20:29:23 +00:00
Martin Baulig
0a5e9d5c24 added 'GLIBTOP_EXAMPLES'.
* acconfig.h: added 'GLIBTOP_EXAMPLES'.
1998-05-21 20:26:38 +00:00
Martin Baulig
15d96eb9a1 define 'GLIBTOP_NAMES' when building libgtop and a new conditional
* 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'.
1998-05-21 20:25:21 +00:00
Martin Baulig
066c74d11d added 'GTOP_GUILE_FOUND', 'GTOP_WANT_NAMES', 'GTOP_WANT_GUILE_NAMES' and
* gtopConf.sh.in: added 'GTOP_GUILE_FOUND', 'GTOP_WANT_NAMES',
'GTOP_WANT_GUILE_NAMES' and 'GTOP_WANT_EXAMPLES'.
1998-05-21 20:18:29 +00:00
Martin Baulig
d7e1c5d56a new file - header file now get properly installed and go into the
* include/glibtop/Makefile.am: new file - header file
now get properly installed and go into the distribution.
1998-05-21 20:10:24 +00:00
Martin Baulig
eb42a9e0cc new file
* include/Makefile.am: new file
1998-05-21 20:10:05 +00:00
Martin Baulig
436bef3790 added 'DIST_SUBDIRS'
* sysdeps/guile/Makefile.am: added 'DIST_SUBDIRS'
1998-05-21 20:07:29 +00:00
Martin Baulig
5e70e5fa9f added 'DIST_SUBDIRS'
* sysdeps/Makefile.am: added 'DIST_SUBDIRS'
1998-05-21 20:06:55 +00:00
Martin Baulig
033f27430c new file - currently empty
* ChangeLog: new file - currently empty
1998-05-21 20:02:31 +00:00
Martin Baulig
50e59e9a85 added note about 'doc/gnome-hackers.sgml'.
* NEWS: added note about 'doc/gnome-hackers.sgml'.
1998-05-21 17:51:18 +00:00
Martin Baulig
8425bb7c04 new file - short intro on how to use libgtop in the gnome project;
* doc/gnome-hackers.sgml: new file - short intro on how
to use libgtop in the gnome project; especially 'configure'
and 'gtopConf.sh'.
1998-05-21 17:48:03 +00:00
Martin Baulig
afb564b63d new file - sets output filename and directory for 'gnome-hackers.sgml'.
* 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'.
1998-05-21 17:46:54 +00:00
Martin Baulig
a83ab971d0 'GTOP_INCS' and 'GTOP_LIBS' now really point to the places where
* 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'.
1998-05-21 17:43:24 +00:00
Martin Baulig
57a44598b9 added 'machine_incs' which is used in 'INCLUDES' in several
* 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-21 17:41:28 +00:00
Martin Baulig
dec10a8221 INCLUDES no longer uses @GTOP_INCS@ which now points to where the
stuff gets installed and now longer to the build directories.

Added '-D_GNU_SOURCE' to INCLUDES.
1998-05-21 17:37:51 +00:00
Martin Baulig
f39948ae54 added more detailed description of today's changes.
* NEWS: added more detailed description of
today's changes.
1998-05-20 23:14:55 +00:00
Martin Baulig
bb959df4b2 added required check for 'GLIBGTOP_GUILE_NAMES'.
* examples/third.c: added required check for
'GLIBGTOP_GUILE_NAMES'.
1998-05-20 21:04:10 +00:00
Martin Baulig
a6f0f33112 only build 'names' subdir when necessary.
* sysdeps/guile/Makefile.am: only build 'names'
subdir when necessary.
1998-05-20 21:01:41 +00:00
Martin Baulig
8bd9f46d1a only build 'names' subdir when necessary.
* sysdeps/Makefile.am: only build 'names' subdir
when necessary.
1998-05-20 21:01:04 +00:00
Martin Baulig
6d3b740a2c added '--enable-libgtop-server' (default=auto), '--enable-libgtop-names'
* 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'
1998-05-20 20:56:12 +00:00
Martin Baulig
e1cdfc78c1 added definition of 'GTOP_GUILE_LIBS' and 'GTOP_GUILE_INCS':
* 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?]
1998-05-20 18:50:10 +00:00
Martin Baulig
d863bc7130 *** empty log message *** 1998-05-19 23:51:03 +00:00
Martin Baulig
56a0d62358 added implementation for DEC OSF/1.
* sysdeps/osf1/procuid.c (glibtop_get_proc_uid__r):
added implementation for DEC OSF/1.
1998-05-19 23:03:56 +00:00
Martin Baulig
2ece5e5f8e forgot to checkin
* sysdeps/sun4/uptime.c: forgot to checkin

* sysdeps/sun4/loadavg.c: forgot to checkin
1998-05-19 23:03:48 +00:00
Martin Baulig
92dc0c9a34 forgot to checkin
* sysdeps/osf1/uptime.c: forgot to checkin

* sysdeps/osf1/loadavg.c: forgot to checkin
1998-05-19 23:02:39 +00:00
Martin Baulig
258732b8a1 *** empty log message *** 1998-05-19 18:47:24 +00:00
Martin Baulig
f171a2a5ca Libgtop is now in the GNOME CVS Repository.
* NEWS: Libgtop is now in the GNOME CVS Repository.
1998-05-19 18:47:09 +00:00
Martin Baulig
bf7eb7af5e new file
* ABOUT-NLS: new file
1998-05-19 18:44:37 +00:00
Martin Baulig
ab9c7e593d new file
* po/Makefile.in.in: new file
1998-05-19 18:44:13 +00:00
Martin Baulig
d74eaeb6c8 forgot this file all the time - stub for glibtop_uptime
* 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
1998-05-19 18:43:46 +00:00
82 changed files with 4642 additions and 2591 deletions

View File

@@ -13,12 +13,14 @@ gtopConf.sh
i386-bsdi i386-bsdi
i686-pc-linux-gnu i686-pc-linux-gnu
intl intl
libgtop-0.01.tar.gz
libgtop-mirror.sh.swp libgtop-mirror.sh.swp
libgtopConf.sh
libtool libtool
ltconfig ltconfig
ltmain.sh
macros
stamp-h stamp-h
sun4 sun4
sun4sol2 sun4sol2
ltmain.sh
macros
support support

225
ABOUT-NLS Normal file
View 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.

211
ChangeLog
View File

@@ -1,3 +1,214 @@
1998-06-12 Martin Baulig <baulig@taurus.uni-trier.de>
* sysdeps/guile/proclist.c: Replaced call to
`gh_append2 ()' with `gh_append ()'.
* sysdeps/guile/names/*.c: dito.
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-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> 1998-05-17 Martin Baulig <martin@home-of-linux.org>
* NEWS: added some stuff from 'README.LATEST'. * NEWS: added some stuff from 'README.LATEST'.

View File

@@ -1,12 +1,18 @@
## Process this file with automake to produce Makefile.in. ## 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 src lib
include_HEADERS = SUBDIRS = po intl 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: release:
$(MAKE) dist distdir=$(PACKAGE)$(VERSION) $(MAKE) dist distdir=$(PACKAGE)$(VERSION)
@@ -14,7 +20,7 @@ release:
## Put `exec' in the name because this should be installed by ## Put `exec' in the name because this should be installed by
## `install-exec', not `install-data'. ## `install-exec', not `install-data'.
confexecdir=$(libdir) confexecdir=$(libdir)
confexec_DATA = $(top_builddir)/gtopConf.sh confexec_DATA = $(top_builddir)/libgtopConf.sh
## to automatically rebuild aclocal.m4 if any of the macros in ## to automatically rebuild aclocal.m4 if any of the macros in
## `macros/' change ## `macros/' change
@@ -22,20 +28,26 @@ confexec_DATA = $(top_builddir)/gtopConf.sh
@MAINT@macros/macros.dep: macros/Makefile.am @MAINT@macros/macros.dep: macros/Makefile.am
@MAINT@ cd macros && $(MAKE) macros.dep @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 ## to get the paths expanded correctly. Macros like srcdir are given
## the value NONE in configure if the user doesn't specify them (this ## the value NONE in configure if the user doesn't specify them (this
## is an autoconf feature, not a bug). ## 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. ## Use sed and then mv to avoid problems if the user interrupts.
sed -e 's,\@GTOP_LIBDIR\@,$(libdir),g' \ sed -e 's,\@LIBGTOP_LIBDIR\@,$(libdir),g' \
-e 's,\@GTOP_INCLUDEDIR\@,$(includedir),g' \ -e 's,\@LIBGTOP_INCLUDEDIR\@,$(includedir),g' \
-e 's,\@GTOP_LIBS\@,$(GTOP_LIBS),g' \ -e 's,\@LIBGTOP_LIBS\@,$(LIBGTOP_LIBS),g' \
-e 's,\@GTOP_INCS\@,$(GTOP_INCS),g' \ -e 's,\@LIBGTOP_INCS\@,$(LIBGTOP_INCS),g' \
-e 's,\@GTOP_BINDIR\@,$(GTOP_BINDIR),g' \ -e 's,\@LIBGTOP_GUILE_LIBS\@,$(LIBGTOP_GUILE_LIBS),g' \
-e 's,\@GTOP_SERVER\@,$(GTOP_SERVER),g' \ -e 's,\@LIBGTOP_GUILE_INCS\@,$(LIBGTOP_GUILE_INCS),g' \
-e 's,\@GTOP_SYSDEPS_DIR\@,$(sysdeps_dir),g' \ -e 's,\@LIBGTOP_BINDIR\@,$(LIBGTOP_BINDIR),g' \
-e 's,\@GTOP_NEED_SERVER\@,$(need_server),g' \ -e 's,\@LIBGTOP_SERVER\@,$(LIBGTOP_SERVER),g' \
-e 's,\@GTOP_USE_MACHINE_H\@,$(use_glibtop_machine_h),g' \ -e 's,\@libgtop_sysdeps_dir\@,$(libgtop_sysdeps_dir),g' \
< $(srcdir)/gtopConf.sh.in > gtopConf.tmp \ -e 's,\@libgtop_need_server\@,$(libgtop_need_server),g' \
&& mv gtopConf.tmp gtopConf.sh -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

37
NEWS
View File

@@ -1,5 +1,42 @@
$Id$ $Id$
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 May/17/1998
=========== ===========

View File

@@ -28,3 +28,8 @@
#undef HAVE_GLIBTOP_MACHINE_H #undef HAVE_GLIBTOP_MACHINE_H
#undef GLIBTOP_NAMES
#undef GLIBTOP_GUILE_NAMES
#undef GLIBTOP_EXAMPLES
#undef NEED_LIBGTOP

View File

@@ -29,558 +29,158 @@ AC_DEFUN([AC_LC_CANONICAL_HOST],[
AC_DEFUN([AC_LC_SYSDEPS],[ AC_DEFUN([AC_LC_SYSDEPS],[
AC_REQUIRE([AC_LC_CANONICAL_HOST]) AC_REQUIRE([AC_LC_CANONICAL_HOST])
AC_MSG_CHECKING(for sysdeps directory) AC_REQUIRE([GNOME_LIBGTOP_SYSDEPS])
AC_ARG_WITH(sysdeps,
[ --with-sysdeps=dir which sysdeps directory should be used [default=auto]], AC_MSG_CHECKING(whether we need the gtop_server)
[if test "x$withval" = "xyes" ; then
ac_cv_sysdeps_dir=yes AC_ARG_ENABLE(libgtop-server,
elif test "x$withval" = "xauto" ; then [ --enable-libgtop-server use gtop_server [default=auto]],
ac_cv_sysdeps_dir=yes [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 else
ac_cv_sysdeps_dir=$withval libgtop_want_names=$enableval
fi],[ac_cv_sysdeps_dir=yes]) fi],[libgtop_want_names=yes])
if test "x$ac_cv_sysdeps_dir" = "xyes" ; then
case "$host_os" in AC_MSG_RESULT($libgtop_want_names)
linux*)
sysdeps_dir=linux if test x$libgtop_want_names = xyes ; then
use_glibtop_machine_h=no AC_DEFINE(GLIBTOP_NAMES)
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
fi fi
test -d $srcdir/sysdeps/$sysdeps_dir || sysdeps_dir=stub
AC_MSG_RESULT($sysdeps_dir) AM_CONDITIONAL(GLIBTOP_NAMES, test x$libgtop_want_names = xyes)
AC_SUBST(sysdeps_dir)
AC_SUBST(need_server) 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]],
# Like AC_CONFIG_HEADER, but automatically create stamp file. [if test "x$enableval" = "xyes" ; then
libgtop_want_guile=yes
AC_DEFUN(AM_CONFIG_HEADER, else
[AC_PREREQ([2.12]) libgtop_want_guile=$enableval
AC_CONFIG_HEADER([$1]) fi],[libgtop_want_guile=yes])
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 AC_MSG_RESULT($libgtop_want_guile)
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/". AC_MSG_CHECKING(whether building of the examples is requested)
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, AC_ARG_ENABLE(libgtop-examples,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, [ --disable-libgtop-examples disable building of the examples],
<<am_indx=1 [if test "x$enableval" = "xyes" ; then
for am_file in <<$1>>; do libgtop_want_examples=yes
case " <<$>>CONFIG_HEADERS " in else
*" <<$>>am_file "*<<)>> libgtop_want_examples=$enableval
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx fi],[libgtop_want_examples=yes])
;;
esac AC_MSG_RESULT($libgtop_want_examples)
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>) if test x$libgtop_want_examples = xyes ; then
changequote([,]))]) AC_DEFINE(GLIBTOP_EXAMPLES)
fi
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things. AM_CONDITIONAL(GLIBTOP_EXAMPLES, test x$libgtop_want_examples = xyes)
# But this isn't really a big deal.
if test x$libgtop_use_machine_h = xyes ; then
# serial 1 machine_incs="-I\$(top_srcdir)/sysdeps/$sysdeps_dir"
fi
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_SUBST(machine_incs)
AC_SUBST(libgtop_want_names)
AC_DEFUN(AM_INIT_AUTOMAKE, AC_SUBST(libgtop_want_guile)
[AC_REQUIRE([AM_PROG_INSTALL]) AC_SUBST(libgtop_want_examples)
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
]) ])
######################################################################
# 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. # 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.
AC_DEFUN(AM_SANITY_CHECK, # Please note that the actual code is *not* freely available.
[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
# serial 1 # serial 1
AC_DEFUN(AM_MAINTAINER_MODE, dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
dnl maintainer-mode is disabled by default AC_DEFUN(AM_PATH_PROG_WITH_TEST,
AC_ARG_ENABLE(maintainer-mode, [# Extract the first word of "$2", so it can be a program name with args.
[ --enable-maintainer-mode enable make rules and dependencies not useful set dummy $2; ac_word=[$]2
(and sometimes confusing) to the casual installer], AC_MSG_CHECKING([for $ac_word])
USE_MAINTAINER_MODE=$enableval, AC_CACHE_VAL(ac_cv_path_$1,
USE_MAINTAINER_MODE=no) [case "[$]$1" in
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.
/*) /*)
test -z "$LD" && LD="$ac_prog" ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;; ;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*) *)
# 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}:" 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=. test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog"; then if test -f $ac_dir/$ac_word; then
ac_cv_path_LD="$ac_dir/$ac_prog" if [$3]; then
# Check to see if the program is GNU ld. I'd rather use --version, ac_cv_path_$1="$ac_dir/$ac_word"
# but apparently some GNU ld's only accept -v. break
# 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
fi fi
fi fi
done done
IFS="$ac_save_ifs" IFS="$ac_save_ifs"
else dnl If no 4th arg is given, leave the cache variable unset,
ac_cv_path_LD="$LD" # Let the user override the test with a path. dnl so AC_PATH_PROGS will keep looking.
fi]) ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
LD="$ac_cv_path_LD" ])dnl
if test -n "$LD"; then ;;
AC_MSG_RESULT($LD) esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
fi fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_SUBST($1)dnl
AC_SUBST(LD)
AM_PROG_LD_GNU
]) ])
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, # lcmessage.m4 from gettext 0.32
[AC_MSG_CHECKING([for BSD-compatible nm]) ######################################################################
AC_CACHE_VAL(ac_cv_path_NM, # Check whether LC_MESSAGES is available in <locale.h>.
[case "$NM" in # Ulrich Drepper <drepper@cygnus.com>, 1995.
/*) #
ac_cv_path_NM="$NM" # Let the user override the test with a path. # 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.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" # Please note that the actual code is *not* freely available.
for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
test -z "$ac_dir" && dir=. # serial 1
if test -f $ac_dir/nm; then
# Check to see if the nm accepts a BSD-compat flag. AC_DEFUN(AM_LC_MESSAGES,
# Adding the `sed 1!d' prevents false positives on HP-UX, which says: [if test $ac_cv_header_locale_h = yes; then
# nm: unknown option "B" ignored AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
ac_cv_path_NM="$ac_dir/nm -B" am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then if test $am_cv_val_LC_MESSAGES = yes; then
ac_cv_path_NM="$ac_dir/nm -p" AC_DEFINE(HAVE_LC_MESSAGES)
else
ac_cv_path_NM="$ac_dir/nm"
fi
break
fi fi
done fi])
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)
])
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. # Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995. # 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/" \ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES < $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])

View File

@@ -24,17 +24,28 @@ AC_CHECK_TOOL(NM,nm)
NM=`which $NM` NM=`which $NM`
export CC CXX RANLIB LD AS AR NM export CC CXX RANLIB LD AS AR NM
dnl If you want to use libgtop without gnome, comment the following line out.
GNOME_INIT
AC_LC_SYSDEPS AC_LC_SYSDEPS
GNOME_CHECK_GUILE if test x$libgtop_want_guile = xyes ; then
GNOME_CHECK_GUILE
if test x$ac_cv_guile_found = xyes ; then if test x$ac_cv_guile_found = xyes ; then
guile_examples='third third_static third_linux' if test x$libgtop_want_names = xyes ; then
guile_subdirs='guile' AC_DEFINE(GLIBTOP_GUILE_NAMES)
fi
guile_examples='third third_static third_linux'
guile_subdirs='guile'
else
guile_examples=
guile_subdirs=
fi
else else
guile_examples= guile_examples=
guile_subdirs= guile_subdirs=
fi fi
AC_SUBST(guile_examples) AC_SUBST(guile_examples)
AC_SUBST(guile_subdirs) AC_SUBST(guile_subdirs)
@@ -52,7 +63,8 @@ AC_PROG_MAKE_SET
export cross_compiling export cross_compiling
AM_PROG_LIBTOOL AM_PROG_LIBTOOL
GNOME_SUPPORT_CHECKS 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. dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
@@ -85,48 +97,102 @@ AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
ALL_LINGUAS="" ALL_LINGUAS=""
AM_GNU_GETTEXT AM_GNU_GETTEXT
CFLAGS="$CFLAGS -D_IN_LIBGTOP"
AC_SUBST(CFLAGS) AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS) AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS)
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(GNOME_ENABLE_DEBUG),) AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(GNOME_ENABLE_DEBUG),)
LIBSUPPORT= dnl If you want to use libgtop without gnome, uncomment the following paragraph:
SUPPORTINCS= dnl LIBSUPPORT=
if test "$need_libgtop_support" = yes; then dnl SUPPORTINCS=
LIBSUPPORT='$(top_builddir)/support/libgtopsupport.la' dnl if test "$need_gnome_support" = yes; then
SUPPORTINCS='-I$(top_srcdir)/support' 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 fi
AC_SUBST(LIBSUPPORT)
AC_SUBST(SUPPORTINCS)
dnl These definitions are expanded in make. dnl These definitions are expanded in make.
GTOP_LIBS='-L$(libdir) -lgtop_common -lgtop ' LIBGTOP_LIBS='-L$(libdir)'
GTOP_INCS='-I$(includedir) -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/include' LIBGTOP_INCS='-I$(includedir)'
GTOP_BINDIR='$(bindir)' LIBGTOP_GUILE_LIBS="$LIBGTOP_LIBS"
GTOP_SERVER='$(bindir)/gtop_server' 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 if test x$ac_cv_guile_found = xyes ; then
GTOP_INCS="$GTOP_INCS -I\$(top_srcdir)/sysdeps/\$(sysdeps_dir)" 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"
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_common"
if test "x$need_server" = "xyes" ; then
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop"
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop"
else
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_sysdeps"
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_sysdeps"
fi fi
if test "x$ac_cv_guile_found" = "xyes" ; then if test "x$ac_cv_guile_found" = "xyes" ; then
GTOP_INCS="$GTOP_INCS $GUILE_INCS" LIBGTOP_INCS="$LIBGTOP_INCS $GUILE_INCS"
GTOP_LIBS="$GTOP_LIBS $GUILE_LIBS" LIBGTOP_GUILE_INCS="$LIBGTOP_INCS $GUILE_INCS"
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS $GUILE_LIBS"
fi fi
AC_SUBST(GTOP_LIBS) if test "x$libgtop_use_machine_h" = "xyes" ; then
AC_SUBST(GTOP_INCS) machine_incs='-I$(top_srcdir)/sysdeps/@sysdeps_dir@'
AC_SUBST(GTOP_BINDIR) fi
AC_SUBST(GTOP_SERVER)
AC_SUBST(LIBSUPPORT) AC_SUBST(machine_incs)
AC_SUBST(SUPPORTINCS)
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)
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile
po/Makefile.in po/Makefile.in
intl/Makefile intl/Makefile
include/Makefile
include/glibtop/Makefile
sysdeps/Makefile sysdeps/Makefile
sysdeps/common/Makefile sysdeps/common/Makefile
sysdeps/names/Makefile sysdeps/names/Makefile
@@ -140,5 +206,4 @@ src/Makefile
src/server/Makefile src/server/Makefile
lib/Makefile lib/Makefile
examples/Makefile examples/Makefile
support/Makefile
macros/Makefile],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) macros/Makefile],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])

View File

@@ -1,15 +1,22 @@
*.shml *.shml
.timestamp .timestamp
.timestamp2
.timestamp3
dbtohtml-1.shtml dbtohtml-1.shtml
dbtohtml-2.shtml dbtohtml-2.shtml
dbtohtml-3.shtml dbtohtml-3.shtml
dbtohtml.shtml dbtohtml.shtml
gnome-hackers
gnome-hackers.ced
libgtop
libgtop-1.shtml libgtop-1.shtml
libgtop-2.shtml libgtop-2.shtml
libgtop-3.shtml libgtop-3.shtml
libgtop-4.shtml libgtop-4.shtml
libgtop-5.shtml libgtop-5.shtml
libgtop-INDEX.shtml libgtop-INDEX.shtml
libgtop-ref
libgtop-ref.ced
libgtop.ced libgtop.ced
libgtop.fot libgtop.fot
libgtop.shtml libgtop.shtml

View File

@@ -1,6 +1,22 @@
all: .timestamp all: .timestamp .timestamp2 .timestamp3
.timestamp: libgtop.sgml .timestamp: libgtop.sgml
rm -rf libgtop
mkdir libgtop
jade -D /usr/lib/sgml/jade_dsl -d libgtop.dsl -t sgml \ jade -D /usr/lib/sgml/jade_dsl -d libgtop.dsl -t sgml \
-V %no-make-index% libgtop.sgml > /dev/null -V %no-make-index% libgtop.sgml > /dev/null && \
touch .timestamp 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

File diff suppressed because it is too large Load Diff

12
doc/gnome-hackers.dsl Normal file
View 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
View 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
View 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
View 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>

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,9 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@
@@ -44,10 +46,14 @@ second_linux_LDADD = $(top_builddir)/sysdeps/common/libgtop_common.la \
@INTLLIBS@ @LIBSUPPORT@ @INTLLIBS@ @LIBSUPPORT@
second_linux_LDFLAGS = -static 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_SOURCES = third.c
third_LDADD = $(top_builddir)/sysdeps/guile/libgtop_guile.la \ third_LDADD = $(top_builddir)/sysdeps/guile/libgtop_guile.la \
$(top_builddir)/sysdeps/guile/names/libgtop_guile_names.la \ $(third_guile_names_LIBS) $(third_names_LIBS) \
$(top_builddir)/sysdeps/names/libgtop_names.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \ $(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/lib/libgtop.la \ $(top_builddir)/lib/libgtop.la \
@GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@ @GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@
@@ -58,8 +64,7 @@ third_static_LDFLAGS = -static
third_linux_SOURCES = $(third_SOURCES) third_linux_SOURCES = $(third_SOURCES)
third_linux_LDADD = $(top_builddir)/sysdeps/guile/libgtop_guile.la \ third_linux_LDADD = $(top_builddir)/sysdeps/guile/libgtop_guile.la \
$(top_builddir)/sysdeps/guile/names/libgtop_guile_names.la \ $(third_guile_names_LIBS) $(third_names_LIBS) \
$(top_builddir)/sysdeps/names/libgtop_names.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \ $(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \ $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@ @GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@

View File

@@ -19,6 +19,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <locale.h>
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/open.h> #include <glibtop/open.h>
#include <glibtop/close.h> #include <glibtop/close.h>
@@ -49,10 +51,10 @@ main (int argc, char *argv [])
glibtop_get_mem (&data.mem); glibtop_get_mem (&data.mem);
fprintf (stderr, "Memory (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu, %lu\n", fprintf (stderr, "Memory (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
data.mem.flags, data.mem.total, data.mem.used, data.mem.free, data.mem.flags, data.mem.total, data.mem.used, data.mem.free,
data.mem.shared, data.mem.buffer, data.mem.cached, data.mem.shared, data.mem.buffer, data.mem.cached,
data.mem.user); data.mem.user, data.mem.locked);
glibtop_get_swap (&data.swap); glibtop_get_swap (&data.swap);

View File

@@ -19,6 +19,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <locale.h>
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/open.h> #include <glibtop/open.h>
#include <glibtop/close.h> #include <glibtop/close.h>

View File

@@ -19,6 +19,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <locale.h>
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/open.h> #include <glibtop/open.h>
@@ -45,7 +47,9 @@ void
main_prog (int argc, char *argv[]) main_prog (int argc, char *argv[])
{ {
glibtop_boot_guile (); glibtop_boot_guile ();
#ifdef GLIBTOP_GUILE_NAMES
glibtop_boot_guile_names (); glibtop_boot_guile_names ();
#endif
gh_repl (argc, argv); gh_repl (argc, argv);
} }

View File

@@ -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)

View File

@@ -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
View File

@@ -0,0 +1 @@
reference.sgml

311
guile/make-docbook.scm Normal file
View 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 &lt;glibtop.h&gt;\n"
"#include &lt;glibtop/" feature ".h&gt;"
"</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 &lt;glibtop.h>
;; #include &lt;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
View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

2
include/Makefile.am Normal file
View File

@@ -0,0 +1,2 @@
SUBDIRS = glibtop

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -0,0 +1,8 @@
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

View File

@@ -55,11 +55,13 @@
#include <guile/gh.h> #include <guile/gh.h>
#endif #endif
#ifdef _IN_LIBGTOP
#if (defined HAVE_LIBINTL_H) || (defined HAVE_GETTEXT) #if (defined HAVE_LIBINTL_H) || (defined HAVE_GETTEXT)
#include <libintl.h> #include <libintl.h>
#else #else
#include <libgettext.h> #include <libgettext.h>
#endif #endif
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -34,8 +34,9 @@ __BEGIN_DECLS
#define GLIBTOP_MEM_BUFFER 4 #define GLIBTOP_MEM_BUFFER 4
#define GLIBTOP_MEM_CACHED 5 #define GLIBTOP_MEM_CACHED 5
#define GLIBTOP_MEM_USER 6 #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; typedef struct _glibtop_mem glibtop_mem;
@@ -48,7 +49,8 @@ struct _glibtop_mem
shared, /* GLIBTOP_MEM_SHARED */ shared, /* GLIBTOP_MEM_SHARED */
buffer, /* GLIBTOP_MEM_BUFFER */ buffer, /* GLIBTOP_MEM_BUFFER */
cached, /* GLIBTOP_MEM_CACHED */ 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__r(glibtop_global_server, mem)

View File

@@ -1,8 +1,10 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@"\"
lib_LTLIBRARIES = libgtop.la lib_LTLIBRARIES = libgtop.la

89
libgtop.spec Normal file
View File

@@ -0,0 +1,89 @@
# Note that this is NOT a relocatable package
%define ver 0.01
%define rel SNAP
%define prefix /usr
Summary: GNOME Top Library
Name: libgtop
Version: %ver
Release: %rel
Copyright: LGPL
Group: X11/gnome
Source: ftp://ftp.gnome.org/pub/libgtop-%{ver}.tar.gz
BuildRoot: /tmp/libgtop-root
Obsoletes: gnome
Packager: Marc Ewing <marc@redhat.com>
URL: http://www.gnome.org/
Docdir: %{prefix}/doc
%description
Library that fetches information about the running system such as cpu
and memory usage, active processes etc. On Linux systems, these information
are taken directly from the /proc filesystem. For other systems such as
Solaris, where such programs need to be suid root (or only setgid kmem/mem
on some systems), it provides a suid/setgid server that fetches those
information and a client-side library that talks to this server.
Main idea was to have the same interface for all operating systems,
thus all system dependent details are hidden in the implementation
of that server.
%package devel
Summary: Libraries, includes, etc to use libgtop in GNOME applications
Group: X11/gnome
Requires: libgtop
Obsoletes: gnome
%description devel
Libraries, include files, etc you need to use libgtop in GNOME applications.
%prep
%setup
%build
# Needed for snapshot releases.
if [ ! -f configure ]; then
CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix
else
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix
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
%clean
rm -rf $RPM_BUILD_ROOT
%post
if ! grep %{prefix}/lib /etc/ld.so.conf > /dev/null ; then
echo "%{prefix}/lib" >> /etc/ld.so.conf
fi
/sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README
%{prefix}/lib/lib*.so.*
%{prefix}/bin/*
%files devel
%defattr(-, root, root)
%{prefix}/lib/lib*.so
%{prefix}/lib/*a
%{prefix}/lib/*.sh
%{prefix}/lib/libgtop
%{prefix}/include/*

25
libgtopConf.sh.in Normal file
View 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@"

4
po/ChangeLog Normal file
View File

@@ -0,0 +1,4 @@
1998-05-21 Martin Baulig <martin@home-of-linux.org>
* ChangeLog: new file - currently empty

247
po/Makefile.in.in Normal file
View 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:

View File

@@ -6,7 +6,6 @@ lib/open.c
lib/read.c lib/read.c
lib/swap.c lib/swap.c
lib/write.c lib/write.c
lib/sysdeps.c
lib/uptime.c lib/uptime.c
lib/loadavg.c lib/loadavg.c
lib/shm_limits.c lib/shm_limits.c

View File

@@ -1,6 +1,8 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@

View File

@@ -26,6 +26,7 @@
#include <glibtop/open.h> #include <glibtop/open.h>
#include <fcntl.h> #include <fcntl.h>
#include <locale.h>
#if defined(HAVE_GETDTABLESIZE) #if defined(HAVE_GETDTABLESIZE)
#define GET_MAX_FDS() getdtablesize() #define GET_MAX_FDS() getdtablesize()
@@ -71,7 +72,7 @@ int main(int argc, char *argv[])
/* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */
setreuid (uid, euid); setreuid (gid, egid); setreuid (uid, euid); setregid (gid, egid);
glibtop_open (&server, argv [0]); glibtop_open (&server, argv [0]);

View File

@@ -4,4 +4,12 @@ else
guile_SUBDIRS = guile_SUBDIRS =
endif endif
SUBDIRS = @sysdeps_dir@ common names $(guile_SUBDIRS) if GLIBTOP_NAMES
names_SUBDIRS = names
else
names_SUBDIRS =
endif
SUBDIRS = @sysdeps_dir@ common $(names_SUBDIRS) $(guile_SUBDIRS)
DIST_SUBDIRS = common guile linux names osf1 stub sun4

View File

@@ -1,6 +1,8 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@

View File

@@ -1,8 +1,14 @@
if GLIBTOP_NAMES
SUBDIRS = names SUBDIRS = names
endif
DIST_SUBDIRS = names
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@

View File

@@ -38,5 +38,6 @@ SCM glibtop_guile_get_mem (void)
gh_ulong2scm (mem.buffer), gh_ulong2scm (mem.buffer),
gh_ulong2scm (mem.cached), gh_ulong2scm (mem.cached),
gh_ulong2scm (mem.user), gh_ulong2scm (mem.user),
gh_ulong2scm (mem.locked),
SCM_UNDEFINED); SCM_UNDEFINED);
} }

View File

@@ -1,11 +1,11 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@
DEFS = -DGLIBTOP_GUILE_NAMES @DEFS@
lib_LTLIBRARIES = libgtop_guile_names.la lib_LTLIBRARIES = libgtop_guile_names.la
libgtop_guile_names_la_SOURCES = boot.c sysdeps.c cpu.c mem.c swap.c uptime.c \ libgtop_guile_names_la_SOURCES = boot.c sysdeps.c cpu.c mem.c swap.c uptime.c \

View File

@@ -90,6 +90,8 @@ glibtop_boot_guile_names (void)
("glibtop-types-proc_uid", glibtop_guile_types_proc_uid); ("glibtop-types-proc_uid", glibtop_guile_types_proc_uid);
gh_new_procedure0_0 gh_new_procedure0_0
("glibtop-types-proc_mem", glibtop_guile_types_proc_mem); ("glibtop-types-proc_mem", glibtop_guile_types_proc_mem);
gh_new_procedure0_0
("glibtop-types-proc_time", glibtop_guile_types_proc_time);
gh_new_procedure0_0 gh_new_procedure0_0
("glibtop-types-proc_signal", glibtop_guile_types_proc_signal); ("glibtop-types-proc_signal", glibtop_guile_types_proc_signal);
gh_new_procedure0_0 gh_new_procedure0_0
@@ -125,6 +127,8 @@ glibtop_boot_guile_names (void)
("glibtop-labels-proc_uid", glibtop_guile_labels_proc_uid); ("glibtop-labels-proc_uid", glibtop_guile_labels_proc_uid);
gh_new_procedure0_0 gh_new_procedure0_0
("glibtop-labels-proc_mem", glibtop_guile_labels_proc_mem); ("glibtop-labels-proc_mem", glibtop_guile_labels_proc_mem);
gh_new_procedure0_0
("glibtop-labels-proc_time", glibtop_guile_labels_proc_time);
gh_new_procedure0_0 gh_new_procedure0_0
("glibtop-labels-proc_signal", glibtop_guile_labels_proc_signal); ("glibtop-labels-proc_signal", glibtop_guile_labels_proc_signal);
gh_new_procedure0_0 gh_new_procedure0_0
@@ -159,6 +163,8 @@ glibtop_boot_guile_names (void)
("glibtop-descriptions-proc_uid", glibtop_guile_descriptions_proc_uid); ("glibtop-descriptions-proc_uid", glibtop_guile_descriptions_proc_uid);
gh_new_procedure0_0 gh_new_procedure0_0
("glibtop-descriptions-proc_mem", glibtop_guile_descriptions_proc_mem); ("glibtop-descriptions-proc_mem", glibtop_guile_descriptions_proc_mem);
gh_new_procedure0_0
("glibtop-descriptions-proc_time", glibtop_guile_descriptions_proc_time);
gh_new_procedure0_0 gh_new_procedure0_0
("glibtop-descriptions-proc_signal", glibtop_guile_descriptions_proc_signal); ("glibtop-descriptions-proc_signal", glibtop_guile_descriptions_proc_signal);
gh_new_procedure0_0 gh_new_procedure0_0

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_cpu (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_CPU; i++) for (i = 0; i < GLIBTOP_MAX_CPU; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_cpu [i]), gh_list (gh_str02scm (glibtop_names_cpu [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_cpu (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_CPU; i++) for (i = 0; i < GLIBTOP_MAX_CPU; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_cpu [i]), gh_list (gh_str02scm (glibtop_types_cpu [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_cpu (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_CPU; i++) for (i = 0; i < GLIBTOP_MAX_CPU; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_cpu [i])), (glibtop_labels_cpu [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_cpu (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_CPU; i++) for (i = 0; i < GLIBTOP_MAX_CPU; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_cpu [i])), (glibtop_descriptions_cpu [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_loadavg (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_LOADAVG; i++) for (i = 0; i < GLIBTOP_MAX_LOADAVG; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_loadavg [i]), gh_list (gh_str02scm (glibtop_names_loadavg [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_loadavg (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_LOADAVG; i++) for (i = 0; i < GLIBTOP_MAX_LOADAVG; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_loadavg [i]), gh_list (gh_str02scm (glibtop_types_loadavg [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_loadavg (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_LOADAVG; i++) for (i = 0; i < GLIBTOP_MAX_LOADAVG; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_loadavg [i])), (glibtop_labels_loadavg [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_loadavg (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_LOADAVG; i++) for (i = 0; i < GLIBTOP_MAX_LOADAVG; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_loadavg [i])), (glibtop_descriptions_loadavg [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_mem (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_MEM; i++) for (i = 0; i < GLIBTOP_MAX_MEM; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_mem [i]), gh_list (gh_str02scm (glibtop_names_mem [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_mem (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_MEM; i++) for (i = 0; i < GLIBTOP_MAX_MEM; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_mem [i]), gh_list (gh_str02scm (glibtop_types_mem [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_mem (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_MEM; i++) for (i = 0; i < GLIBTOP_MAX_MEM; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_mem [i])), (glibtop_labels_mem [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_mem (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_MEM; i++) for (i = 0; i < GLIBTOP_MAX_MEM; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_mem [i])), (glibtop_descriptions_mem [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_msg_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_MSG_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_MSG_LIMITS; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_msg_limits [i]), gh_list (gh_str02scm (glibtop_names_msg_limits [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_msg_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_MSG_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_MSG_LIMITS; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_msg_limits [i]), gh_list (gh_str02scm (glibtop_types_msg_limits [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_msg_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_MSG_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_MSG_LIMITS; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_msg_limits [i])), (glibtop_labels_msg_limits [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_msg_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_MSG_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_MSG_LIMITS; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_msg_limits [i])), (glibtop_descriptions_msg_limits [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_proc_kernel (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_KERNEL; i++) for (i = 0; i < GLIBTOP_MAX_PROC_KERNEL; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_proc_kernel [i]), gh_list (gh_str02scm (glibtop_names_proc_kernel [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_proc_kernel (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_KERNEL; i++) for (i = 0; i < GLIBTOP_MAX_PROC_KERNEL; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_proc_kernel [i]), gh_list (gh_str02scm (glibtop_types_proc_kernel [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_proc_kernel (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_KERNEL; i++) for (i = 0; i < GLIBTOP_MAX_PROC_KERNEL; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_proc_kernel [i])), (glibtop_labels_proc_kernel [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_proc_kernel (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_KERNEL; i++) for (i = 0; i < GLIBTOP_MAX_PROC_KERNEL; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_proc_kernel [i])), (glibtop_descriptions_proc_kernel [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -34,10 +34,10 @@ glibtop_guile_names_proclist (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROCLIST; i++) for (i = 0; i < GLIBTOP_MAX_PROCLIST; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_proclist [i]), gh_list (gh_str02scm (glibtop_names_proclist [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -51,11 +51,11 @@ glibtop_guile_types_proclist (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROCLIST; i++) for (i = 0; i < GLIBTOP_MAX_PROCLIST; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_labels_proclist [i]), gh_list (gh_str02scm (glibtop_types_proclist [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -68,11 +68,11 @@ glibtop_guile_labels_proclist (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROCLIST; i++) for (i = 0; i < GLIBTOP_MAX_PROCLIST; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_proclist [i])), (glibtop_labels_proclist [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -86,11 +86,11 @@ glibtop_guile_descriptions_proclist (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROCLIST; i++) for (i = 0; i < GLIBTOP_MAX_PROCLIST; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_proclist [i])), (glibtop_descriptions_proclist [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_proc_mem (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_MEM; i++) for (i = 0; i < GLIBTOP_MAX_PROC_MEM; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_proc_mem [i]), gh_list (gh_str02scm (glibtop_names_proc_mem [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_proc_mem (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_MEM; i++) for (i = 0; i < GLIBTOP_MAX_PROC_MEM; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_labels_proc_mem [i]), gh_list (gh_str02scm (glibtop_types_proc_mem [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_proc_mem (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_MEM; i++) for (i = 0; i < GLIBTOP_MAX_PROC_MEM; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_proc_mem [i])), (glibtop_labels_proc_mem [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_proc_mem (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_MEM; i++) for (i = 0; i < GLIBTOP_MAX_PROC_MEM; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_proc_mem [i])), (glibtop_descriptions_proc_mem [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_proc_segment (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_SEGMENT; i++) for (i = 0; i < GLIBTOP_MAX_PROC_SEGMENT; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_proc_segment [i]), gh_list (gh_str02scm (glibtop_names_proc_segment [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_proc_segment (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_SEGMENT; i++) for (i = 0; i < GLIBTOP_MAX_PROC_SEGMENT; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_proc_segment [i]), gh_list (gh_str02scm (glibtop_types_proc_segment [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_proc_segment (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_SEGMENT; i++) for (i = 0; i < GLIBTOP_MAX_PROC_SEGMENT; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_proc_segment [i])), (glibtop_labels_proc_segment [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_proc_segment (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_SEGMENT; i++) for (i = 0; i < GLIBTOP_MAX_PROC_SEGMENT; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_proc_segment [i])), (glibtop_descriptions_proc_segment [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_proc_signal (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_SIGNAL; i++) for (i = 0; i < GLIBTOP_MAX_PROC_SIGNAL; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_proc_signal [i]), gh_list (gh_str02scm (glibtop_names_proc_signal [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_proc_signal (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_SIGNAL; i++) for (i = 0; i < GLIBTOP_MAX_PROC_SIGNAL; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_proc_signal [i]), gh_list (gh_str02scm (glibtop_types_proc_signal [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_proc_signal (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_SIGNAL; i++) for (i = 0; i < GLIBTOP_MAX_PROC_SIGNAL; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_proc_signal [i])), (glibtop_labels_proc_signal [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_proc_signal (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_SIGNAL; i++) for (i = 0; i < GLIBTOP_MAX_PROC_SIGNAL; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_proc_signal [i])), (glibtop_descriptions_proc_signal [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_proc_state (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_STATE; i++) for (i = 0; i < GLIBTOP_MAX_PROC_STATE; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_proc_state [i]), gh_list (gh_str02scm (glibtop_names_proc_state [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_proc_state (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_STATE; i++) for (i = 0; i < GLIBTOP_MAX_PROC_STATE; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_proc_state [i]), gh_list (gh_str02scm (glibtop_types_proc_state [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_proc_state (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_STATE; i++) for (i = 0; i < GLIBTOP_MAX_PROC_STATE; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_proc_state [i])), (glibtop_labels_proc_state [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_proc_state (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_STATE; i++) for (i = 0; i < GLIBTOP_MAX_PROC_STATE; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_proc_state [i])), (glibtop_descriptions_proc_state [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_proc_time (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_TIME; i++) for (i = 0; i < GLIBTOP_MAX_PROC_TIME; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_proc_time [i]), gh_list (gh_str02scm (glibtop_names_proc_time [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_proc_time (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_TIME; i++) for (i = 0; i < GLIBTOP_MAX_PROC_TIME; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_proc_time [i]), gh_list (gh_str02scm (glibtop_types_proc_time [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_proc_time (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_TIME; i++) for (i = 0; i < GLIBTOP_MAX_PROC_TIME; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_proc_time [i])), (glibtop_labels_proc_time [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_proc_time (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_TIME; i++) for (i = 0; i < GLIBTOP_MAX_PROC_TIME; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_proc_time [i])), (glibtop_descriptions_proc_time [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,10 +33,10 @@ glibtop_guile_names_proc_uid (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_UID; i++) for (i = 0; i < GLIBTOP_MAX_PROC_UID; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_names_proc_uid [i]), gh_list (gh_str02scm (glibtop_names_proc_uid [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -50,10 +50,10 @@ glibtop_guile_types_proc_uid (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_UID; i++) for (i = 0; i < GLIBTOP_MAX_PROC_UID; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (glibtop_types_proc_uid [i]), gh_list (gh_str02scm (glibtop_types_proc_uid [i])),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -67,11 +67,11 @@ glibtop_guile_labels_proc_uid (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_UID; i++) for (i = 0; i < GLIBTOP_MAX_PROC_UID; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_labels_proc_uid [i])), (glibtop_labels_proc_uid [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }
@@ -85,11 +85,11 @@ glibtop_guile_descriptions_proc_uid (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_PROC_UID; i++) for (i = 0; i < GLIBTOP_MAX_PROC_UID; i++)
list = gh_append2 list = gh_append
(list, gh_list (gh_list (list,
(gh_str02scm (gettext gh_list (gh_str02scm (gettext
(glibtop_descriptions_proc_uid [i])), (glibtop_descriptions_proc_uid [i]))),
SCM_UNDEFINED)); SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,8 +33,9 @@ glibtop_guile_names_sem_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SEM_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_SEM_LIMITS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (glibtop_names_sem_limits [i]), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (glibtop_names_sem_limits [i])),
SCM_UNDEFINED));
return list; return list;
} }
@@ -48,8 +49,9 @@ glibtop_guile_types_sem_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SEM_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_SEM_LIMITS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_types_sem_limits [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_types_sem_limits [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -63,8 +65,9 @@ glibtop_guile_labels_sem_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SEM_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_SEM_LIMITS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_labels_sem_limits [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_labels_sem_limits [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -78,8 +81,9 @@ glibtop_guile_descriptions_sem_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SEM_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_SEM_LIMITS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_descriptions_sem_limits [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_descriptions_sem_limits [i]))),
SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,8 +33,9 @@ glibtop_guile_names_shm_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SHM_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_SHM_LIMITS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (glibtop_names_shm_limits [i]), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (glibtop_names_shm_limits [i])),
SCM_UNDEFINED));
return list; return list;
} }
@@ -48,8 +49,9 @@ glibtop_guile_types_shm_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SHM_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_SHM_LIMITS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_types_shm_limits [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_types_shm_limits [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -63,8 +65,9 @@ glibtop_guile_labels_shm_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SHM_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_SHM_LIMITS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_labels_shm_limits [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_labels_shm_limits [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -78,8 +81,9 @@ glibtop_guile_descriptions_shm_limits (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SHM_LIMITS; i++) for (i = 0; i < GLIBTOP_MAX_SHM_LIMITS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_descriptions_shm_limits [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_descriptions_shm_limits [i]))),
SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,7 +33,9 @@ glibtop_guile_names_swap (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SWAP; i++) for (i = 0; i < GLIBTOP_MAX_SWAP; i++)
list = gh_append2 (list, gh_list (gh_str02scm (glibtop_names_swap [i]), SCM_UNDEFINED)); list = gh_append (gh_list (list,
gh_list (gh_str02scm (glibtop_names_swap [i])),
SCM_UNDEFINED));
return list; return list;
} }
@@ -47,8 +49,9 @@ glibtop_guile_types_swap (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SWAP; i++) for (i = 0; i < GLIBTOP_MAX_SWAP; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_types_swap [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_types_swap [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -62,8 +65,9 @@ glibtop_guile_labels_swap (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SWAP; i++) for (i = 0; i < GLIBTOP_MAX_SWAP; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_labels_swap [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_labels_swap [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -77,8 +81,9 @@ glibtop_guile_descriptions_swap (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SWAP; i++) for (i = 0; i < GLIBTOP_MAX_SWAP; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_descriptions_swap [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_descriptions_swap [i]))),
SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,9 +33,10 @@ glibtop_guile_names_sysdeps (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SYSDEPS; i++) for (i = 0; i < GLIBTOP_MAX_SYSDEPS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (glibtop_names_sysdeps [i]), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (glibtop_names_sysdeps [i])),
SCM_UNDEFINED));
return list; return list;
} }
@@ -48,8 +49,9 @@ glibtop_guile_types_sysdeps (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SYSDEPS; i++) for (i = 0; i < GLIBTOP_MAX_SYSDEPS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_types_sysdeps [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_types_sysdeps [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -63,8 +65,9 @@ glibtop_guile_labels_sysdeps (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SYSDEPS; i++) for (i = 0; i < GLIBTOP_MAX_SYSDEPS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_labels_sysdeps [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_labels_sysdeps [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -78,8 +81,9 @@ glibtop_guile_descriptions_sysdeps (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_SYSDEPS; i++) for (i = 0; i < GLIBTOP_MAX_SYSDEPS; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_descriptions_sysdeps [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_descriptions_sysdeps [i]))),
SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -33,7 +33,9 @@ glibtop_guile_names_uptime (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_UPTIME; i++) for (i = 0; i < GLIBTOP_MAX_UPTIME; i++)
list = gh_append2 (list, gh_list (gh_str02scm (glibtop_names_uptime [i]), SCM_UNDEFINED)); list = gh_append (gh_list (list,
gh_list (gh_str02scm (glibtop_names_uptime [i])),
SCM_UNDEFINED));
return list; return list;
} }
@@ -47,8 +49,9 @@ glibtop_guile_types_uptime (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_UPTIME; i++) for (i = 0; i < GLIBTOP_MAX_UPTIME; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_types_uptime [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_types_uptime [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -62,8 +65,9 @@ glibtop_guile_labels_uptime (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_UPTIME; i++) for (i = 0; i < GLIBTOP_MAX_UPTIME; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_labels_uptime [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_labels_uptime [i]))),
SCM_UNDEFINED));
return list; return list;
} }
@@ -77,8 +81,9 @@ glibtop_guile_descriptions_uptime (void)
list = gh_list (SCM_UNDEFINED); list = gh_list (SCM_UNDEFINED);
for (i = 0; i < GLIBTOP_MAX_UPTIME; i++) for (i = 0; i < GLIBTOP_MAX_UPTIME; i++)
list = gh_append2 (list, gh_list (gh_str02scm (gettext (glibtop_descriptions_uptime [i])), list = gh_append (gh_list (list,
SCM_UNDEFINED)); gh_list (gh_str02scm (gettext (glibtop_descriptions_uptime [i]))),
SCM_UNDEFINED));
return list; return list;
} }

View File

@@ -43,7 +43,10 @@ glibtop_guile_get_proclist (void)
if (ptr) { if (ptr) {
for (i = 0; i < proclist.number; i++) for (i = 0; i < proclist.number; i++)
list = gh_append2 (list, gh_list (gh_ulong2scm ((unsigned long) ptr [i]), SCM_UNDEFINED)); list = gh_append
(gh_list (list,
gh_list (gh_ulong2scm ((unsigned long) ptr [i])),
SCM_UNDEFINED));
} }
glibtop_free (ptr); glibtop_free (ptr);

View File

@@ -1,6 +1,8 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@

View File

@@ -1,11 +1,11 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@
DEFS = -DGLIBTOP_NAMES @DEFS@
lib_LTLIBRARIES = libgtop_names.la lib_LTLIBRARIES = libgtop_names.la
libgtop_names_la_SOURCES = cpu.c mem.c swap.c uptime.c loadavg.c \ libgtop_names_la_SOURCES = cpu.c mem.c swap.c uptime.c loadavg.c \

View File

@@ -24,14 +24,14 @@
const char *glibtop_names_mem [GLIBTOP_MAX_MEM] = const char *glibtop_names_mem [GLIBTOP_MAX_MEM] =
{ {
"total", "used", "free", "shared", "buffer", "total", "used", "free", "shared", "buffer",
"cached", "user" "cached", "user", "locked"
}; };
const char *glibtop_types_mem [GLIBTOP_MAX_MEM] = const char *glibtop_types_mem [GLIBTOP_MAX_MEM] =
{ {
"unsigned long", "unsigned long", "unsigned long", "unsigned long", "unsigned long", "unsigned long",
"unsigned long", "unsigned long", "unsigned long", "unsigned long", "unsigned long", "unsigned long",
"unsigned long" "unsigned long", "unsigned long"
}; };
const char *glibtop_labels_mem [GLIBTOP_MAX_MEM] = const char *glibtop_labels_mem [GLIBTOP_MAX_MEM] =
@@ -42,7 +42,8 @@ const char *glibtop_labels_mem [GLIBTOP_MAX_MEM] =
N_("Shared Memory"), N_("Shared Memory"),
N_("Buffers"), N_("Buffers"),
N_("Cached"), N_("Cached"),
N_("User") N_("User"),
N_("Locked"),
}; };
const char *glibtop_descriptions_mem [GLIBTOP_MAX_MEM] = const char *glibtop_descriptions_mem [GLIBTOP_MAX_MEM] =
@@ -53,5 +54,6 @@ const char *glibtop_descriptions_mem [GLIBTOP_MAX_MEM] =
N_("Shared memory size in kB"), N_("Shared memory size in kB"),
N_("Size of buffers kB"), N_("Size of buffers kB"),
N_("Size of cached memory in kB"), N_("Size of cached memory in kB"),
N_("Memory used from user processes in kB") N_("Memory used from user processes in kB"),
N_("Memory in locked pages in kB")
}; };

View File

@@ -6,7 +6,6 @@ close.lo
cpu.lo cpu.lo
libgtop_sysdeps.la libgtop_sysdeps.la
libsysdeps.la libsysdeps.la
loadavg.c
loadavg.lo loadavg.lo
mem.lo mem.lo
msg_limits.lo msg_limits.lo
@@ -16,6 +15,5 @@ sem_limits.lo
shm_limits.lo shm_limits.lo
swap.lo swap.lo
sysdeps.lo sysdeps.lo
uptime.c
uptime.lo uptime.lo
so_locations so_locations

View File

@@ -1,12 +1,13 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@
lib_LTLIBRARIES = libgtop_sysdeps.la lib_LTLIBRARIES = libgtop_sysdeps.la
libgtop_sysdeps_la_SOURCES = init.c open.c close.c cpu.c mem.c swap.c \ libgtop_sysdeps_la_SOURCES = init.c open.c close.c cpu.c mem.c swap.c \
uptime.c loadavg.c shm_limits.c msg_limits.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \
sem_limits.c proclist.c procstate.c procuid.c \ sem_limits.c proclist.c procstate.c procuid.c \

63
sysdeps/osf1/loadavg.c Normal file
View File

@@ -0,0 +1,63 @@
/* $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 <config.h>
#include <glibtop/error.h>
#include <glibtop/loadavg.h>
static const unsigned long _glibtop_sysdeps_loadavg =
(1 << GLIBTOP_LOADAVG_LOADAVG);
/* Provides load averange. */
void
glibtop_get_loadavg__r (glibtop *server, glibtop_loadavg *buf)
{
struct tbl_loadavg loadavg;
int ret;
glibtop_init ();
memset (buf, 0, sizeof (glibtop_loadavg));
ret = table (TBL_LOADAVG, 0, (char *) &loadavg, 1,
sizeof (struct tbl_loadavg));
if (ret != 1) return;
buf->flags = _glibtop_sysdeps_loadavg;
if (loadavg.tl_lscale == 0) {
buf->loadavg [0] = loadavg.tl_avenrun.d [0];
buf->loadavg [1] = loadavg.tl_avenrun.d [1];
buf->loadavg [2] = loadavg.tl_avenrun.d [2];
} else {
buf->loadavg [0] =
(double) loadavg.tl_avenrun.l [0] /
(double) loadavg.tl_mach_factor [0];
buf->loadavg [1] =
(double) loadavg.tl_avenrun.l [1]
/ (double) loadavg.tl_mach_factor [1];
buf->loadavg [2] =
(double) loadavg.tl_avenrun.l [2] /
(double) loadavg.tl_mach_factor [2];
}
}

View File

@@ -22,11 +22,100 @@
#include <config.h> #include <config.h>
#include <glibtop/procuid.h> #include <glibtop/procuid.h>
#include <sys/table.h>
#include <sys/resource.h>
#include <mach.h>
#include <mach/mach_types.h>
#include <mach/task_info.h>
/* Provides detailed information about a process. */ /* Provides detailed information about a process. */
static const unsigned long _glibtop_sysdeps_proc_uid =
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) +
(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID) +
(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) +
(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) +
(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID);
void void
glibtop_get_proc_uid__r (glibtop *server, glibtop_proc_uid *buf, glibtop_get_proc_uid__r (glibtop *server, glibtop_proc_uid *buf,
pid_t pid) pid_t pid)
{ {
struct tbl_procinfo procinfo;
task_basic_info_data_t taskinfo;
int ret, info_count;
task_t thistask;
glibtop_init ();
memset (buf, 0, sizeof (glibtop_proc_uid)); memset (buf, 0, sizeof (glibtop_proc_uid));
/* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
setreuid (server->machine.uid, server->machine.euid);
ret = table (TBL_PROCINFO, pid, (char *) &procinfo, 1,
sizeof (struct tbl_procinfo));
if (setreuid (server->machine.euid, server->machine.uid))
_exit (1);
/* !!! END OF SUID ROOT PART !!! */
if (ret != 1) return;
buf->uid = procinfo.pi_ruid;
buf->euid = procinfo.pi_svuid;
buf->gid = procinfo.pi_rgid;
buf->egid = procinfo.pi_svgid;
buf->pid = procinfo.pi_pid;
buf->ppid = procinfo.pi_ppid;
buf->pgrp = procinfo.pi_pgrp;
buf->tty = procinfo.pi_ttyd;
buf->session = procinfo.pi_session;
buf->tpgid = procinfo.pi_tpgrp;
buf->flags = _glibtop_sysdeps_proc_uid;
/* !!! THE FOLLOWING CODE RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
setreuid (server->machine.uid, server->machine.euid);
/* Get task structure. */
ret = task_by_unix_pid (task_self(), procinfo.pi_pid, &thistask);
if (ret == KERN_SUCCESS) {
/* Get taskinfo about this task. */
info_count = TASK_BASIC_INFO_COUNT;
ret = task_info (thistask, TASK_BASIC_INFO,
(task_info_t) &taskinfo, &info_count);
}
if (setreuid (server->machine.euid, server->machine.uid))
_exit (1);
/* !!! END OF SUID ROOT PART !!! */
if (ret != KERN_SUCCESS) return;
buf->priority = taskinfo.base_priority;
buf->flags += (1 << GLIBTOP_PROC_UID_PRIORITY);
errno = 0;
ret = getpriority (PRIO_PROCESS, pid);
if ((ret == -1) && (errno != 0)) return;
buf->nice = ret;
buf->flags += (1 << GLIBTOP_PROC_UID_NICE);
} }

51
sysdeps/osf1/uptime.c Normal file
View File

@@ -0,0 +1,51 @@
/* $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/error.h>
#include <glibtop/uptime.h>
#include <time.h>
static unsigned long _glibtop_sysdeps_uptime =
(1 << GLIBTOP_UPTIME_UPTIME);
/* Provides uptime and idle time. */
void
glibtop_get_uptime__r (glibtop *server, glibtop_uptime *buf)
{
struct tbl_sysinfo sysinfo;
int ret;
glibtop_init ();
memset (buf, 0, sizeof (glibtop_uptime));
ret = table (TBL_SYSINFO, 0, (char *) &sysinfo, 1,
sizeof (struct tbl_sysinfo));
if (ret != 1) return;
buf->uptime = (double) (time (NULL) - sysinfo.si_boottime);
buf->flags = _glibtop_sysdeps_uptime;
}

View File

@@ -6,7 +6,6 @@ close.lo
cpu.lo cpu.lo
init.lo init.lo
libgtop_sysdeps.la libgtop_sysdeps.la
loadavg.c
loadavg.lo loadavg.lo
mem.lo mem.lo
msg_limits.lo msg_limits.lo
@@ -23,5 +22,4 @@ sem_limits.lo
shm_limits.lo shm_limits.lo
swap.lo swap.lo
sysdeps.lo sysdeps.lo
uptime.c
uptime.lo uptime.lo

View File

@@ -1,6 +1,8 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@

View File

@@ -19,14 +19,13 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <glibtop/sysdeps.h> #include <config.h>
#include <glibtop/command.h> #include <glibtop/loadavg.h>
/* Checks which features are implemented. */ /* Provides load averange. */
void void
glibtop_get_sysdeps__r (glibtop *server, glibtop_sysdeps *buf) glibtop_get_loadavg__r (glibtop *server, glibtop_loadavg *buf)
{ {
glibtop_init__r (&server); memset (buf, 0, sizeof (glibtop_loadavg));
glibtop_call__r (server, GLIBTOP_CMND_SYSDEPS, 0, NULL, sizeof (glibtop_sysdeps), buf);
} }

31
sysdeps/stub/uptime.c Normal file
View File

@@ -0,0 +1,31 @@
/* $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 <config.h>
#include <glibtop/uptime.h>
/* Provides uptime and idle time. */
void
glibtop_get_uptime__r (glibtop *server, glibtop_uptime *buf)
{
memset (buf, 0, sizeof (glibtop_uptime));
}

View File

@@ -5,7 +5,6 @@ Makefile.in
close.lo close.lo
cpu.lo cpu.lo
libgtop_sysdeps.la libgtop_sysdeps.la
loadavg.c
loadavg.lo loadavg.lo
mem.lo mem.lo
msg_limits.lo msg_limits.lo
@@ -15,5 +14,4 @@ sem_limits.lo
shm_limits.lo shm_limits.lo
swap.lo swap.lo
sysdeps.lo sysdeps.lo
uptime.c
uptime.lo uptime.lo

View File

@@ -1,6 +1,8 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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@

View File

@@ -22,10 +22,78 @@
#include <config.h> #include <config.h>
#include <glibtop/cpu.h> #include <glibtop/cpu.h>
static const unsigned long _glibtop_sysdeps_cpu =
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) +
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) +
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY);
/* Provides information about cpu usage. */ /* Provides information about cpu usage. */
void void
glibtop_get_cpu__r (glibtop *server, glibtop_cpu *buf) glibtop_get_cpu__r (glibtop *server, glibtop_cpu *buf)
{ {
long cp_time [CPUSTATES], mp_time [NCPU][CPUSTATES];
int i;
memset (buf, 0, sizeof (glibtop_cpu)); memset (buf, 0, sizeof (glibtop_cpu));
/* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */
setregid (server->machine.gid, server->machine.egid);
/* get the cp_time array */
(void) _glibtop_getkval (server, _glibtop_nlist [X_CP_TIME].n_value, (int *) cp_time,
sizeof (cp_time), _glibtop_nlist [X_CP_TIME].n_name);
#ifdef MULTIPROCESSOR
/* get the mp_time array as well */
if (server->machine.ncpu > 1) {
(void) _glibtop_getkval (server, _glibtop_nlist [X_MP_TIME].n_value, (int *) mp_time,
sizeof (mp_time), _glibtop_nlist [X_MP_TIME].n_name);
}
#endif
if (setregid (server->machine.egid, server->machine.gid))
_exit (1);
/* !!! END OF SUID ROOT PART !!! */
#ifdef MULTIPROCESSOR
/* If we have multiple processors, we add the times for each of them and set
frequency to 100 times the number of the processors. */
/* [FIXME]: I had no machine with more than one processor to test this code !!! */
if (server->machine.ncpu > 1) {
for (i = 0; i < server->machine.ncpu; i++) {
buf->user += mp_time [i][CP_USER];
buf->nice += mp_time [i][CP_NICE];
buf->sys += mp_time [i][CP_SYS];
buf->idle += mp_time [i][CP_IDLE];
buf->frequency += 100;
}
} else {
buf->user = cp_time [CP_USER];
buf->nice = cp_time [CP_NICE];
buf->sys = cp_time [CP_SYS];
buf->idle = cp_time [CP_IDLE];
buf->frequency = 100;
}
#else
buf->user = cp_time [CP_USER];
buf->nice = cp_time [CP_NICE];
buf->sys = cp_time [CP_SYS];
buf->idle = cp_time [CP_IDLE];
buf->frequency = 100;
#endif
/* Calculate total time. */
buf->total = buf->user + buf->nice + buf->sys + buf->idle;
/* Now we can set the flags. */
buf->flags = _glibtop_sysdeps_cpu;
} }

View File

@@ -0,0 +1,104 @@
/* $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_MACHINE_H__
#define __GLIBTOP_MACHINE_H__
/* make sure param.h gets loaded with KERNEL defined to get PZERO & NZERO */
#define KERNEL
#include <sys/param.h>
#undef KERNEL
#include <stdio.h>
#include <kvm.h>
#include <nlist.h>
#include <math.h>
#include <sys/dir.h>
#include <sys/user.h>
#include <sys/proc.h>
#include <sys/dk.h>
#include <sys/vm.h>
#include <sys/file.h>
#include <sys/time.h>
#include <vm/page.h>
#ifdef solbourne
#include <sys/syscall.h>
#endif
__BEGIN_DECLS
/* Older versions of SunOS don't have a typedef for pid_t.
Hopefully this will catch all those cases without causing other problems.
*/
#ifndef __sys_stdtypes_h
typedef int pid_t;
#endif
/* definitions for indices in the nlist array */
#define X_AVENRUN 0
#define X_CCPU 1
#define X_MPID 2
#define X_NPROC 3
#define X_PROC 4
#define X_TOTAL 5
#define X_CP_TIME 6
#define X_PAGES 7
#define X_EPAGES 8
#ifdef MULTIPROCESSOR
#define X_NCPU 9
#define X_MP_TIME 10
#endif
/* Log base 2 of 1024 is 10 (2^10 == 1024) */
#define LOG1024 10
typedef struct _glibtop_machine glibtop_machine;
struct _glibtop_machine
{
uid_t uid, euid; /* Real and effective user id */
gid_t gid, egid; /* Real and effective group id */
int nlist_count; /* Number of symbols in the nlist */
int ncpu; /* Number of CPUs we have */
unsigned long pages, epages;
struct page *physpage;
int bytesize, count;
int pageshift; /* log base 2 of the pagesize */
kvm_t *kd;
};
/* Those functions are used internally in libgtop */
#ifdef _IN_LIBGTOP
extern struct nlist _glibtop_nlist[];
extern int _glibtop_check_nlist __P((void *, register struct nlist *));
extern int _glibtop_getkval __P((void *, unsigned long, int *, int, char *));
#endif
__END_DECLS
#endif

31
sysdeps/sun4/loadavg.c Normal file
View File

@@ -0,0 +1,31 @@
/* $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 <config.h>
#include <glibtop/loadavg.h>
/* Provides load averange. */
void
glibtop_get_loadavg__r (glibtop *server, glibtop_loadavg *buf)
{
memset (buf, 0, sizeof (glibtop_loadavg));
}

View File

@@ -22,10 +22,65 @@
#include <config.h> #include <config.h>
#include <glibtop/mem.h> #include <glibtop/mem.h>
static const unsigned long _glibtop_sysdeps_mem =
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) +
(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_LOCKED);
/* define pagetok in terms of pageshift */
#define pagetok(size) ((size) << server->machine.pageshift)
/* Provides information about memory usage. */ /* Provides information about memory usage. */
void void
glibtop_get_mem__r (glibtop *server, glibtop_mem *buf) glibtop_get_mem__r (glibtop *server, glibtop_mem *buf)
{ {
memset (buf, 0, sizeof (glibtop_mem)); memset (buf, 0, sizeof (glibtop_mem));
/* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */
setregid (server->machine.gid, server->machine.egid);
/* get the array of physpage descriptors */
(void) _glibtop_getkval (server, server->machine.pages,
(int *) server->machine.physpage,
server->machine.bytesize,
"array _page");
if (setregid (server->machine.egid, server->machine.gid))
_exit (1);
/* !!! END OF SGID KMEM PART !!! */
{ /* sum memory statistics */
register struct page *pp;
register int cnt;
register int inuse;
register int free;
register int locked;
/* bop thru the array counting page types */
pp = server->machine.physpage;
inuse = free = locked = 0;
for (cnt = server->machine.count; --cnt >= 0; pp++) {
if (pp->p_free)
free++;
else if (pp->p_lock || pp->p_keepcnt > 0)
locked++;
else
inuse++;
}
/* convert memory stats to Kbytes */
buf->total = pagetok (inuse + free);
buf->used = pagetok (inuse);
buf->free = pagetok (free);
buf->locked = pagetok (locked);
buf->flags = _glibtop_sysdeps_mem;
}
} }

View File

@@ -19,13 +19,199 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <glibtop.h>
#include <glibtop/open.h> #include <glibtop/open.h>
#include <glibtop/xmalloc.h>
struct nlist _glibtop_nlist[] = {
#ifdef i386
{ "avenrun" }, /* 0 */
{ "ccpu" }, /* 1 */
{ "mpid" }, /* 2 */
{ "nproc" }, /* 3 */
{ "proc" }, /* 4 */
{ "total" }, /* 5 */
{ "cp_time" }, /* 6 */
{ "pages" }, /* 7 */
{ "epages" }, /* 8 */
#else
{ "_avenrun" }, /* 0 */
{ "_ccpu" }, /* 1 */
{ "_mpid" }, /* 2 */
{ "_nproc" }, /* 3 */
{ "_proc" }, /* 4 */
{ "_total" }, /* 5 */
{ "_cp_time" }, /* 6 */
{ "_pages" }, /* 7 */
{ "_epages" }, /* 8 */
#ifdef MULTIPROCESSOR
{ "_ncpu" },
{ "_mp_time" },
#endif
#endif
{ 0 }
};
/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */ /* Opens pipe to gtop server. Returns 0 on success and -1 on error. */
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
void void
glibtop_open (glibtop *server, const char *program_name) glibtop_open (glibtop *server, const char *program_name)
{ {
register int pagesize;
/* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */
memset (server, 0, sizeof (glibtop)); memset (server, 0, sizeof (glibtop));
server->name = program_name; server->name = program_name;
server->machine.uid = getuid ();
server->machine.euid = geteuid ();
server->machine.gid = getgid ();
server->machine.egid = getegid ();
/* initialize the kernel interface */
server->machine.kd = kvm_open (NULL, NULL, NULL, O_RDONLY, "libgtop");
if (server->machine.kd == NULL)
glibtop_error__r (server, "kvm_open: %s", strerror (errno));
/* get the list of symbols we want to access in the kernel */
server->machine.nlist_count = kvm_nlist (server->machine.kd, _glibtop_nlist);
if (server->machine.nlist_count < 0)
glibtop_error__r (server, "nlist: %s", strerror (errno));
#ifdef MULTIPROCESSOR
/* were ncpu and xp_time not found in the nlist? */
if ((server->machine.nlist_count > 0) && (_glibtop_nlist[X_NCPU].n_type == 0) &&
(_glibtop_nlist[X_MP_TIME].n_type == 0)) {
/* we were compiled on an MP system but we are not running on one */
/* so we will pretend this didn't happen and set ncpu = 1 */
server->machine.nlist_count -= 2;
server->machine.ncpu = 1;
}
#endif
#ifdef solbourne
{
unsigned int status, type;
/* Get the number of CPUs on this system. */
syscall(SYS_getcpustatus, &status, &server->machine.ncpu, &type);
}
#endif
/* Make sure all of the symbols were found. */
if ((server->machine.nlist_count > 0) &&
(_glibtop_check_nlist (server, _glibtop_nlist) > 0))
_exit (1);
/* This are for the memory statistics. */
(void) _glibtop_getkval (server, _glibtop_nlist[X_PAGES].n_value,
(int *)(&server->machine.pages),
sizeof (server->machine.pages),
_glibtop_nlist[X_PAGES].n_name);
(void) _glibtop_getkval (server, _glibtop_nlist[X_EPAGES].n_value,
(int *)(&server->machine.epages),
sizeof (server->machine.epages),
_glibtop_nlist[X_EPAGES].n_name);
server->machine.bytesize = server->machine.epages -
server->machine.pages;
server->machine.count = server->machine.bytesize / sizeof (struct page);
server->machine.physpage =
(struct page *) glibtop_malloc__r (server, server->machine.bytesize);
/* get the page size with "getpagesize" and calculate pageshift from it */
pagesize = getpagesize();
server->machine.pageshift = 0;
while (pagesize > 1) {
server->machine.pageshift++;
pagesize >>= 1;
}
/* we only need the amount of log(2)1024 for our conversion */
server->machine.pageshift -= LOG1024;
/* Drop priviledges. */
if (setreuid (server->machine.euid, server->machine.uid))
_exit (1);
if (setregid (server->machine.egid, server->machine.gid))
_exit (1);
/* !!! END OF SUID ROOT PART !!! */
/* Our effective uid is now those of the user invoking the server,
so we do no longer have any priviledges.
*/
/* NOTE: On SunOS, we do not need to be suid root, we just need to be sgid kmem.
* The server will only use setegid() to get back it's priviledges, so it
* will fail if it is suid root and not sgid kmem.
*/
}
/* Used internally. Returns number of symbols that cannot be found in the nlist. */
int
_glibtop_check_nlist (void *server, register struct nlist *nlst)
{
register int not_found;
/* check to see if we got ALL the symbols we requested */
/* this will write one line to stderr for every symbol not found */
not_found = 0;
while (nlst->n_name != NULL) {
#ifdef i386
if (nlst->n_value == 0) {
glibtop_error__r (server, "kernel: no symbol named `%s'", nlst->n_name);
not_found++;
}
#else
if (nlst->n_type == 0) {
glibtop_error__r (server, "kernel: no symbol named `%s'", nlst->n_name);
not_found++;
}
#endif
nlst++;
}
return not_found;
}
/* Used internally. Fetches value from kernel. */
int
_glibtop_getkval (void *void_server, unsigned long offset, int *ptr, int size, char *refstr)
{
glibtop *server = (glibtop *) void_server;
if (kvm_read (server->machine.kd, offset, ptr, size) != size)
{
if (*refstr == '!') return 0;
glibtop_error__r (server, "kvm_read(%s): %s",
refstr, strerror (errno));
}
return 1;
} }

31
sysdeps/sun4/uptime.c Normal file
View File

@@ -0,0 +1,31 @@
/* $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 <config.h>
#include <glibtop/uptime.h>
/* Provides uptime and idle time. */
void
glibtop_get_uptime__r (glibtop *server, glibtop_uptime *buf)
{
memset (buf, 0, sizeof (glibtop_uptime));
}