Compare commits

...

13 Commits

Author SHA1 Message Date
Chris Kühl
7bdc92f325 Release: 2.28.3 2011-03-25 16:04:20 +01:00
Chris Kühl
b40f210d03 Fix build issue for strict linkers.
Closes Bug #644599.
2011-03-14 16:35:09 +01:00
Maxim Ermilov
50bb0d51b3 Add Introspection support
https://bugzilla.gnome.org/show_bug.cgi?id=630915
2011-03-01 13:54:53 +01:00
Fran Diéguez
3d0dc2b36e QA of Galician translations 2011-01-27 03:18:46 +01:00
Gheyret T.Kenji
33f0825b3c Added UG translation 2010-12-23 19:26:01 +01:00
Yaakov Selkowitz
3cc7b3aecb Cygwin: Add private mountlist support.
https://bugzilla.gnome.org/show_bug.cgi?id=621820
2010-11-28 15:46:33 +01:00
Yaakov Selkowitz
f7e1ab5a0e Cygwin: Don't printf a string directly but use %s instead
Based on commit f41ab3beed for Linux.

https://bugzilla.gnome.org/show_bug.cgi?id=621820
2010-11-28 15:39:34 +01:00
Gheyret T.Kenji
f6edec8c76 Added UG translation 2010-11-20 12:02:41 +01:00
Gheyret T.Kenji
ccf85794e2 Added UG translation 2010-11-13 22:45:50 +01:00
Carles Ferrando
9bd7b581cd Updated Catalan (Valencian) translation 2010-10-29 21:31:26 +01:00
Sahran
825c28e04f Added UG translation 2010-10-16 20:32:37 +02:00
Alexander Kojevnikov
f787bfa0c7 freebsd: Fix get_mem() on 64-bit systems (bgo#630128) 2010-10-03 10:17:58 +11:00
Vincent Untz
93ceca1af2 release: post-release bump to 2.28.3 2010-09-28 11:39:49 +02:00
15 changed files with 528 additions and 23 deletions

View File

@@ -1,3 +1,4 @@
ACLOCAL_AMFLAGS = -I m4
if EXAMPLES
EXAMPLES_DIR = examples
@@ -17,7 +18,8 @@ EXTRA_DIST = autogen.sh libgtop.spec.in copyright.txt \
intltool-extract.in \
intltool-merge.in \
libgtop.doap \
intltool-update.in
intltool-update.in \
m4/introspection.m4
DISTCLEANFILES = \
intltool-extract \
@@ -33,4 +35,4 @@ pkgconfig_DATA = libgtop-2.0.pc
libgtop-features.def: features.def
@LN_S@ $< $@
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-introspection

8
NEWS
View File

@@ -1,3 +1,11 @@
25 March 2011: Overview of changes in 2.28.3
================================================
* Fix build issue for strict linkers.
* Add Introspection support
* Cygwin fixes.
* FreeBSD: Fix get_mem() on 64-bit systems.
* Updated translations.
28 September 2010: Overview of changes in 2.28.2
================================================
* Updated translations.

View File

@@ -4,7 +4,7 @@ dnl
m4_define([libgtop_major_version], [2])
m4_define([libgtop_minor_version], [28])
m4_define([libgtop_micro_version], [2])
m4_define([libgtop_micro_version], [3])
m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version])
dnl increment if the interface has additions, changes, removals.
@@ -25,7 +25,7 @@ m4_define([libgtop_server_version], [5])
# Version code calculation
m4_define([libgtop_version_code], [m4_eval(libgtop_major_version * 1000000 + libgtop_minor_version * 1000 + libgtop_micro_version)])
AC_PREREQ(2.59)
AC_PREREQ(2.62)
AC_INIT([libgtop], [libgtop_version],
[http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop])
AC_CONFIG_SRCDIR(copyright.txt)
@@ -33,7 +33,10 @@ AC_CONFIG_HEADERS(config.h)
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE
AM_INIT_AUTOMAKE([-Wno-portability])
AC_CONFIG_MACRO_DIR([m4])
GOBJECT_INTROSPECTION_CHECK([0.6.7])
AC_SUBST(ACLOCAL_AMFLAGS, [\${ACLOCAL_FLAGS}])
AC_SUBST(LIBGTOP_MAJOR_VERSION, [libgtop_major_version])

View File

