plugin_ppp.c \
plugin_proc_stat.c \
plugin_seti.c \
+plugin_statfs.c \
plugin_uname.c \
plugin_uptime.c \
plugin_wireless.c \
#liblcd4linux_la_SOURCES =
-EXTRA_lcd4linux_SOURCES = drv_generic_text.c drv_generic_text.h drv_generic_graphic.c drv_generic_graphic.h drv_generic_serial.c drv_generic_serial.h drv_generic_parport.c drv_generic_parport.h drv_generic_i2c.c drv_generic_i2c.h drv_BeckmannEgle.c drv_BWCT.c drv_Crystalfontz.c drv_Curses.c drv_Cwlinux.c drv_HD44780.c drv_Image.c drv_LCDLinux.c drv_LCDTerm.c drv_M50530.c drv_MatrixOrbital.c drv_MilfordInstruments.c drv_NULL.c drv_RouterBoard.c drv_SimpleLCD.c drv_T6963.c drv_USBLCD.c drv_X11.c font_6x8.h plugin_apm.c plugin_cpuinfo.c plugin_diskstats.c plugin_dvb.c plugin_exec.c plugin_i2c_sensors.c plugin_imon.c plugin_isdn.c plugin_loadavg.c plugin_meminfo.c plugin_mysql.c plugin_netdev.c plugin_pop3.c plugin_ppp.c plugin_proc_stat.c plugin_seti.c plugin_uname.c plugin_uptime.c plugin_wireless.c plugin_xmms.c
+EXTRA_lcd4linux_SOURCES = drv_generic_text.c drv_generic_text.h drv_generic_graphic.c drv_generic_graphic.h drv_generic_serial.c drv_generic_serial.h drv_generic_parport.c drv_generic_parport.h drv_generic_i2c.c drv_generic_i2c.h drv_BeckmannEgle.c drv_BWCT.c drv_Crystalfontz.c drv_Curses.c drv_Cwlinux.c drv_HD44780.c drv_Image.c drv_LCDLinux.c drv_LCDTerm.c drv_M50530.c drv_MatrixOrbital.c drv_MilfordInstruments.c drv_NULL.c drv_RouterBoard.c drv_SimpleLCD.c drv_T6963.c drv_USBLCD.c drv_X11.c font_6x8.h plugin_apm.c plugin_cpuinfo.c plugin_diskstats.c plugin_dvb.c plugin_exec.c plugin_i2c_sensors.c plugin_imon.c plugin_isdn.c plugin_loadavg.c plugin_meminfo.c plugin_mysql.c plugin_netdev.c plugin_pop3.c plugin_ppp.c plugin_proc_stat.c plugin_seti.c plugin_statfs.c plugin_uname.c plugin_uptime.c plugin_wireless.c plugin_xmms.c
EXTRA_DIST = lcd4linux.conf.sample lcd4kde.conf lcd4linux.kdelnk lcd4linux.xpm lcd4linux.lsm curses.m4 AUTHORS CREDITS FAQ NEWS TODO README README.Drivers README.Plugins README.KDE plugin_sample.c
.deps/plugin_imon.P .deps/plugin_isdn.P .deps/plugin_loadavg.P \
.deps/plugin_math.P .deps/plugin_meminfo.P .deps/plugin_mysql.P \
.deps/plugin_netdev.P .deps/plugin_pop3.P .deps/plugin_ppp.P \
-.deps/plugin_proc_stat.P .deps/plugin_seti.P .deps/plugin_string.P \
-.deps/plugin_test.P .deps/plugin_time.P .deps/plugin_uname.P \
-.deps/plugin_uptime.P .deps/plugin_wireless.P .deps/plugin_xmms.P \
-.deps/qprintf.P .deps/thread.P .deps/timer.P .deps/udelay.P \
-.deps/widget.P .deps/widget_bar.P .deps/widget_icon.P \
+.deps/plugin_proc_stat.P .deps/plugin_seti.P .deps/plugin_statfs.P \
+.deps/plugin_string.P .deps/plugin_test.P .deps/plugin_time.P \
+.deps/plugin_uname.P .deps/plugin_uptime.P .deps/plugin_wireless.P \
+.deps/plugin_xmms.P .deps/qprintf.P .deps/thread.P .deps/timer.P \
+.deps/udelay.P .deps/widget.P .deps/widget_bar.P .deps/widget_icon.P \
.deps/widget_text.P
SOURCES = $(lcd4linux_SOURCES) $(EXTRA_lcd4linux_SOURCES)
OBJECTS = $(lcd4linux_OBJECTS)
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
+/* Define to 1 if you have the <sys/statfs.h> header file. */
+#undef HAVE_SYS_STATFS_H
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* seti plugin */
#undef PLUGIN_SETI
+/* statfs plugin */
+#undef PLUGIN_STATFS
+
/* uname plugin */
#undef PLUGIN_UNAME
PLUGIN_PPP="yes"
PLUGIN_PROC_STAT="yes"
PLUGIN_SETI="yes"
+ PLUGIN_STATFS="yes"
PLUGIN_UNAME="yes"
PLUGIN_UPTIME="yes"
PLUGIN_WIRELESS="yes"
seti)
PLUGIN_SETI=$val
;;
+ statfs)
+ PLUGIN_STATFS=$val
+ ;;
uname)
PLUGIN_UNAME=$val
;;
#define PLUGIN_SETI 1
_ACEOF
+fi
+if test "$PLUGIN_STATFS" = "yes"; then
+ PLUGINS="$PLUGINS plugin_statfs.o"
+
+cat >>confdefs.h <<\_ACEOF
+#define PLUGIN_STATFS 1
+_ACEOF
+
fi
if test "$PLUGIN_UNAME" = "yes"; then
PLUGINS="$PLUGINS plugin_uname.o"
-for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h termios.h unistd.h
+
+for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/statfs.h sys/time.h syslog.h termios.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h termios.h unistd.h])
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/statfs.h sys/time.h syslog.h termios.h unistd.h])
AC_CHECK_HEADERS(sys/io.h asm/io.h)
AC_CHECK_HEADERS(linux/parport.h linux/ppdev.h)
AC_CHECK_HEADERS(asm/msr.h)
-/* $Id: plugin.c,v 1.35 2005/01/18 06:30:23 reinelt Exp $
+/* $Id: plugin.c,v 1.36 2005/04/03 07:07:51 reinelt Exp $
*
* plugin handler for the Evaluator
*
*
*
* $Log: plugin.c,v $
+ * Revision 1.36 2005/04/03 07:07:51 reinelt
+ * added statfs plugin
+ *
* Revision 1.35 2005/01/18 06:30:23 reinelt
* added (C) to all copyright statements
*
void plugin_exit_proc_stat (void);
int plugin_init_seti(void);
void plugin_exit_seti(void);
+int plugin_init_statfs(void);
+void plugin_exit_statfs(void);
int plugin_init_uname (void);
void plugin_exit_uname (void);
int plugin_init_uptime (void);
#ifdef PLUGIN_SETI
plugin_init_seti();
#endif
+#ifdef PLUGIN_STATFS
+ plugin_init_statfs();
+#endif
#ifdef PLUGIN_UNAME
plugin_init_uname();
#endif
#ifdef PLUGIN_SETI
plugin_exit_seti();
#endif
+#ifdef PLUGIN_STATFS
+ plugin_exit_statfs();
+#endif
#ifdef PLUGIN_UNAME
plugin_exit_uname();
#endif
--- /dev/null
+/* $Id: plugin_statfs.c,v 1.1 2005/04/03 07:07:51 reinelt Exp $
+ *
+ * plugin for statfs() syscall
+ *
+ * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at>
+ * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
+ *
+ * This file is part of LCD4Linux.
+ *
+ * LCD4Linux 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.
+ *
+ * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *
+ * $Log: plugin_statfs.c,v $
+ * Revision 1.1 2005/04/03 07:07:51 reinelt
+ * added statfs plugin
+ *
+ */
+
+/*
+ * exported functions:
+ *
+ * int plugin_init_statfs (void)
+ * adds statfs() functions
+ *
+ */
+
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/vfs.h>
+
+#include "debug.h"
+#include "plugin.h"
+
+
+
+static void my_statfs (RESULT *result, RESULT *arg1, RESULT *arg2)
+{
+ struct statfs buf;
+ char *path, *key;
+ double value;
+
+ path = R2S(arg1);
+ key = R2S(arg2);
+
+ if (statfs(path, &buf)!=0) {
+ error("statfs(%s) failed: %s", path, strerror(errno));
+ SetResult(&result, R_STRING, "");
+ return;
+ }
+
+ if (strcasecmp(key, "type")==0) {
+ value = buf.f_type;
+ } else if (strcasecmp(key, "bsize")==0) {
+ value = buf.f_bsize;
+ } else if (strcasecmp(key, "blocks")==0) {
+ value = buf.f_blocks;
+ } else if (strcasecmp(key, "bfree")==0) {
+ value = buf.f_bfree;
+ } else if (strcasecmp(key, "bavail")==0) {
+ value = buf.f_bavail;
+ } else if (strcasecmp(key, "files")==0) {
+ value = buf.f_files;
+ } else if (strcasecmp(key, "ffree")==0) {
+ value = buf.f_ffree;
+#if 0
+ } else if (strcasecmp(key, "fsid")==0) {
+ value = buf.f_fsid;
+#endif
+ } else if (strcasecmp(key, "namelen")==0) {
+ value = buf.f_namelen;
+ } else {
+ error("statfs: unknown field '%s'", key);
+ value = -1;
+ }
+
+ SetResult(&result, R_NUMBER, &value);
+}
+
+
+int plugin_init_statfs (void)
+{
+ AddFunction ("statfs", 2, my_statfs);
+ return 0;
+}
+
+void plugin_exit_statfs(void)
+{
+}
PLUGIN_PPP="yes"
PLUGIN_PROC_STAT="yes"
PLUGIN_SETI="yes"
+ PLUGIN_STATFS="yes"
PLUGIN_UNAME="yes"
PLUGIN_UPTIME="yes"
PLUGIN_WIRELESS="yes"
seti)
PLUGIN_SETI=$val
;;
+ statfs)
+ PLUGIN_STATFS=$val
+ ;;
uname)
PLUGIN_UNAME=$val
;;
PLUGINS="$PLUGINS plugin_seti.o"
AC_DEFINE(PLUGIN_SETI,1,[seti plugin])
fi
+if test "$PLUGIN_STATFS" = "yes"; then
+ PLUGINS="$PLUGINS plugin_statfs.o"
+ AC_DEFINE(PLUGIN_STATFS,1,[statfs plugin])
+fi
if test "$PLUGIN_UNAME" = "yes"; then
PLUGINS="$PLUGINS plugin_uname.o"
AC_DEFINE(PLUGIN_UNAME,1,[uname plugin])