Experimental RSS code.
[monky] / src / common.c
index 7e65fd3..233a2b3 100644 (file)
@@ -7,8 +7,6 @@
  */
 
 #include "conky.h"
-#include "remoted.h"
-#include "remotec.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -129,6 +127,11 @@ struct net_stat *get_net_stat(const char *dev)
        return 0;
 }
 
+void clear_net_stats (void)
+{
+  memset (netstats, 0, sizeof(netstats));
+}
+
 void format_seconds(char *buf, unsigned int n, long t)
 {
        if (t >= 24 * 60 * 60)  /* hours necessary when there are days? */
@@ -157,6 +160,7 @@ static double last_meminfo_update;
 static double last_fs_update;
 
 unsigned long long need_mask;
+#define NEED(a) ((need_mask & (1 << a)) && ((info.mask & (1 << a)) == 0))
 
 void update_stuff()
 {
@@ -167,7 +171,7 @@ void update_stuff()
                need_mask |= 1 << INFO_BUFFERS;
 
        /* clear speeds and up status in case device was removed and doesn't get
-        * updated */
+          updated */
 
        for (i = 0; i < 16; i++) {
                if (netstats[i].dev) {
@@ -178,8 +182,6 @@ void update_stuff()
        }
 
        prepare_update();
-       /* client(); this is approximately where the client should be called */
-#define NEED(a) ((need_mask & (1 << a)) && ((info.mask & (1 << a)) == 0))
 
        if (NEED(INFO_UPTIME))
                update_uptime();
@@ -205,31 +207,26 @@ void update_stuff()
        if (NEED(INFO_MAIL))
                update_mail_count();
 
-
-
 #if defined(__linux__)
        if (NEED(INFO_I8K))
                update_i8k();
 #endif /* __linux__ */
        
-#ifdef MLDONKEY
-       if (NEED(INFO_MLDONKEY))
-               get_mldonkey_status(&mlconfig, &mlinfo);
-#endif
-
-#ifdef SETI
-       if (NEED(INFO_SETI))
-               update_seti();
-#endif
-
 #ifdef MPD
        if (NEED(INFO_MPD))
                update_mpd();
 #endif
-#if defined(XMMS_H) || defined(BMP_H) || defined(AUDACIOUS_H) || defined(INFOPIPE_H)
-       if (NEED(INFO_XMMS))
-               update_xmms();
+
+#ifdef XMMS2
+       if (NEED(INFO_XMMS2))
+               update_xmms2();
 #endif
+
+#ifdef AUDACIOUS
+       if (NEED(INFO_AUDACIOUS))
+               update_audacious();
+#endif
+
 #ifdef BMPX
        if (NEED(INFO_BMPX))
                 update_bmpx();
@@ -260,6 +257,8 @@ void update_stuff()
        if (NEED(INFO_TCP_PORT_MONITOR))
                update_tcp_port_monitor_collection( info.p_tcp_port_monitor_collection );
 #endif
+       if (NEED(INFO_ENTROPY))
+               update_entropy();
 }
 
 int round_to_int(float f)