@@ -6,6 +6,8 @@ INCLUDES = @INCLUDES@
DEFS = @DEFS@
LDFLAGS = $(LIBGTOP_EXTRA_LIBS)
noinst_PROGRAMS = first second pprint procargs df netlist \
mountlist procmap netload sysdeps timings \
openfiles smp proclist mem wd affinity

View File

@@ -20,3 +20,36 @@ EXTRA_DIST = lib.pl libgtop.sym
CLEANFILES = lib.c
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = --accept-unprefixed
INTROSPECTION_COMPILER_ARGS =
if HAVE_INTROSPECTION
introspection_sources = $(libgtop_2_0_la_SOURCES) lib.c ../glibtop.h \
../include/glibtop/close.h ../include/glibtop/loadavg.h ../include/glibtop/prockernel.h ../include/glibtop/procstate.h \
../include/glibtop/sem_limits.h ../include/glibtop/uptime.h ../include/glibtop/command.h ../include/glibtop/mem.h ../include/glibtop/proclist.h \
../include/glibtop/proctime.h ../include/glibtop/shm_limits.h ../include/glibtop/version.h ../include/glibtop/cpu.h ../include/glibtop/msg_limits.h \
../include/glibtop/procmem.h ../include/glibtop/procuid.h ../include/glibtop/swap.h \
../include/glibtop/procsegment.h ../include/glibtop/sysdeps.h ../include/glibtop/global.h \
../include/glibtop/procsignal.h ../include/glibtop/union.h ../include/glibtop/gnuserv.h \
../include/glibtop/parameter.h ../include/glibtop/mountlist.h ../include/glibtop/fsusage.h ../include/glibtop/procmap.h ../include/glibtop/signal.h \
../include/glibtop/sysinfo.h ../include/glibtop/ppp.h ../include/glibtop/procargs.h ../include/glibtop/netload.h \
../include/glibtop/procwd.h ../include/glibtop/procaffinity.h \
../include/glibtop/netlist.h ../include/glibtop/procopenfiles.h ../include/glibtop/open.h
GTop-2.0.gir: libgtop-2.0.la
GTop_2_0_gir_INCLUDES = GObject-2.0
GTop_2_0_gir_CFLAGS = $(INCLUDES)
GTop_2_0_gir_LIBS = libgtop-2.0.la
GTop_2_0_gir_FILES = $(introspection_sources)
INTROSPECTION_GIRS += GTop-2.0.gir
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)
typelibdir = $(libdir)/girepository-1.0
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif

View File

@@ -108,6 +108,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
libgtop_use_machine_h=no
libgtop_need_server=no
libgtop_have_sysinfo=yes
libgtop_sysdeps_private_mountlist=yes
;;
*)
if test x$hacker_mode = xyes ; then

96
m4/introspection.m4 Normal file
View File

@@ -0,0 +1,96 @@
dnl -*- mode: autoconf -*-
dnl Copyright 2009 Johan Dahlin
dnl
dnl This file is free software; the author(s) gives unlimited
dnl permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
# serial 1
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
[
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
dnl enable/disable introspection
m4_if([$2], [require],
[dnl
enable_introspection=yes
],[dnl
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
[Enable introspection for this build]),,
[enable_introspection=auto])
])dnl
AC_MSG_CHECKING([for gobject-introspection])
dnl presence/version checking
AS_CASE([$enable_introspection],
[no], [dnl
found_introspection="no (disabled, use --enable-introspection to enable)"
],dnl
[yes],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
found_introspection=yes,
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
],dnl
[auto],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
],dnl
[dnl
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
])dnl
AC_MSG_RESULT([$found_introspection])
INTROSPECTION_SCANNER=
INTROSPECTION_COMPILER=
INTROSPECTION_GENERATE=
INTROSPECTION_GIRDIR=
INTROSPECTION_TYPELIBDIR=
if test "x$found_introspection" = "xyes"; then
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
INTROSPECTION_GIRDIR=${INTROSPECTION_GIRDIR/$datadir/\$(datadir)}
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
INTROSPECTION_TYPELIBDIR=${INTROSPECTION_TYPELIBDIR/$libdir/\$(libdir)}
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
fi
AC_SUBST(INTROSPECTION_SCANNER)
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)
AC_SUBST(INTROSPECTION_CFLAGS)
AC_SUBST(INTROSPECTION_LIBS)
AC_SUBST(INTROSPECTION_MAKEFILE)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
])

View File

@@ -77,6 +77,7 @@ ta
te
th
tr
ug
uk
vi
xh

View File

