Update of /cvsroot/sysfence/sysfence
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31696
Modified Files:
getstats.c getstats.h
Log Message:
* get_stat_value() now uses pointer as argument
Index: getstats.h
===================================================================
RCS file: /cvsroot/sysfence/sysfence/getstats.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- getstats.h 23 May 2004 20:52:22 -0000 1.7
+++ getstats.h 26 May 2004 04:11:09 -0000 1.8
@@ -25,7 +25,7 @@
sf_database *main_db;
-sf_value get_stat_value (sf_stat_def def);
+sf_value get_stat_value (sf_stat_def *def);
void stat_init (sf_database *db);
void fetch_la (sf_database *db);
Index: getstats.c
===================================================================
RCS file: /cvsroot/sysfence/sysfence/getstats.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- getstats.c 23 May 2004 20:52:22 -0000 1.10
+++ getstats.c 26 May 2004 04:11:09 -0000 1.11
@@ -25,7 +25,12 @@
#include <string.h>
#include <sys/vfs.h>
-sf_value get_stat_fs (sf_stat_def def, sf_list *fslist)
+#ifdef DEBUG
+#include <syslog.h>
+#include "log.h"
+#endif
+
+sf_value get_stat_fs (sf_stat_def *def, sf_list *fslist)
{
sf_value res;
@@ -33,7 +38,7 @@
return res;
}
-sf_value get_stat_proc (sf_stat_def def, void *proctab)
+sf_value get_stat_proc (sf_stat_def *def, void *proctab)
{
sf_value res;
@@ -41,12 +46,16 @@
return res;
}
-sf_value get_stat_value (sf_stat_def def)
+sf_value get_stat_value (sf_stat_def *def)
{
sf_value res;
- sf_res_state selector = def.arg[0].resstat;
+ sf_res_state selector = def->arg[0].resstat;
- switch (def.label) {
+#ifdef DEBUG
+ syslog (LOG_DEBUG, "get_stat_value(%s) called from %s", def_2_string(def), caller);
+#endif
+
+ switch (def->label) {
case ST_PROC:
res = get_stat_proc (def, main_db->proc);
break;
@@ -63,7 +72,7 @@
break;
case ST_LOAD:
res.type = DOUBLE;
- switch (def.arg[0].laminutes) {
+ switch (def->arg[0].laminutes) {
case 1:
res.ptr = (void *) &(main_db->load[0]);
break;
@@ -164,7 +173,7 @@
db->mem[VA_FREE],
db->mem[VA_USED],
db->swap[VA_FREE],
- db->swap[VA_USED],
+ db->swap[VA_USED]
);
#endif
}
|