[Xfce4-commits] [panel-plugins/xfce4-netload-plugin] 01/02: Revive commandline.c test program

noreply at xfce.org noreply at xfce.org
Sat Nov 15 23:00:19 CET 2014


This is an automated email from the git hooks/post-receive script.

mmassonnet pushed a commit to branch master
in repository panel-plugins/xfce4-netload-plugin.

commit d6d8e31dac274ec73b082da9fcce9247d71e5157
Author: Mike Massonnet <m8t at gandi.net>
Date:   Sat Nov 15 22:59:30 2014 +0100

    Revive commandline.c test program
---
 panel-plugin/Makefile.am   |    5 +++++
 panel-plugin/commandline.c |    9 +++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 94f6b95..f37efa2 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -33,6 +33,11 @@ libnetload_la_LIBADD =							\
 	@LIBXFCE4PANEL_LIBS@						\
 	@LIBXFCE4UI_LIBS@
 
+check_PROGRAMS = commandline
+commandline_SOURCES = commandline.c utils.c utils.h net.c net.h
+commandline_CFLAGS = @LIBXFCE4PANEL_CFLAGS@
+commandline_LDADD = @LIBXFCE4PANEL_LIBS@
+
 # .desktop file
 #
 # Some automake trickery here. Because we cannot use $(libexecdir) in the
diff --git a/panel-plugin/commandline.c b/panel-plugin/commandline.c
index 9493c66..5624845 100644
--- a/panel-plugin/commandline.c
+++ b/panel-plugin/commandline.c
@@ -33,9 +33,6 @@
 
 #include "net.h"
 #include "utils.h"
-/* This is not good style, but it works for testing and simplifies compilation */ 
-#include "net.c"
-#include "utils.c"
 
 netdata data;
 
@@ -76,9 +73,9 @@ int main(int argc, char* argv[])
     for (;;)
     {
         get_current_netload(&data, &in, &out, &tot);
-        format_with_thousandssep(bufIn, 20, (double)in, 2);
-        format_with_thousandssep(bufOut, 20, (double)in, 2);
-        format_with_thousandssep(bufTot, 20, (double)in, 2);
+        format_byte_humanreadable(bufIn, 20, (double)in, 0);
+        format_byte_humanreadable(bufOut, 20, (double)out, 0);
+        format_byte_humanreadable(bufTot, 20, (double)tot, 0);
         printf("Current netload:\nIN : %s\nOUT: %s\nTOT: %s\nIP: %s\n", 
             bufIn, bufOut, bufTot, get_ip_address(&data));
         sleep(1);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list