@@ -1,23 +1,21 @@
# translation of libgtop.gnome-2-26.po to catalan
# Catalan translation of libgtop.
# Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
#
# Copyright © 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# Softcatalà <gnome@softcatala.net>, 2000, 2001, 2002.
# Jordi Mallach <jordi@sindominio.net>, 2002, 2003, 2004, 2005.
# Carles Ferrando Garcia <carles.ferrando@gmail.com>, 2009.
#
msgid ""
msgstr ""
"Project-Id-Version: libgtop.gnome-2-26\n"
"Project-Id-Version: libgtop 2.9.91\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-02 18:32+0200\n"
"PO-Revision-Date: 2009-08-29 10:37+0200\n"
"Last-Translator: Carles Ferrando Garcia <carles.ferrando@gmail.com>\n"
"Language-Team: catalan <tradgnome@softcatala.org>\n"
"POT-Creation-Date: 2010-10-29 21:31+0100\n"
"PO-Revision-Date: 2005-09-04 01:16+0200\n"
"Last-Translator: Jordi Mallach <jordi@sindominio.net>\n"
"Language-Team: Catalan <tradgnome@softcatala.org>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n!=1;\n"
"X-Generator: KBabel 1.11.4\n"
#: ../lib/read.c:51
#, c-format
@@ -50,11 +48,11 @@ msgstr "Activa la depuració"
#: ../src/daemon/gnuserv.c:457
msgid "Enable verbose output"
msgstr "Activa l'eixida detallada"
msgstr "Activa la eixida detallada"
#: ../src/daemon/gnuserv.c:459
msgid "Don't fork into background"
msgstr "No bifurques al segon pla"
msgstr "No bifurquis al segon pla"
#: ../src/daemon/gnuserv.c:461
msgid "Invoked from inetd"
@@ -190,3 +188,15 @@ msgstr "Senyal 1 definit per l'usuari"
#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57
msgid "User defined signal 2"
msgstr "Senyal 2 definit per l'usuari"
#~ msgid "DEBUG"
#~ msgstr "DEPURACIÓ"
#~ msgid "VERBOSE"
#~ msgstr "DETALLA"
#~ msgid "NO-DAEMON"
#~ msgstr "SENSE DIMONI"
#~ msgid "INETD"
#~ msgstr "INETD"

View File

@@ -19,14 +19,14 @@ msgid ""
msgstr ""
"Project-Id-Version: gl\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-02-15 17:53+0100\n"
"POT-Creation-Date: 2011-01-27 03:18+0100\n"
"PO-Revision-Date: 2010-01-10 03:46+0100\n"
"Last-Translator: Fran Diéguez <frandieguez@ubuntu.com>\n"
"Language-Team: Galician <proxecto@trasno.net>\n"
"Language: gl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: gl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ../lib/read.c:51

185
po/ug.po Normal file
View File

