From 26f21d097e13c0886191eb3eac91483e4698479f Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 22 Aug 2022 16:20:34 +0800 Subject: [PATCH] remove other os --- icons/16x16/org.xfce.panel.netload.svg | 1446 +++++---------------- icons/32x32/org.xfce.panel.netload.svg | 303 +---- icons/scalable/org.xfce.panel.netload.svg | 726 +++++------ panel-plugin/net.c | 28 +- panel-plugin/net.h | 26 - panel-plugin/netload.c | 6 +- panel-plugin/wormulon.h | 4 +- 7 files changed, 693 insertions(+), 1846 deletions(-) diff --git a/icons/16x16/org.xfce.panel.netload.svg b/icons/16x16/org.xfce.panel.netload.svg index 33e9630..a7c8df6 100644 --- a/icons/16x16/org.xfce.panel.netload.svg +++ b/icons/16x16/org.xfce.panel.netload.svg @@ -1,1136 +1,310 @@ - - - - - - Adwaita Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - GNOME Design Team - - - - - Adwaita Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/32x32/org.xfce.panel.netload.svg b/icons/32x32/org.xfce.panel.netload.svg index 5c8b0fe..0ccda12a 100644 --- a/icons/32x32/org.xfce.panel.netload.svg +++ b/icons/32x32/org.xfce.panel.netload.svg @@ -1,238 +1,65 @@ - - - - - - - Adwaita Icon Template - - - - - - - - - - - - - - - - image/svg+xml - - - - GNOME Design Team - - - - - Adwaita Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/scalable/org.xfce.panel.netload.svg b/icons/scalable/org.xfce.panel.netload.svg index 1ce1d9c..a7c8df6 100644 --- a/icons/scalable/org.xfce.panel.netload.svg +++ b/icons/scalable/org.xfce.panel.netload.svg @@ -1,416 +1,310 @@ - - - - - - - Adwaita Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - GNOME Design Team - - - - - Adwaita Icon Template - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/panel-plugin/net.c b/panel-plugin/net.c index e4b66c3..c5b9ab3 100644 --- a/panel-plugin/net.c +++ b/panel-plugin/net.c @@ -45,31 +45,9 @@ #include #include -#if defined(__HPUX__) -# include "wormulon/hpux.h" -# include "wormulon/hpux.c" -#elif defined(__APPLE__) -# include "src/macos.h" -# include "src/macos.c" -#elif (defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)) -# include "wormulon/freebsd.h" -# include "wormulon/freebsd.c" -#elif defined(__linux__) -# include "wormulon/linux.h" -# include "wormulon/linux.c" -#elif (defined(__OpenBSD__) || defined(__MicroBSD__)) -# include "wormulon/openbsd.h" -# include "wormulon/openbsd.c" -#elif defined(__NetBSD__) -# include "wormulon/netbsd.h" -# include "wormulon/netbsd.c" -#elif defined(__Solaris__) -# include "wormulon/solaris.h" -# include "wormulon/solaris.c" -#else -/* should not get here */ -# error "OS not supported" -#endif +#include "wormulon/linux.h" +#include "wormulon/linux.c" + /* ---------------------------------------------------------------------------------------------- */ diff --git a/panel-plugin/net.h b/panel-plugin/net.h index 4c17e46..f43e138 100644 --- a/panel-plugin/net.h +++ b/panel-plugin/net.h @@ -66,33 +66,7 @@ typedef struct DataStats stats; int up; int up_update_count; -#if defined(__HPUX__) - int wait_pcks_counter; - nmapi_logstat* if_ptr; -#elif (defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)) - int watchif; - int dev_opened; -#elif defined(__NetBSD__) - int mib_name1[6]; - int mib_name2[6]; - char* buf1; - char* buf2; - int alloc1; - int alloc2; -#elif (defined(__OpenBSD__) || defined(__MicroBSD__) || defined(__APPLE__)) - int mib_name1[6]; - int mib_name2[6]; - char* buf1; - char* buf2; - int alloc1; - int alloc2; -#elif defined(__linux__) FILE* proc_net_dev; -#elif defined(__Solaris__) -#else -#error "OS not supported" -#endif - } netdata; diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c index 000a215..275e6ee 100644 --- a/panel-plugin/netload.c +++ b/panel-plugin/netload.c @@ -58,7 +58,7 @@ static gchar* DEFAULT_COLOR[] = { "#FF4F00", "#FFE500" }; #define TOT 2 #define SUM 2 -#define APP_NAME N_("Xfce4-Netload-Plugin") +#define APP_NAME N_("Xfce4-Speed-Plugin") static char *errormessages[] = { N_("Unknown error."), @@ -992,7 +992,7 @@ static gboolean add_interface(const gchar *name, gpointer ignore, t_global_monit static gint monitor_populate_interface_list(t_global_monitor *global) { gint count = 0; -#if defined(__linux__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) + struct ifaddrs *addrs = NULL, *addr; if (getifaddrs(&addrs) == 0) @@ -1014,7 +1014,7 @@ static gint monitor_populate_interface_list(t_global_monitor *global) g_tree_unref(found_ifaces); freeifaddrs(addrs); } -#endif /* __linux__ || __OpenBSD__ || __FreeBSD__ || __NetBSD__ */ + return count; } diff --git a/panel-plugin/wormulon.h b/panel-plugin/wormulon.h index 21da346..3db595b 100644 --- a/panel-plugin/wormulon.h +++ b/panel-plugin/wormulon.h @@ -15,9 +15,9 @@ #define FALSE 0 #endif -#ifdef __linux__ + #define PATH_NET_DEV "/proc/net/dev" -#endif + /* define possible options */ #define OPT_NONE 0x0000