New file.
1998-07-29 Martin Baulig <martin@home-of-linux.org> * guile/ChangeLog: New file. * features.def: New format - now includes type of return value and parameters. * lib/lib.awk: Changed to use new `features.def'. * sysdeps/guile/guile.awk: Dito; * sysdeps/guile/names/guile-names.awk: Dito. * libgtopConf.sh.in: Added `LIBGTOP_NAMES_LIBS', `LIBGTOP_NAMES_INCS', `LIBGTOP_GUILE_NAMES_LIBS', `LIBGTOP_GUILE_NAMES_INCS', `LIBGTOP_MAJOR_VERSION', `LIBGTOP_MINOR_VERSION' `LIBGTOP_VERSION', `libgtop_sysdeps_dir'. * acinclude.m4 (AC_LC_SYSDEPS): Removed since this has been replaced with `GNOME_LIBGTOP_SYSDEPS' long ago. * LIBGTOP-VERSION: New file. * */Makefile.am (INCLUDES): Removed; now defined in `configure.in'. * sysdeps/names/mountlist.c: New file. * lib/{init, open}.c (GTOP_SERVER): Renamed to `LIBGTOP_SERVER'. * configure.in (INCLUDES): Added definition. (libgtop_want_names): Always true; `libgtop_names.la' is now always created since some other programs rely upon it - but have to use `LIBGTOP_NAMES_LIBS' and `LIBGTOP_NAMES_INCS' to use it in your application. (libgtop_want_guile_names): Always true; but you have to use `LIBGTOP_GUILE_NAMES_LIBS' and `LIBGTOP_GUILE_NAMES_INCS' to use it in your application. (LIBGTOP_LIBS): Removed `-lgtop_names' and `-lgtop_guile_names'. (LIBGTOP_NAMES_LIBS): New variable. Use it to link your application with the names interface. (LIBGTOP_NAMES_INCS): New variable. Also #defines `GLIBTOP_NAMES' which is now required if your application wants to use the names interface. (LIBGTOP_GUILE_NAMES_LIBS): New variable. Use it to link your application with the guile names interface. (LIBGTOP_GUILE_NAMES_INCS): New variable. Also #defines `GLIBTOP_NAMES' and `GLIBTOP_GUILE_NAMES' which are now required if your application wants to use the guile names interface.
This commit is contained in:
committed by
Martin Baulig
parent
37eb76e767
commit
f07551a43d
@@ -24,3 +24,4 @@ sun4sol2
|
||||
support
|
||||
i386-freebsd
|
||||
alpha-dec-osf3.0
|
||||
i686-pc-linux-gnu-linux
|
||||
|
48
ChangeLog
48
ChangeLog
@@ -1,3 +1,51 @@
|
||||
1998-07-29 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* guile/ChangeLog: New file.
|
||||
|
||||
* features.def: New format - now includes type of return value
|
||||
and parameters.
|
||||
|
||||
* lib/lib.awk: Changed to use new `features.def'.
|
||||
* sysdeps/guile/guile.awk: Dito;
|
||||
* sysdeps/guile/names/guile-names.awk: Dito.
|
||||
|
||||
* libgtopConf.sh.in: Added
|
||||
`LIBGTOP_NAMES_LIBS', `LIBGTOP_NAMES_INCS',
|
||||
`LIBGTOP_GUILE_NAMES_LIBS', `LIBGTOP_GUILE_NAMES_INCS',
|
||||
`LIBGTOP_MAJOR_VERSION', `LIBGTOP_MINOR_VERSION'
|
||||
`LIBGTOP_VERSION', `libgtop_sysdeps_dir'.
|
||||
|
||||
* acinclude.m4 (AC_LC_SYSDEPS): Removed since this has been
|
||||
replaced with `GNOME_LIBGTOP_SYSDEPS' long ago.
|
||||
|
||||
* LIBGTOP-VERSION: New file.
|
||||
|
||||
* */Makefile.am (INCLUDES): Removed; now defined in `configure.in'.
|
||||
|
||||
* sysdeps/names/mountlist.c: New file.
|
||||
|
||||
* lib/{init, open}.c (GTOP_SERVER): Renamed to `LIBGTOP_SERVER'.
|
||||
|
||||
* configure.in (INCLUDES): Added definition.
|
||||
(libgtop_want_names): Always true; `libgtop_names.la' is now
|
||||
always created since some other programs rely upon it - but
|
||||
have to use `LIBGTOP_NAMES_LIBS' and `LIBGTOP_NAMES_INCS' to
|
||||
use it in your application.
|
||||
(libgtop_want_guile_names): Always true; but you have to use
|
||||
`LIBGTOP_GUILE_NAMES_LIBS' and `LIBGTOP_GUILE_NAMES_INCS' to
|
||||
use it in your application.
|
||||
(LIBGTOP_LIBS): Removed `-lgtop_names' and `-lgtop_guile_names'.
|
||||
(LIBGTOP_NAMES_LIBS): New variable. Use it to link your
|
||||
application with the names interface.
|
||||
(LIBGTOP_NAMES_INCS): New variable. Also #defines `GLIBTOP_NAMES'
|
||||
which is now required if your application wants to use the names
|
||||
interface.
|
||||
(LIBGTOP_GUILE_NAMES_LIBS): New variable. Use it to link your
|
||||
application with the guile names interface.
|
||||
(LIBGTOP_GUILE_NAMES_INCS): New variable. Also #defines
|
||||
`GLIBTOP_NAMES' and `GLIBTOP_GUILE_NAMES' which are now required
|
||||
if your application wants to use the guile names interface.
|
||||
|
||||
1998-07-24 Martin Baulig <martin@home-of-linux.org>
|
||||
|
||||
* sysdeps/common/mountlist.c (glibtop_get_mountlist_s):
|
||||
|
7
LIBGTOP-VERSION
Normal file
7
LIBGTOP-VERSION
Normal file
@@ -0,0 +1,7 @@
|
||||
LIBGTOP_MAJOR_VERSION=0
|
||||
LIBGTOP_MINOR_VERSION=2a
|
||||
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION
|
||||
|
||||
# For automake.
|
||||
VERSION=$LIBGTOP_VERSION
|
||||
PACKAGE=libgtop
|
21
Makefile.am
21
Makefile.am
@@ -1,14 +1,18 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
if GLIBTOP_EXAMPLES
|
||||
examples_SUBDIRS = examples
|
||||
|
||||
if GUILE
|
||||
guile_SUBDIRS = guile
|
||||
else
|
||||
guile_SUBDIRS =
|
||||
endif
|
||||
|
||||
built_SUBDIRS = include sysdeps lib src
|
||||
|
||||
SUBDIRS = po intl support macros $(built_SUBDIRS) $(examples_SUBDIRS)
|
||||
SUBDIRS = po intl support macros include sysdeps lib src \
|
||||
$(guile_subdirs) $(examples_SUBDIRS)
|
||||
|
||||
DIST_SUBDIRS = po intl macros include sysdeps src lib examples
|
||||
DIST_SUBDIRS = po intl macros include sysdeps src lib guile examples
|
||||
|
||||
include_HEADERS = glibtop.h
|
||||
|
||||
@@ -41,16 +45,21 @@ libgtopConf.sh: libgtopConf.sh.in Makefile
|
||||
-e 's,\@LIBGTOP_INCLUDEDIR\@,$(includedir),g' \
|
||||
-e 's,\@LIBGTOP_LIBS\@,$(LIBGTOP_LIBS),g' \
|
||||
-e 's,\@LIBGTOP_INCS\@,$(LIBGTOP_INCS),g' \
|
||||
-e 's,\@LIBGTOP_NAMES_LIBS\@,$(LIBGTOP_NAMES_LIBS),g' \
|
||||
-e 's,\@LIBGTOP_NAMES_INCS\@,$(LIBGTOP_NAMES_INCS),g' \
|
||||
-e 's,\@LIBGTOP_GUILE_LIBS\@,$(LIBGTOP_GUILE_LIBS),g' \
|
||||
-e 's,\@LIBGTOP_GUILE_INCS\@,$(LIBGTOP_GUILE_INCS),g' \
|
||||
-e 's,\@LIBGTOP_GUILE_NAMES_LIBS\@,$(LIBGTOP_GUILE_NAMES_LIBS),g' \
|
||||
-e 's,\@LIBGTOP_GUILE_NAMES_INCS\@,$(LIBGTOP_GUILE_NAMES_INCS),g' \
|
||||
-e 's,\@LIBGTOP_BINDIR\@,$(LIBGTOP_BINDIR),g' \
|
||||
-e 's,\@LIBGTOP_SERVER\@,$(LIBGTOP_SERVER),g' \
|
||||
-e 's,\@LIBGTOP_MAJOR_VERSION\@,$(LIBGTOP_MAJOR_VERSION),g' \
|
||||
-e 's,\@LIBGTOP_MINOR_VERSION\@,$(LIBGTOP_MINOR_VERSION),g' \
|
||||
-e 's,\@LIBGTOP_VERSION\@,$(LIBGTOP_VERSION),g' \
|
||||
-e 's,\@libgtop_sysdeps_dir\@,$(libgtop_sysdeps_dir),g' \
|
||||
-e 's,\@libgtop_need_server\@,$(libgtop_need_server),g' \
|
||||
-e 's,\@libgtop_use_machine_h\@,$(libgtop_use_machine_h),g' \
|
||||
-e 's,\@libgtop_guile_found\@,$(libgtop_guile_found),g' \
|
||||
-e 's,\@libgtop_want_names\@,$(libgtop_want_names),g' \
|
||||
-e 's,\@libgtop_want_guile_names\@,$(libgtop_want_guile_names),g' \
|
||||
-e 's,\@libgtop_want_examples\@,$(libgtop_want_examples),g' \
|
||||
< $(srcdir)/libgtopConf.sh.in > libgtopConf.tmp \
|
||||
&& mv libgtopConf.tmp libgtopConf.sh
|
||||
|
91
acinclude.m4
91
acinclude.m4
@@ -10,97 +10,6 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
AC_DEFUN([AC_LC_CANONICAL_HOST],[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
# The way shlib-versions is used to generate soversions.mk uses a
|
||||
# fairly simplistic model for name recognition that can't distinguish
|
||||
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
|
||||
# of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
|
||||
# tell. This doesn't get used much beyond that, so it's fairly safe.
|
||||
case "$host_os" in
|
||||
linux*)
|
||||
;;
|
||||
gnu*)
|
||||
host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([AC_LC_SYSDEPS],[
|
||||
AC_REQUIRE([AC_LC_CANONICAL_HOST])
|
||||
AC_REQUIRE([GNOME_LIBGTOP_SYSDEPS])
|
||||
|
||||
AC_MSG_CHECKING(whether we need the gtop_server)
|
||||
|
||||
AC_ARG_ENABLE(libgtop-server,
|
||||
[ --enable-libgtop-server use gtop_server [default=auto]],
|
||||
[if test "x$enableval" = "xyes" ; then
|
||||
libgtop_need_server=yes
|
||||
elif test "x$enableval" = "xno" ; then
|
||||
libgtop_need_server=no
|
||||
fi])
|
||||
|
||||
AC_MSG_RESULT($libgtop_need_server)
|
||||
|
||||
AC_MSG_CHECKING(whether building of libgtop names is requested)
|
||||
|
||||
AC_ARG_ENABLE(libgtop-names,
|
||||
[ --enable-libgtop-names enable building of 'names' subdirs [default=yes]],
|
||||
[if test "x$enableval" = "xyes" ; then
|
||||
libgtop_want_names=yes
|
||||
else
|
||||
libgtop_want_names=$enableval
|
||||
fi],[libgtop_want_names=yes])
|
||||
|
||||
AC_MSG_RESULT($libgtop_want_names)
|
||||
|
||||
if test x$libgtop_want_names = xyes ; then
|
||||
AC_DEFINE(GLIBTOP_NAMES)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(GLIBTOP_NAMES, test x$libgtop_want_names = xyes)
|
||||
|
||||
AC_MSG_CHECKING(whether building of the guile interface is requested)
|
||||
|
||||
AC_ARG_ENABLE(libgtop-guile,
|
||||
[ --enable-libgtop-guile enable building of the guile interface [default=yes]],
|
||||
[if test "x$enableval" = "xyes" ; then
|
||||
libgtop_want_guile=yes
|
||||
else
|
||||
libgtop_want_guile=$enableval
|
||||
fi],[libgtop_want_guile=yes])
|
||||
|
||||
AC_MSG_RESULT($libgtop_want_guile)
|
||||
|
||||
AC_MSG_CHECKING(whether building of the examples is requested)
|
||||
|
||||
AC_ARG_ENABLE(libgtop-examples,
|
||||
[ --disable-libgtop-examples disable building of the examples],
|
||||
[if test "x$enableval" = "xyes" ; then
|
||||
libgtop_want_examples=yes
|
||||
else
|
||||
libgtop_want_examples=$enableval
|
||||
fi],[libgtop_want_examples=yes])
|
||||
|
||||
AC_MSG_RESULT($libgtop_want_examples)
|
||||
|
||||
if test x$libgtop_want_examples = xyes ; then
|
||||
AC_DEFINE(GLIBTOP_EXAMPLES)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(GLIBTOP_EXAMPLES, test x$libgtop_want_examples = xyes)
|
||||
|
||||
if test x$libgtop_use_machine_h = xyes ; then
|
||||
machine_incs="-I\$(top_srcdir)/sysdeps/$sysdeps_dir"
|
||||
fi
|
||||
|
||||
AC_SUBST(machine_incs)
|
||||
AC_SUBST(libgtop_want_names)
|
||||
AC_SUBST(libgtop_want_guile)
|
||||
AC_SUBST(libgtop_want_examples)
|
||||
])
|
||||
|
||||
######################################################################
|
||||
# progtest.m4 from gettext 0.32
|
||||
######################################################################
|
||||
|
74
configure.in
74
configure.in
@@ -6,7 +6,12 @@ AC_INIT(copyright.txt)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
AM_INIT_AUTOMAKE(libgtop, 0.01)
|
||||
. $srcdir/LIBGTOP-VERSION
|
||||
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
|
||||
|
||||
AC_SUBST(LIBGTOP_MAJOR_VERSION)
|
||||
AC_SUBST(LIBGTOP_MINOR_VERSION)
|
||||
AC_SUBST(LIBGTOP_VERSION)
|
||||
|
||||
AM_ACLOCAL_INCLUDE(macros)
|
||||
|
||||
@@ -47,20 +52,15 @@ else
|
||||
AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
|
||||
fi
|
||||
|
||||
AC_LC_SYSDEPS
|
||||
GNOME_LIBGTOP_SYSDEPS
|
||||
|
||||
libgtop_want_guile=yes
|
||||
|
||||
if test x$libgtop_want_guile = xyes ; then
|
||||
GNOME_CHECK_GUILE
|
||||
if test x$ac_cv_guile_found = xyes ; then
|
||||
if test x$libgtop_want_names = xyes ; then
|
||||
AC_DEFINE(GLIBTOP_GUILE_NAMES)
|
||||
fi
|
||||
guile_examples='third third_static'
|
||||
guile_subdirs='guile'
|
||||
else
|
||||
guile_examples=
|
||||
guile_subdirs=
|
||||
fi
|
||||
else
|
||||
guile_examples=
|
||||
guile_subdirs=
|
||||
@@ -131,12 +131,6 @@ AC_SUBST(libs_xauth)
|
||||
dnl For diskusage stuff
|
||||
GNOME_FILEUTILS_CHECKS
|
||||
|
||||
CFLAGS="$CFLAGS -D_IN_LIBGTOP"
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(CPPFLAGS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(GNOME_ENABLE_DEBUG),)
|
||||
|
||||
dnl If you want to use libgtop without gnome, uncomment the following paragraph:
|
||||
@@ -178,44 +172,41 @@ 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
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_common -lgtop_sysdeps"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_common -lgtop_sysdeps"
|
||||
|
||||
AC_SUBST(libgtop_want_guile_names)
|
||||
LIBGTOP_NAMES_LIBS="$LIBGTOP_LIBS -lgtop_names"
|
||||
LIBGTOP_GUILE_NAMES_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_guile_names"
|
||||
LIBGTOP_GUILE_NAMES_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_names"
|
||||
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_common $libs_xauth"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_common $libs_xauth"
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS $libs_xauth"
|
||||
LIBGTOP_NAMES_LIBS="$LIBGTOP_NAMES_LIBS $libs_xauth"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS $libs_xauth"
|
||||
LIBGTOP_GUILE_NAMES_LIBS="$LIBGTOP_GUILE_NAMES_LIBS $libs_xauth"
|
||||
|
||||
if test "x$need_server" = "xyes" ; then
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop"
|
||||
else
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_sysdeps"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_sysdeps"
|
||||
fi
|
||||
LIBGTOP_NAMES_INCS="$LIBGTOP_INCS -DGLIBTOP_NAMES"
|
||||
LIBGTOP_GUILE_NAMES_INCS="$LIBGTOP_GUILE_INCS -DGLIBTOP_GUILE_NAMES"
|
||||
LIBGTOP_GUILE_NAMES_INCS="$LIBGTOP_GUILE_INCS -DGLIBTOP_NAMES"
|
||||
|
||||
if test "x$ac_cv_guile_found" = "xyes" ; then
|
||||
LIBGTOP_INCS="$LIBGTOP_INCS $GUILE_INCS"
|
||||
LIBGTOP_GUILE_INCS="$LIBGTOP_INCS $GUILE_INCS"
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS $GUILE_LIBS"
|
||||
fi
|
||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS $GUILE_LIBS"
|
||||
LIBGTOP_GUILE_INCS="$LIBGTOP_GUILE_INCS $GUILE_INCS"
|
||||
|
||||
machine_incs='-I$(top_srcdir)/sysdeps/@sysdeps_dir@'
|
||||
machine_incs="-I\$(top_srcdir)/sysdeps/$sysdeps_dir"
|
||||
|
||||
AC_SUBST(machine_incs)
|
||||
|
||||
INCLUDES="$CFLAGS -D_IN_LIBGTOP -D_GNU_SOURCE -DGLIBTOP_NAMES -DGLIBTOP_GUILE -DGLIBTOP_GUILE_NAMES -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include -I\$(top_srcdir)/intl $GUILE_INCS "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_SERVER=\"'"$LIBGTOP_SERVER"'\"'
|
||||
|
||||
AC_SUBST(INCLUDES)
|
||||
|
||||
AC_SUBST(LIBGTOP_LIBS)
|
||||
AC_SUBST(LIBGTOP_INCS)
|
||||
AC_SUBST(LIBGTOP_NAMES_LIBS)
|
||||
AC_SUBST(LIBGTOP_NAMES_INCS)
|
||||
AC_SUBST(LIBGTOP_GUILE_LIBS)
|
||||
AC_SUBST(LIBGTOP_GUILE_INCS)
|
||||
AC_SUBST(LIBGTOP_GUILE_NAMES_LIBS)
|
||||
AC_SUBST(LIBGTOP_GUILE_NAMES_INCS)
|
||||
AC_SUBST(LIBGTOP_BINDIR)
|
||||
AC_SUBST(LIBGTOP_SERVER)
|
||||
|
||||
@@ -258,6 +249,7 @@ src/Makefile
|
||||
src/server/Makefile
|
||||
src/daemon/Makefile
|
||||
lib/Makefile
|
||||
guile/Makefile
|
||||
examples/Makefile
|
||||
perl/Makefile.PL
|
||||
support/Makefile
|
||||
|
@@ -2,10 +2,6 @@
|
||||
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@ -O0
|
||||
|
||||
DEFS = @DEFS@
|
||||
@@ -36,10 +32,8 @@ second_static_SOURCES = $(second_SOURCES)
|
||||
second_static_LDADD = $(second_LDADD)
|
||||
second_static_LDFLAGS = -static
|
||||
|
||||
if GLIBTOP_NAMES
|
||||
third_guile_names_LIBS = $(top_builddir)/sysdeps/guile/names/libgtop_guile_names.la
|
||||
third_names_LIBS = $(top_builddir)/sysdeps/names/libgtop_names.la
|
||||
endif
|
||||
|
||||
third_SOURCES = third.c
|
||||
third_LDADD = $(top_builddir)/sysdeps/guile/libgtop_guile.la \
|
||||
|
36
features.def
36
features.def
@@ -1,18 +1,18 @@
|
||||
cpu ulong(total,user,nice,sys,idle,frequency)
|
||||
mem ulong(total,used,free,shared,buffer,cached,user,locked)
|
||||
swap ulong(total,used,free)
|
||||
uptime double(uptime,idletime)
|
||||
loadavg double(loadavg[0],loadavg[1],loadavg[2])
|
||||
shm_limits ulong(shmmax,shmmin,shmmni,shmseg,shmall)
|
||||
msg_limits ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql)
|
||||
sem_limits ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem)
|
||||
proclist ulong(number,size,total)
|
||||
proc_state str(cmd):char(state):ulong(uid,gid)
|
||||
proc_uid long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice)
|
||||
proc_mem long(size,vsize,resident,share,rss,rss_rlim)
|
||||
proc_time long(start_time,utime,stime,cutime,cstime,timeout,it_real_value)
|
||||
proc_signal ulong(signal,blocked,sigignore,sigcatch)
|
||||
proc_kernel ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,wchan)
|
||||
proc_segment long(trs,lrs,drs,dt):ulong(start_code,end_code,start_stack)
|
||||
@mountlist ulong(number,size,total)
|
||||
fsusage ulong(blocks,bfree,bavail,files,ffree)
|
||||
void|cpu|ulong(total,user,nice,sys,idle,frequency)
|
||||
void|mem|ulong(total,used,free,shared,buffer,cached,user,locked)
|
||||
void|swap|ulong(total,used,free)
|
||||
void|uptime|double(uptime,idletime)
|
||||
void|loadavg|double(loadavg[0],loadavg[1],loadavg[2])
|
||||
void|shm_limits|ulong(shmmax,shmmin,shmmni,shmseg,shmall)
|
||||
void|msg_limits|ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql)
|
||||
void|sem_limits|ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem)
|
||||
unsigned *|proclist|ulong(number,size,total)
|
||||
void|proc_state|str(cmd):char(state):ulong(uid,gid)|pid_t|pid
|
||||
void|proc_uid|long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice)|pid_t|pid
|
||||
void|proc_mem|long(size,vsize,resident,share,rss,rss_rlim)|pid_t|pid
|
||||
void|proc_time|long(start_time,utime,stime,cutime,cstime,timeout,it_real_value)|pid_t|pid
|
||||
void|proc_signal|ulong(signal,blocked,sigignore,sigcatch)|pid_t|pid
|
||||
void|proc_kernel|ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,wchan)|pid_t|pid
|
||||
void|proc_segment|long(trs,lrs,drs,dt):ulong(start_code,end_code,start_stack)|pid_t|pid
|
||||
glibtop_mountentry *|@mountlist|ulong(number,size,total)|int|all_fs
|
||||
void|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|const char *|mount_dir|strlen (mount_dir) + 1
|
||||
|
@@ -63,6 +63,36 @@ extern glibtop_mountentry *glibtop_get_mountlist_l __P((glibtop *, glibtop_mount
|
||||
|
||||
extern glibtop_mountentry *glibtop_get_mountlist_s __P((glibtop *, glibtop_mountlist *, int));
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
/* You need to link with -lgtop_guile to get this stuff here. */
|
||||
|
||||
extern SCM glibtop_guile_get_mountlist __P((SCM));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_GUILE_NAMES
|
||||
|
||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
|
||||
|
||||
extern SCM glibtop_guile_names_mountlist __P((void));
|
||||
extern SCM glibtop_guile_types_mountlist __P((void));
|
||||
extern SCM glibtop_guile_labels_mountlist __P((void));
|
||||
extern SCM glibtop_guile_descriptions_mountlist __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_mountlist [];
|
||||
extern const unsigned glibtop_types_mountlist [];
|
||||
extern const char *glibtop_labels_mountlist [];
|
||||
extern const char *glibtop_descriptions_mountlist [];
|
||||
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
@@ -1,10 +1,6 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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=\""@LIBGTOP_SERVER@"\"
|
||||
CFLAGS = -Wall -W @CFLAGS@
|
||||
|
||||
lib_LTLIBRARIES = libgtop.la
|
||||
|
||||
|
@@ -41,7 +41,7 @@ _init_server (glibtop *server, const unsigned features)
|
||||
|
||||
if (server->server_command == NULL) {
|
||||
const char *temp = getenv ("LIBGTOP_SERVER") ?
|
||||
getenv ("LIBGTOP_SERVER") : GTOP_SERVER;
|
||||
getenv ("LIBGTOP_SERVER") : LIBGTOP_SERVER;
|
||||
|
||||
server->server_command = glibtop_strdup_r (server, temp);
|
||||
}
|
||||
|
119
lib/lib.awk
119
lib/lib.awk
@@ -11,30 +11,46 @@ BEGIN {
|
||||
print "";
|
||||
}
|
||||
|
||||
function output(feature) {
|
||||
orig = feature;
|
||||
sub(/@/,"",feature);
|
||||
if (feature ~ /^proclist$/) {
|
||||
print "unsigned *";
|
||||
prefix = "return ";
|
||||
} else if (feature ~ /^mountlist$/) {
|
||||
print "glibtop_mountentry *";
|
||||
prefix = "return ";
|
||||
function output(line) {
|
||||
split (line, line_fields, /\|/);
|
||||
retval = line_fields[1];
|
||||
feature = line_fields[2];
|
||||
param_typ = line_fields[4];
|
||||
param = line_fields[5];
|
||||
param_size = line_fields[6];
|
||||
|
||||
if (param_typ == "") {
|
||||
param_size = "0";
|
||||
param_ptr = "NULL";
|
||||
} else {
|
||||
prefix = "";
|
||||
print "void";
|
||||
}
|
||||
if (feature ~ /^proc_/) {
|
||||
param = ", pid_t pid";
|
||||
} else if (feature ~ /^fsusage$/) {
|
||||
param = ", const char *mountdir";
|
||||
} else if (feature ~ /^mountlist$/) {
|
||||
param = ", int all_fs";
|
||||
} else {
|
||||
param = "";
|
||||
if (param_size == "")
|
||||
param_size = "sizeof ("param_typ")";
|
||||
|
||||
if (param_typ ~ /*/)
|
||||
param_ptr = param;
|
||||
else
|
||||
param_ptr = "&"param;
|
||||
}
|
||||
|
||||
orig = feature; sub(/^@/,"",feature);
|
||||
space = feature; gsub(/./," ",space);
|
||||
|
||||
print retval;
|
||||
if (retval !~ /^void$/) {
|
||||
prefix = "return ";
|
||||
prefix_space = " ";
|
||||
} else {
|
||||
prefix = "";
|
||||
prefix_space = "";
|
||||
}
|
||||
|
||||
if (param_typ != "") {
|
||||
print "glibtop_get_"feature"_l (glibtop *server, glibtop_"feature" *buf,";
|
||||
print " "space" "param_typ" "param")";
|
||||
} else {
|
||||
print "glibtop_get_"feature"_l (glibtop *server, glibtop_"feature" *buf)";
|
||||
}
|
||||
|
||||
print "glibtop_get_"feature"_l (glibtop *server, glibtop_"feature" *buf"param")";
|
||||
print "{";
|
||||
print "\tglibtop_init_r (&server, GLIBTOP_SYSDEPS_"toupper(feature)", 0);";
|
||||
print "";
|
||||
@@ -42,59 +58,40 @@ function output(feature) {
|
||||
print "\t (server->features & (1 << GLIBTOP_SYSDEPS_"toupper(feature)")))";
|
||||
print "\t{";
|
||||
|
||||
if (feature ~ /^proc_/) {
|
||||
print "\t\tglibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)",";
|
||||
print "\t\t\t\tsizeof (pid_t), &pid,";
|
||||
print "\t\t\t\tsizeof (glibtop_"feature"),";
|
||||
print "\t\t\t\tbuf);";
|
||||
print "\t} else {";
|
||||
print "#if (!GLIBTOP_SUID_"toupper(feature)")";
|
||||
print "\t\tglibtop_get_"feature"_r (server, buf, pid);";
|
||||
} else if (feature ~ /^fsusage$/) {
|
||||
print "\t\tglibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)",";
|
||||
print "\t\t\t\tstrlen (mountdir) + 1, mountdir,";
|
||||
print "\t\t\t\tsizeof (glibtop_"feature"), buf);";
|
||||
print "\t} else {";
|
||||
print "#if (!GLIBTOP_SUID_"toupper(feature)")";
|
||||
print "\t\tglibtop_get_"feature"_r (server, buf, mountdir);";
|
||||
if (param == "")
|
||||
print "\t\t"prefix"glibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)", 0, NULL,";
|
||||
else
|
||||
print "\t\t"prefix"glibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)",";
|
||||
|
||||
if (param == "") {
|
||||
print "\t\t\t\t"prefix_space"sizeof (glibtop_"feature"), buf);";
|
||||
} else {
|
||||
if (feature ~ /^mountlist$/) {
|
||||
print "\t\treturn glibtop_call_l (server, GLIBTOP_CMND_MOUNTLIST,";
|
||||
print "\t\t\t\t sizeof (all_fs), &all_fs,";
|
||||
print "\t\t\t\t sizeof (glibtop_mountlist),";
|
||||
print "\t\t\t\t buf);";
|
||||
} else if (feature ~ /^proclist$/) {
|
||||
print "\t\treturn glibtop_call_l (server, GLIBTOP_CMND_PROCLIST,";
|
||||
print "\t\t\t\t 0, NULL, sizeof (glibtop_proclist),";
|
||||
print "\t\t\t\t buf);";
|
||||
} else {
|
||||
print "\t\tglibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)", 0, NULL,";
|
||||
print "\t\t\t\tsizeof (glibtop_"feature"), buf);";
|
||||
print "\t\t\t\t"prefix_space""param_size", "param_ptr",";
|
||||
print "\t\t\t\t"prefix_space"sizeof (glibtop_"feature"),";
|
||||
print "\t\t\t\t"prefix_space"buf);";
|
||||
}
|
||||
|
||||
print "\t} else {";
|
||||
if (orig ~ /^@/) {
|
||||
if (feature ~ /^mountlist$/) {
|
||||
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf, all_fs);";
|
||||
} else {
|
||||
print "\t\t"prefix"glibtop_get_"feature"_s (server, buf);";
|
||||
}
|
||||
} else {
|
||||
|
||||
if (orig !~ /^@/)
|
||||
print "#if (!GLIBTOP_SUID_"toupper(feature)")";
|
||||
|
||||
if (param == "")
|
||||
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf);";
|
||||
}
|
||||
}
|
||||
if (!(orig ~ /^@/)) {
|
||||
else
|
||||
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf, "param");";
|
||||
|
||||
if (orig !~ /^@/) {
|
||||
print "#else";
|
||||
print "\t\terrno = ENOSYS;";
|
||||
print "\t\tglibtop_error_io_r (server, \"glibtop_get_"feature"\");";
|
||||
print "#endif";
|
||||
}
|
||||
|
||||
print "\t}";
|
||||
print "}";
|
||||
print "";
|
||||
}
|
||||
|
||||
/^@(\w+)/ { output($1) }
|
||||
|
||||
/^(\w+)/ { output($1) }
|
||||
/^[^#]/ { output($0) }
|
||||
|
||||
|
12
lib/open.c
12
lib/open.c
@@ -101,7 +101,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
|
||||
break;
|
||||
case GLIBTOP_METHOD_PIPE:
|
||||
fprintf (stderr, "Opening pipe to server (%s).\n",
|
||||
GTOP_SERVER);
|
||||
LIBGTOP_SERVER);
|
||||
|
||||
if (pipe (server->input) || pipe (server->output))
|
||||
glibtop_error_io_r (server, "cannot make a pipe");
|
||||
@@ -115,15 +115,17 @@ glibtop_open_l (glibtop *server, const char *program_name,
|
||||
close (server->input [0]); close (server->output [1]);
|
||||
dup2 (server->input [1], 1);
|
||||
dup2 (server->output [0], 0);
|
||||
execl (GTOP_SERVER, NULL);
|
||||
glibtop_error_io_r (server, "execl (%s)", GTOP_SERVER);
|
||||
execl (LIBGTOP_SERVER, NULL);
|
||||
glibtop_error_io_r (server, "execl (%s)",
|
||||
LIBGTOP_SERVER);
|
||||
_exit (2);
|
||||
}
|
||||
|
||||
close (server->input [1]);
|
||||
close (server->output [0]);
|
||||
|
||||
sprintf (version, "%s server %s ready.\n", PACKAGE, VERSION);
|
||||
sprintf (version, "Libgtop server %s ready.\n",
|
||||
LIBGTOP_VERSION);
|
||||
|
||||
glibtop_read_l (server, sizeof (nbytes), &nbytes);
|
||||
|
||||
@@ -135,7 +137,7 @@ glibtop_open_l (glibtop *server, const char *program_name,
|
||||
|
||||
if (memcmp (version, buffer, strlen (version)))
|
||||
glibtop_error_r (server, "server version is not %s",
|
||||
VERSION);
|
||||
LIBGTOP_VERSION);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -8,18 +8,26 @@ LIBGTOP_INCLUDEDIR="@LIBGTOP_INCLUDEDIR@"
|
||||
LIBGTOP_LIBS="@LIBGTOP_LIBS@"
|
||||
LIBGTOP_INCS="@LIBGTOP_INCS@"
|
||||
|
||||
LIBGTOP_NAMES_LIBS="@LIBGTOP_NAMES_LIBS@"
|
||||
LIBGTOP_NAMES_INCS="@LIBGTOP_NAMES_INCS@"
|
||||
|
||||
LIBGTOP_GUILE_LIBS="@LIBGTOP_GUILE_LIBS@"
|
||||
LIBGTOP_GUILE_INCS="@LIBGTOP_GUILE_INCS@"
|
||||
|
||||
LIBGTOP_GUILE_NAMES_LIBS="@LIBGTOP_GUILE_NAMES_LIBS@"
|
||||
LIBGTOP_GUILE_NAMES_INCS="@LIBGTOP_GUILE_NAMES_INCS@"
|
||||
|
||||
LIBGTOP_BINDIR="@LIBGTOP_BINDIR@"
|
||||
LIBGTOP_SERVER="@LIBGTOP_SERVER@"
|
||||
|
||||
LIBGTOP_MAJOR_VERSION="@LIBGTOP_MAJOR_VERSION@"
|
||||
LIBGTOP_MINOR_VERSION="@LIBGTOP_MINOR_VERSION@"
|
||||
LIBGTOP_VERSION="@LIBGTOP_VERSION@"
|
||||
|
||||
libgtop_sysdeps_dir="@libgtop_sysdeps_dir@"
|
||||
libgtop_need_server="@libgtop_need_server@"
|
||||
libgtop_use_machine_h="@libgtop_use_machine_h@"
|
||||
|
||||
libgtop_guile_found="@libgtop_guile_found@"
|
||||
|
||||
libgtop_want_names="@libgtop_want_names@"
|
||||
libgtop_want_guile_names="@libgtop_want_guile_names@"
|
||||
libgtop_want_examples="@libgtop_want_examples@"
|
||||
|
@@ -1,11 +1,6 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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=\""@LIBGTOP_SERVER@"\" \
|
||||
-DDEBUG -DREAL_DEBUG -D_BSD \
|
||||
-DLIBGTOP_DAEMON_SLAVE
|
||||
|
||||
|
@@ -1,9 +1,5 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
bin_PROGRAMS = gtop_server
|
||||
|
@@ -4,12 +4,6 @@ else
|
||||
guile_SUBDIRS =
|
||||
endif
|
||||
|
||||
if GLIBTOP_NAMES
|
||||
names_SUBDIRS = names
|
||||
else
|
||||
names_SUBDIRS =
|
||||
endif
|
||||
|
||||
SUBDIRS = @sysdeps_dir@ common $(names_SUBDIRS) $(guile_SUBDIRS)
|
||||
SUBDIRS = @sysdeps_dir@ common names $(guile_SUBDIRS)
|
||||
|
||||
DIST_SUBDIRS = common guile linux kernel names osf1 stub sun4
|
||||
|
@@ -1,9 +1,5 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
lib_LTLIBRARIES = libgtop_common.la libgtop_suid_common.la
|
||||
|
@@ -1,15 +1,7 @@
|
||||
if GLIBTOP_NAMES
|
||||
SUBDIRS = names
|
||||
endif
|
||||
|
||||
DIST_SUBDIRS = names
|
||||
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
lib_LTLIBRARIES = libgtop_guile.la
|
||||
@@ -25,3 +17,4 @@ guile.c: guile.awk $(top_builddir)/config.h $(top_srcdir)/features.def
|
||||
EXTRA_DIST = guile.awk
|
||||
|
||||
CLEANFILES = guile.c
|
||||
|
||||
|
@@ -16,32 +16,53 @@ BEGIN {
|
||||
convert["double"] = "gh_double2scm";
|
||||
convert["str"] = "gh_str02scm ";
|
||||
convert["char"] = "gh_char2scm ";
|
||||
|
||||
backconv["int"] = "gh_scm2long";
|
||||
backconv["pid_t"] = "gh_scm2ulong";
|
||||
}
|
||||
|
||||
/^(\w+)/ {
|
||||
features[$1] = $1;
|
||||
if ($1 ~ /^proclist$/) {
|
||||
output = "SCM\nglibtop_guile_get_proclist (void)\n{\n";
|
||||
output = output"\tglibtop_proclist proclist;\n\tunsigned i, *ptr;\n";
|
||||
output = output"\tSCM list;\n\n\tptr = glibtop_get_proclist (&proclist);\n\n";
|
||||
output = output"\tlist = gh_list (gh_ulong2scm ("$1".flags),\n\t\t\t";
|
||||
} else {
|
||||
if ($1 ~ /^proc_/) {
|
||||
output = "SCM\nglibtop_guile_get_"$1" (SCM pid)\n{\n";
|
||||
output = output"\tglibtop_"$1" "$1";\n\n";
|
||||
output = output"\tglibtop_get_"$1" (&"$1", (pid_t) gh_scm2long (pid));\n\n";
|
||||
} else if ($1 ~ /^fsusage$/) {
|
||||
output = "SCM\nglibtop_guile_get_"$1" (SCM mountdir)\n{\n";
|
||||
output = output"\tglibtop_"$1" "$1";\n\n";
|
||||
output = output"\tglibtop_get_"$1" (&"$1", gh_scm2newstr (mountdir, NULL));\n\n";
|
||||
} else {
|
||||
output = "SCM\nglibtop_guile_get_"$1" (void)\n{\n";
|
||||
output = output"\tglibtop_"$1" "$1";\n\n";
|
||||
output = output"\tglibtop_get_"$1" (&"$1");\n\n";
|
||||
}
|
||||
output = output"\treturn gh_list (gh_ulong2scm ("$1".flags),\n\t\t\t";
|
||||
}
|
||||
nr_elements = split ($2, elements, /:/);
|
||||
function make_output(line) {
|
||||
split (line, line_fields, /\|/);
|
||||
retval = line_fields[1];
|
||||
element_def = line_fields[3];
|
||||
feature = line_fields[2];
|
||||
param_typ = line_fields[4];
|
||||
param = line_fields[5];
|
||||
param_size = line_fields[6];
|
||||
|
||||
sub(/^@/,"",feature);
|
||||
features[feature] = feature;
|
||||
|
||||
if (param == "")
|
||||
output = "SCM\nglibtop_guile_get_"feature" (void)\n{\n";
|
||||
else
|
||||
output = "SCM\nglibtop_guile_get_"feature" (SCM "param")\n{\n";
|
||||
|
||||
output = output"\tglibtop_"feature" "feature";\n";
|
||||
if (retval != "void")
|
||||
output = output"\t"retval" retval;\n";
|
||||
if (feature ~ /^proclist$/)
|
||||
output = output"\tunsigned i;\n";
|
||||
output = output"\tSCM list;\n\n";
|
||||
|
||||
if (retval != "void")
|
||||
prefix="retval = ";
|
||||
else
|
||||
prefix="";
|
||||
|
||||
if (param_typ == "const char *")
|
||||
param_conv = "gh_scm2newstr ("param", NULL)";
|
||||
else if (param_typ != "")
|
||||
param_conv = backconv[param_typ]" ("param")";
|
||||
|
||||
if (param == "")
|
||||
output = output"\t"prefix"glibtop_get_"feature" (&"feature");\n\n";
|
||||
else
|
||||
output = output"\t"prefix"glibtop_get_"feature" (&"feature", "param_conv");\n\n";
|
||||
|
||||
output = output"\tlist = gh_list (gh_ulong2scm ("feature".flags),\n\t\t\t";
|
||||
|
||||
nr_elements = split (element_def, elements, /:/);
|
||||
for (element = 1; element <= nr_elements; element++) {
|
||||
list = elements[element];
|
||||
type = elements[element];
|
||||
@@ -49,30 +70,33 @@ BEGIN {
|
||||
sub(/^\w+\(/, "", list); sub(/\)$/, "", list);
|
||||
count = split (list, fields, /,/);
|
||||
for (field = 1; field <= count; field++) {
|
||||
output = output""convert[type]" ("$1"."fields[field]"),\n\t\t\t";
|
||||
output = output""convert[type]" ("feature"."fields[field]"),\n\t\t\t";
|
||||
}
|
||||
}
|
||||
output = output"SCM_UNDEFINED);";
|
||||
output = output"SCM_UNDEFINED);\n";
|
||||
|
||||
print output;
|
||||
|
||||
if ($1 ~ /^proclist$/) {
|
||||
if (feature ~ /^proclist$/) {
|
||||
print "\tif (retval == NULL)";
|
||||
print "\t\treturn list;";
|
||||
print "";
|
||||
print "\tif (ptr) {";
|
||||
print "\t\tfor (i = 0; i < proclist.number; i++)";
|
||||
print "\t\t\tlist = scm_append";
|
||||
print "\t\t\t\t(gh_list (list,";
|
||||
print "\t\t\t\t\t gh_list (gh_ulong2scm ((unsigned long) ptr [i])),";
|
||||
print "\t\t\t\t\t SCM_UNDEFINED));";
|
||||
print "\t}";
|
||||
print "\tfor (i = 0; i < proclist.number; i++)";
|
||||
print "\t\tlist = scm_append";
|
||||
print "\t\t\t(gh_list (list,";
|
||||
print "\t\t\t\t gh_list (gh_ulong2scm ((unsigned long) retval [i])),";
|
||||
print "\t\t\t\t SCM_UNDEFINED));";
|
||||
print "";
|
||||
print "\tglibtop_free (ptr);";
|
||||
print "";
|
||||
print "\treturn list;";
|
||||
print "\tglibtop_free (retval);\n";
|
||||
}
|
||||
|
||||
print "\treturn list;";
|
||||
print "}";
|
||||
print "";
|
||||
}
|
||||
|
||||
/^[^#]/ { make_output($0) }
|
||||
|
||||
END {
|
||||
print "void";
|
||||
print "glibtop_boot_guile (void)";
|
||||
|
@@ -1,9 +1,5 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
lib_LTLIBRARIES = libgtop_guile_names.la
|
||||
|
@@ -92,7 +92,14 @@ function output(feature) {
|
||||
print "";
|
||||
}
|
||||
|
||||
/^(\w+)/ { features[$1] = $1 }
|
||||
/^[^#]/ {
|
||||
line = $0;
|
||||
split (line, line_fields, /\|/);
|
||||
feature = line_fields[2];
|
||||
sub(/^@/,"",feature);
|
||||
|
||||
features[feature] = feature;
|
||||
}
|
||||
|
||||
END {
|
||||
for (feature in features) {
|
||||
|
@@ -1,9 +1,5 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
lib_LTLIBRARIES = libgtop_sysdeps.la
|
||||
|
@@ -1,9 +1,5 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
lib_LTLIBRARIES = libgtop_sysdeps.la
|
||||
|
@@ -1,9 +1,5 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
lib_LTLIBRARIES = libgtop_names.la
|
||||
@@ -11,5 +7,6 @@ lib_LTLIBRARIES = libgtop_names.la
|
||||
libgtop_names_la_SOURCES = cpu.c mem.c swap.c uptime.c loadavg.c \
|
||||
shm_limits.c msg_limits.c sem_limits.c \
|
||||
proclist.c sysdeps.c procstate.c procuid.c \
|
||||
proctime.c procmem.c procsignal.c prockernel.c \
|
||||
procsegment.c fsusage.c
|
||||
proctime.c procmem.c procsignal.c \
|
||||
prockernel.c procsegment.c fsusage.c \
|
||||
mountlist.c
|
||||
|
46
sysdeps/names/mountlist.c
Normal file
46
sysdeps/names/mountlist.c
Normal file
@@ -0,0 +1,46 @@
|
||||
/* $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/mountlist.h>
|
||||
|
||||
const char *glibtop_names_mountlist [GLIBTOP_MAX_MOUNTLIST] =
|
||||
{
|
||||
"number", "total", "size"
|
||||
};
|
||||
|
||||
const unsigned glibtop_types_mountlist [GLIBTOP_MAX_MOUNTLIST] =
|
||||
{
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
|
||||
};
|
||||
|
||||
const char *glibtop_labels_mountlist [GLIBTOP_MAX_MOUNTLIST] =
|
||||
{
|
||||
N_("Number of list elements"),
|
||||
N_("Total size of list"),
|
||||
N_("Size of a single list element")
|
||||
};
|
||||
|
||||
const char *glibtop_descriptions_mountlist [GLIBTOP_MAX_MOUNTLIST] =
|
||||
{
|
||||
N_("Number of list elements"),
|
||||
N_("Total size of list"),
|
||||
N_("Size of a single list element")
|
||||
};
|
@@ -1,9 +1,5 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
lib_LTLIBRARIES = libgtop_sysdeps.la libgtop_sysdeps_suid.la
|
||||
|
@@ -1,9 +1,5 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
lib_LTLIBRARIES = libgtop_sysdeps.la
|
||||
|
@@ -1,9 +1,5 @@
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
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@
|
||||
|
||||
lib_LTLIBRARIES = libgtop_sysdeps.la libgtop_sysdeps_suid.la
|
||||
|
Reference in New Issue
Block a user