@@ -0,0 +1,185 @@
# Uyghur translation for libgtop.
# Copyright (C) 2010 libgtop's COPYRIGHT HOLDER
# This file is distributed under the same license as the libgtop package.
# Gheyret Kenji <gheyret@yahoo.com>, 2010.
# Sahran <sahran@live.com>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: libgtop master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop&component=general\n"
"POT-Creation-Date: 2010-11-20 11:02+0000\n"
"PO-Revision-Date: 2010-10-08 10:12+0600\n"
"Last-Translator: Sahran <sahran@live.com>\n"
"Language-Team: Uyghur Computer Science Association <UKIJ@yahoogroups.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../lib/read.c:51
#, c-format
msgid "read %d byte"
msgid_plural "read %d bytes"
msgstr[0] "%d بايت ئوقۇ"
#: ../lib/read_data.c:51
msgid "read data size"
msgstr "ئوقۇلىدىغان سانلىق-مەلۇماتنىڭ چوڭلۇقى"
#: ../lib/read_data.c:70
#, c-format
msgid "read %lu byte of data"
msgid_plural "read %lu bytes of data"
msgstr[0] "%lu بايت سانلىق-مەلۇمات ئوقۇدى"
#: ../lib/write.c:51
#, c-format
msgid "wrote %d byte"
msgid_plural "wrote %d bytes"
msgstr[0] "%d بايت سانلىق-مەلۇمات يازدى"
#: ../src/daemon/gnuserv.c:455
msgid "Enable debugging"
msgstr "سازلاشنى قوزغات"
#: ../src/daemon/gnuserv.c:457
msgid "Enable verbose output"
msgstr "تەپسىلىي چىقىرىشنى قوزغات"
#: ../src/daemon/gnuserv.c:459
msgid "Don't fork into background"
msgstr "ئارقا سۇپىدا تارماق جەريان ھاسىل قىلما"
#: ../src/daemon/gnuserv.c:461
msgid "Invoked from inetd"
msgstr "«inetd» ئارقىلىق قوزغىتىلغان"
#: ../src/daemon/gnuserv.c:495
#, c-format
msgid "Run '%s --help' to see a full list of available command line options.\n"
msgstr "'%s --help' ئىجرا قىلىنسا بۇيرۇق قۇرى تاللانمىسىنىڭ تولۇق تىزىملىكى كۆرۈنىدۇ.\n"
#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27
msgid "Hangup"
msgstr "ئېسىپ قوي"
#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28
msgid "Interrupt"
msgstr "ئۆزەك"
#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29
msgid "Quit"
msgstr "چېكىن"
#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30
msgid "Illegal instruction"
msgstr "خاتا بۇيرۇق"
#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31
msgid "Trace trap"
msgstr "ئىزلاش توزىقى"
#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32
msgid "Abort"
msgstr "توختات"
#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33
msgid "EMT error"
msgstr "EMT خاتالىقى"
#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34
msgid "Floating-point exception"
msgstr "كەسىر سان خاتالىق"
#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35
msgid "Kill"
msgstr "ئاخىرلاشتۇر"
#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36
msgid "Bus error"
msgstr "باش لىنىيە خاتالىقى"
#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37
msgid "Segmentation violation"
msgstr "جەريان بۆلىكى توقۇنۇشى"
#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38
msgid "Bad argument to system call"
msgstr "سىستېما چاقىرغان پارامېتىر خاتا"
#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39
msgid "Broken pipe"
msgstr "بۇزۇلغان نەيچە"
#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40
msgid "Alarm clock"
msgstr "قوڭغۇراقلىق سائەت"
#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41
msgid "Termination"
msgstr "توختات"
#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42
msgid "Urgent condition on socket"
msgstr "socket دىكى جىددىي ئەھۋال"
#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43
msgid "Stop"
msgstr "توختا"
#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44
msgid "Keyboard stop"
msgstr "ھەرپتاختا توختات"
#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45
msgid "Continue"
msgstr "داۋاملاشتۇر"
#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46
msgid "Child status has changed"
msgstr "بالا پروگراممىنىڭ ھالىتى ئۆزگەردى"
#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47
msgid "Background read from tty"
msgstr "TTY دىن ئارقىدىن ئوقۇ"
#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48
msgid "Background write to tty"
msgstr "TTY غا ئارقىدىن ياز"
#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49
msgid "I/O now possible"
msgstr "I/O نى ئىشلەتكىلى بولىدۇ"
#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50
msgid "CPU limit exceeded"
msgstr "CPU نىڭ چەكلىمىسىدىن ئېشىپ كەتتى"
#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51
msgid "File size limit exceeded"
msgstr "ھۆججەتنىڭ ئۇزۇنلۇقى چەكتىن ئېشىپ كەتتى"
#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52
msgid "Virtual alarm clock"
msgstr "مەۋھۇم قوڭغۇراقلىق سائەت"
#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53
msgid "Profiling alarm clock"
msgstr "قوڭغۇراقلىق سائەتنىڭ سەپلىمىسى"
#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54
msgid "Window size change"
msgstr "كۆزنەك چوڭلۇقىنىڭ ئۆزگىرىشى"
#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55
msgid "Information request"
msgstr "ئۇچۇر ئىلتىماسى"
#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56
msgid "User defined signal 1"
msgstr "ئىشلەتكۈچى بېكىتكەن سىگنال 1"
#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57
msgid "User defined signal 2"
msgstr "ئىشلەتكۈچى بېكىتكەن سىگنال 2"

View File

@@ -3,7 +3,7 @@ INCLUDES = @INCLUDES@
noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la
libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
uptime.c loadavg.c shm_limits.c msg_limits.c \
uptime.c loadavg.c mountlist.c shm_limits.c msg_limits.c \
sem_limits.c proclist.c procstate.c procuid.c \
proctime.c procmem.c procsignal.c prockernel.c \
procsegment.c procargs.c procmap.c siglist.c \

View File

@@ -124,7 +124,7 @@ int try_file_to_buffer(char *buffer, size_t bufsiz, const char *format, ...)
void
file_to_buffer(glibtop *server, char *buffer, size_t bufsiz, const char *filename)
{
switch(try_file_to_buffer(buffer, bufsiz, filename))
switch(try_file_to_buffer(buffer, bufsiz, "%s", filename))
{
case TRY_FILE_TO_BUFFER_OPEN:
glibtop_error_io_r (server, "open (%s)", filename);

164
sysdeps/cygwin/mountlist.c Normal file
View File

@@ -0,0 +1,164 @@
/* mountlist.c -- return a list of mounted filesystems
Copyright (C) 1991, 1992 Free Software Foundation, Inc.
This file is a fork of sysdeps/common/mountlist.c.
This program 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, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
Local Variables:
mode: C
c-file-style: "gnu"
End:
*/
#include <config.h>
#include <stdio.h>
#include <mntent.h>
#include <glibtop.h>
#include <glibtop/mountlist.h>
#include <glibtop/error.h>
/* IgnoreList */
typedef struct
{
GHashTable *table;
} IgnoreList;
static IgnoreList*
ignore_list_new(void)
{
IgnoreList* ig;
ig = g_new(IgnoreList, 1);
ig->table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
return ig;
}
static void
ignore_list_delete(IgnoreList* ig)
{
if (ig) {
g_hash_table_destroy(ig->table);
g_free(ig);
}
}
static void
ignore_list_add(IgnoreList* ig, const char* fs)
{
g_hash_table_insert(ig->table, g_strdup(fs), GINT_TO_POINTER(1));
}
static gboolean
ignore_list_has(IgnoreList* ig, const char* fs)
{
gpointer data;
data = g_hash_table_lookup(ig->table, fs);
return data != NULL;
}
/* ~IgnoreList */
static gboolean
ignore_fs(const char *fstype, IgnoreList** ig)
{
if (!*ig) {
FILE* fs;
char line[128];
*ig = ignore_list_new();
ignore_list_add(*ig, "none");
if ((fs = fopen("/proc/filesystems", "r")) != NULL) {
while (fgets(line, sizeof line, fs)) {
if (!strncmp(line, "nodev", 5)) {
char *type;
type = g_strstrip(line + 5);
ignore_list_add(*ig, type);
}
}
fclose(fs);
}
}
return ignore_list_has(*ig, fstype);
}
glibtop_mountentry *
glibtop_get_mountlist_s(glibtop *server, glibtop_mountlist *buf, int all_fs)
{
const struct mntent *mnt;
FILE *fp;
GArray* entries;
IgnoreList* ig = NULL;
memset(buf, 0, sizeof(glibtop_mountlist));
/* wild guess, preallocate 8 entries
on a desktop, almost everyone has / and a tmpfs for udev
if all_fs, there are also proc, sys, fuse, binfmt, etc */
entries = g_array_sized_new(FALSE, FALSE, sizeof(glibtop_mountentry), 8);
if (!(fp = setmntent(MOUNTED, "r"))) {
glibtop_warn_io_r(server, "Could not open %s", MOUNTED);
goto out;
}
while ((mnt = getmntent(fp)))
{
glibtop_mountentry *me;
gsize len;
if (!all_fs && ignore_fs(mnt->mnt_type, &ig))
continue;
len = entries->len;
g_array_set_size(entries, len + 1);
me = &g_array_index(entries, glibtop_mountentry, len);
g_strlcpy(me->devname, mnt->mnt_fsname, sizeof me->devname);
g_strlcpy(me->mountdir, mnt->mnt_dir, sizeof me->mountdir);
g_strlcpy(me->type, mnt->mnt_type, sizeof me->type);
}
endmntent(fp);
out:
ignore_list_delete(ig);
buf->size = sizeof(glibtop_mountentry);
buf->number = entries->len;
buf->total = buf->number * buf->size;
buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE)
| (1 << GLIBTOP_MOUNTLIST_NUMBER)
| (1 << GLIBTOP_MOUNTLIST_TOTAL);
return (glibtop_mountentry*) g_array_free(entries, FALSE);
}

View File

@@ -79,10 +79,10 @@ glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
buffers = 0;
buf->total = memtotal;
buf->used = (memused * pagesize);
buf->used = (memused * (gulong) pagesize);
buf->free = (buf->total - buf->used);
buf->shared = 0;
buf->cached = (cached * pagesize);
buf->cached = (cached * (gulong) pagesize);
buf->buffer = buffers;
buf->user = buf->total - buf->free - buf->cached - buf->buffer;